Ejemplo n.º 1
0
        public void Should_be_ble_to_execute_without_arrange()
        {
            var output = "";
            var newAAA = new AAA();
            newAAA.Act("Act1", () =>
                output += "Act1");
            newAAA.Assert("Assert1", () =>
                output += "Assert1");

            newAAA.Execute();

            output.ShouldBe("Act1Assert1");
        }
Ejemplo n.º 2
0
        public void Should_rearrange_for_every_acts()
        {
            var number = 0;

            var newAAA = new AAA();

            newAAA.Arrange("Set start value", () =>
                number = 1);

            newAAA.Act("Multiply with two", () =>
                number *= 2);
            newAAA.Assert("Value should be two", () =>
                number.ShouldBe(2));

            newAAA.Act("Multiply with four", () =>
                number *= 4);
            newAAA.Assert("Value should be four", () =>
                number.ShouldBe(4));

            newAAA.Execute();
        }