public void RunShouldRunTestsInList() { var testMock = new Mock <ITest>(); var testList = new TestList(processContextMock.Object); testList.AddTest(testMock.Object); testList.AddTest(testMock.Object); testList.AddTest(testMock.Object); testList.Run(); testMock.Verify(t => t.Run(), Times.Exactly(3)); }
public void AddTestFromMetadataShouldAddTestToList() { var testList = new TestList(processContextMock.Object); testList.AddTest(metadata); Assert.That(testList.Tests.Count() == 1); }
public void AddTestFromMetadataShouldCreateTestWithMetadata() { var testList = new TestList(processContextMock.Object); var test = testList.AddTest(metadata); Assert.That(test.Metadata == metadata); }
public void AddExisitingTestShouldAddTestToList() { var testMock = new Mock <ITest>(); var testList = new TestList(processContextMock.Object); testList.AddTest(testMock.Object); Assert.That(testList.Tests.Count() == 1); }
public void ClearShouldClearTestsInList() { var testMock = new Mock <ITest>(); var testList = new TestList(processContextMock.Object); testList.AddTest(testMock.Object); testList.Clear(); testMock.Verify(t => t.Clear()); }
public void ClearShouldClearList() { var testMock = new Mock <ITest>(); var testList = new TestList(processContextMock.Object); testList.AddTest(testMock.Object); Assert.That(testList.Tests.Count() == 1); testList.Clear(); Assert.That(!testList.Tests.Any()); }
public void AddTestFromTestShouldThrowExceptionWheTestIsNull() { var testList = new TestList(processContextMock.Object); Assert.Throws(Is.InstanceOf <ArgumentNullException>().With.Message.Contains("test"), () => testList.AddTest((ITest)null)); }
internal protected void AddTest(ITest test) { TestList.AddTest(test); }
internal protected ITest AddTest(int testNumber, string testDescription, Action testAction, Action beforeTestAction = null, Action afterTestAction = null, int sleepMillis = 1000) { return(TestList.AddTest(new DefaultTestMetadata(testNumber, testDescription, testAction, sleepMillis, beforeTestAction, afterTestAction))); }