示例#1
0
        public void Setup()
        {
            semanticModelState = new SM.AAAMemento();
            semanticModel = new SM.AAA(semanticModelState);
            semanticModel.Act("user checkout", () => { });

            thenSemantics = new ThenSemantics(this, semanticModel);
        }
示例#2
0
        public void Setup()
        {
            output = "";
            semanticModelMemento = new AAAMemento();
            semanticModel = new AAA(semanticModelMemento);

            semanticModel.Text("A description of the semanticModel instance");

            semanticModel.Arrange("Arrange", () => output += "Arrange");

            semanticModel.Act("Act1", () => output += "Act1");

            semanticModel.Assert("Assert1", () => output += "Assert1");

            semanticModel.Act("Act2", () => output += "Act2");

            semanticModel.Assert("Assert2", () => output += "Assert2");
        }
示例#3
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");
        }
示例#4
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();
        }