Beispiel #1
0
        public void EnqueueTestToRun_ValidTest_TestCanBeDequeued(
            [Values(null, "MyNamespace")]   string testNamespace,
            [Values(null, "MyClass")]       string testClass,
            [Values(null, "MyFunction")]    string testFunction,
            [Values(null, "A.B.C(1,'a')")]  string testName
            )
        {
            // Setup:
            Test test = new Test {
                TestNamespace = testNamespace,
                TestClass     = testClass,
                TestFunction  = testFunction,
                TestName      = testName ?? StringUtils.FormatInvariant("{0}.{1}.{2}",
                                                                        testNamespace, testClass, testFunction)
            };

            // Execute:
            Assert.DoesNotThrow(() => _testqueue.EnqueueTestToRun(test),
                                "{0}.{1}() shouldn't throw an Exception if you pass it a valid test!",
                                nameof(TestQueue), nameof(TestQueue.EnqueueTestToRun));

            // Verify:
            Test dequeuedTest = null;

            Assert.DoesNotThrow(() => dequeuedTest = _testqueue.DequeueTestToRun(),
                                "{0}.{1}() shouldn't throw an exception if a test has been added to the queue!",
                                nameof(TestQueue), nameof(TestQueue.EnqueueTestToRun));

            AssertTestsAreEqual(test, dequeuedTest);
        }