Пример #1
0
        public ScenarioClass(AAAMemento semanticModelState)
        {
            this.semanticModel = new AAA(semanticModelState);
            this.semanticModelState = semanticModelState;
            this.scenario = new Semantics(this, semanticModel);
            this.specGenerator = new TextSpecGenerator();
            this.metadataParser = new TestMetadataParser(this);

            semanticModelState.Text = metadataParser.TranslateTestClassNameToText();
        }
Пример #2
0
        public static void Start(string scenarioNavn, Object test, Action<Semantikk> scenario)
        {
            var nyttScenario = new Scenario();
            scenario(new Semantikk(nyttScenario.semantiskModel, test));

            var tekstSpesifikasjonGenerator = new TextSpecGenerator(new TextSpecTemplate()
            {
                GivenText = "Gitt",
                AndText = "Og",
                WhenText = "Når",
                ThenText = "Så"
            });

            tekstSpesifikasjonGenerator.Generate(nyttScenario.Tilstand);
            Console.WriteLine(tekstSpesifikasjonGenerator.Output);

            nyttScenario.semantiskModel.Execute();
        }
Пример #3
0
        public void Shall_be_possible_to_specify_Template()
        {
            semanticModel.Arrange("that there are changesets in sourceControl", () => { });
            semanticModel.Arrange("user have access", () => { });
            semanticModel.Act("user checkout repository", () => { });
            semanticModel.Assert("latest version is returned", () => { });

            specGenerator = new TextSpecGenerator(new TextSpecTemplate()
            {
                GivenText = "Gitt",
                AndText = "Og",
                ThenText = "Så",
                WhenText = "Når"
            });

            specGenerator.Generate(state);

            specGenerator.Output.StringShouldContain("Gitt that there are changesets in sourceControl");
            specGenerator.Output.StringShouldContain("Og user have access");
            specGenerator.Output.StringShouldContain("Når user checkout repository");
            specGenerator.Output.StringShouldContain("Så latest version is returned");
        }
Пример #4
0
 public void Setup()
 {
     state = new AAAMemento();
     semanticModel = new AAA(state);
     specGenerator = new TextSpecGenerator();
 }
Пример #5
0
 public ScenarioSpecialCase(SemanticModel.AAA semanticModel, SemanticModel.AAAMemento state)
 {
     this.semanticModel = semanticModel;
     State = state;
     specDocumentGenerator = new TextSpecGenerator();
 }