Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public void AddTestFromMetadataShouldAddTestToList()
        {
            var testList = new TestList(processContextMock.Object);

            testList.AddTest(metadata);
            Assert.That(testList.Tests.Count() == 1);
        }
Exemplo n.º 3
0
        public void AddTestFromMetadataShouldCreateTestWithMetadata()
        {
            var testList = new TestList(processContextMock.Object);
            var test     = testList.AddTest(metadata);

            Assert.That(test.Metadata == metadata);
        }
Exemplo n.º 4
0
        public void AddExisitingTestShouldAddTestToList()
        {
            var testMock = new Mock <ITest>();
            var testList = new TestList(processContextMock.Object);

            testList.AddTest(testMock.Object);
            Assert.That(testList.Tests.Count() == 1);
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
        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());
        }
Exemplo n.º 7
0
        public void AddTestFromTestShouldThrowExceptionWheTestIsNull()
        {
            var testList = new TestList(processContextMock.Object);

            Assert.Throws(Is.InstanceOf <ArgumentNullException>().With.Message.Contains("test"), () => testList.AddTest((ITest)null));
        }
Exemplo n.º 8
0
 internal protected void AddTest(ITest test)
 {
     TestList.AddTest(test);
 }
Exemplo n.º 9
0
 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)));
 }