Skip to main content

Posts

Showing posts with the label testmethod

Unit test classes - using a base class

Mai mult ca sigur cu toții am scris teste. 1,2, 3 .. n clase de teste. Într-un anumit moment ajungem sa dorim sa refactorizam codul, iar o parte din logica (setup-ul testelor) sa îl ducem în clasa de baza. public class Test1: BaseTest {     [TestMethod]     public void Method1Test()     {         Console.WriteLine("Method1Test");     }     [TestInitialize]     public void TestInit()     {         Console.WriteLine("TestInitialize");     }         [TestCleanup]     public void TestCleanup()     {         Console.WriteLine("TestCleanup");     }         [ClassInitialize]     ...