Example #1
0
        public void Map_Null_ReturnsNull()
        {
            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(null);

            Check.That(actual).IsNull();
        }
Example #2
0
        public void Map_SomeScenarioOutline_ReturnsSomeJsonScenarioOutline()
        {
            var scenarioOutline = new ScenarioOutline();

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual).IsNotNull();
        }
Example #3
0
        public void Map_NoTags_ReturnsEmptyListOfTags()
        {
            var scenarioOutline = new ScenarioOutline {
                Tags = null
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Tags.Count).IsEqualTo(0);
        }
Example #4
0
        public void Map_NoSteps_ReturnsEmtpyListOfSteps()
        {
            var scenarioOutline = new ScenarioOutline {
                Steps = null
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Steps.Count).IsEqualTo(0);
        }
Example #5
0
        public void Map_WithDescription_ReturnsSlug()
        {
            var scenarioOutline = new ScenarioOutline {
                Slug = "i-am-a-slug"
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Slug).IsEqualTo("i-am-a-slug");
        }
Example #6
0
        public void Map_WithDescription_ReturnsDescription()
        {
            var scenarioOutline = new ScenarioOutline {
                Description = "Some description"
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Description).IsEqualTo("Some description");
        }
Example #7
0
        public void Map_WithName_ReturnsName()
        {
            var scenarioOutline = new ScenarioOutline {
                Name = "Some name"
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Name).IsEqualTo("Some name");
        }
Example #8
0
        public void Map_Always_ReturnsNullFeature()
        {
            var scenarioOutline = new ScenarioOutline
            {
                Feature = new Feature()
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Feature).IsNull();
        }
Example #9
0
        public void Map_WithResult_ReturnsResult()
        {
            var scenarioOutline = new ScenarioOutline {
                Result = TestResult.Passed
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Result.WasExecuted).IsTrue();
            Check.That(actual.Result.WasSuccessful).IsTrue();
        }
Example #10
0
        public void Map_WithTags_ReturnsTags()
        {
            var scenarioOutline = new ScenarioOutline
            {
                Tags = new List <string>()
                {
                    "tag1",
                    "tag2"
                }
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Tags).ContainsExactly("tag1", "tag2");
        }
Example #11
0
        public void Map_Example_ReturnsExample()
        {
            var scenarioOutline = new ScenarioOutline
            {
                Examples = new List <Example>
                {
                    new Example {
                        Name = "Name of the example"
                    }
                }
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Examples[0].Name).IsEqualTo("Name of the example");
        }
Example #12
0
        public void Map_WithSteps_ReturnsSteps()
        {
            var scenarioOutline = new ScenarioOutline
            {
                Steps = new List <Step>
                {
                    new Step {
                        Name = "I perform a step"
                    }
                }
            };

            var mapper = CreateMapper();

            JsonScenarioOutline actual = mapper.Map(scenarioOutline);

            Check.That(actual.Steps[0].Name).IsEqualTo("I perform a step");
        }