Esempio n. 1
0
        public void Execute_ExecutesSingleStep()
        {
            bool stepSet = false;

            theCollection.Push(() => { stepSet = true; return(true); });
            theCollection.Execute();
            Assert.IsTrue(stepSet);
        }
Esempio n. 2
0
        public void ExecTestCase_AppliesCorrectNumberOfBindingsMultipleFacettes()
        {
            var n = typeof(TestyHarness);

            TestyHarness.valueSets.Clear();
            IOCSetup();

            Api.CreateFacette("TestFac", new List <object>()
            {
                1, 2, 3
            });
            Api.CreateFacette("TestFac2", new List <object>()
            {
                4, 5, 6
            });
            Api.BeginTestCase(n.AssemblyQualifiedName, null);
            Api.AddFacette("TestFac", 1, 2);
            Api.AddFacette("TestFac2", 1, 1);

            var coll = new AssertCollection();

            coll.Push(() => true);
            Api.CommitTestCaseCode(coll);
            Api.ExecTestCase();

            var res = Api.GetResults();

            Assert.AreEqual(18, res.Count);
        }
Esempio n. 3
0
        public void ExecTestCase_Throws_NoTestCaseStartedException_IfNoTestCaseWasBegun()
        {
            var n = typeof(TestyHarness);

            IOCSetup();

            try
            {
                var coll = new AssertCollection();
                coll.Push(() => true);
                Api.CommitTestCaseCode(coll);
                Api.ExecTestCase();
                Assert.Fail("Did not throw execption!");
            }
            catch (NoTestCaseStartedException)
            {
                // All good!
                return;
            }
        }
Esempio n. 4
0
        public void ExecTestCase_AppliesBindings()
        {
            var n = typeof(TestyHarness);

            IOCSetup();

            Api.CreateFacette("TestFac", new List <object>()
            {
                1, 2, 3
            });
            Api.BeginTestCase(n.AssemblyQualifiedName, null);
            Api.AddFacette("TestFac", 1, 1);

            var coll = new AssertCollection();

            coll.Push(() => true);
            Api.CommitTestCaseCode(coll);
            Api.ExecTestCase();

            Assert.AreEqual(3, TestyHarness.valueSets.Count);
        }