コード例 #1
0
        public void get_the_cells()
        {
            FactAssertion assertion = FactAssertion.Create(x => x.MethodWithArgs(null, 0),
                                                           new AssertionFixture());
            IList <Cell> actual   = assertion.GetCells();
            var          expected = new List <Cell>
            {
                Cell.For <string>("name"),
                Cell.For <int>("age"),
                Cell.For <bool>("returnValue")
            };

            TestUtility.AssertListMatches((IList)actual, expected);
        }
コード例 #2
0
        public void execute_with_exception()
        {
            FactAssertion assertion = FactAssertion.Create(x => x.Exception(), new AssertionFixture());
            var           step      = new Step();

            var context = new TestContext();

            assertion.Execute(step, context);
            context.Counts.ShouldEqual(0, 0, 1, 0);

            step.Get("returnValue").Parse <bool>().ShouldBeTrue();
            context.ResultsFor(step).ActualDisplay <bool>("returnValue").ShouldBeFalse();
            context.ResultsFor(step).ExceptionText.ShouldContain("NotImplementedException");
        }