public void Map_Null_ReturnsNull() { var mapper = CreateMapper(); JsonScenario actual = mapper.Map(null); Check.That(actual).IsNull(); }
public void AllTags_NoTagsInFeatureElementAndInFeature_ReturnsEmptyList() { var scenario = new JsonScenario { Feature = new JsonFeature() }; IReadOnlyList <string> tags = scenario.AllTags(); Assert.IsEmpty(tags); }
public void Map_SomeScenario_ReturnsSomeJsonScenario() { var scenario = new Scenario(); var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual).IsNotNull(); }
public void Map_WithName_ReturnsName() { var scenario = new Scenario { Name = "Some name" }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Name).IsEqualTo("Some name"); }
public void Map_NoTags_ReturnsEmptyListOfTags() { var scenario = new Scenario { Tags = null }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Tags.Count).IsEqualTo(0); }
public void Map_NoSteps_ReturnsEmtpyListOfSteps() { var scenario = new Scenario { Steps = null }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Steps.Count).IsEqualTo(0); }
public void Map_WithDescription_ReturnsDescription() { var scenario = new Scenario { Description = "Some description" }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Description).IsEqualTo("Some description"); }
public void Map_WithName_ReturnsSlug() { var scenario = new Scenario { Slug = "i-am-a-slug" }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Slug).IsEqualTo("i-am-a-slug"); }
public void Map_Always_ReturnsNullFeature() { var scenario = new Scenario { Feature = new Feature() }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Feature).IsNull(); }
public void Map_WithResult_ReturnsResult() { var scenario = new Scenario { Result = TestResult.Passed }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Result.WasExecuted).IsTrue(); Check.That(actual.Result.WasSuccessful).IsTrue(); }
public void AllTags_TagsInFeatureElement_ReturnsTags() { var scenario = new JsonScenario { Feature = new JsonFeature(), Tags = new List <string> { "tag1", "tag2" } }; IReadOnlyList <string> tags = scenario.AllTags(); CollectionAssert.AreEquivalent(new[] { "tag1", "tag2" }, tags); }
public void Map_WithTags_ReturnsTags() { var scenario = new Scenario { Tags = new List <string>() { "tag1", "tag2" } }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Tags).ContainsExactly("tag1", "tag2"); }
public void Map_WithSteps_ReturnsSteps() { var scenario = new Scenario { Steps = new List <Step> { new Step { Name = "I perform a step" } } }; var mapper = CreateMapper(); JsonScenario actual = mapper.Map(scenario); Check.That(actual.Steps[0].Name).IsEqualTo("I perform a step"); }
public void AllTags_TagsBothInScenarioAndInFeatureElement_ReturnsEachTagOnlyOnce() { var scenario = new JsonScenario { Feature = new JsonFeature { Tags = new List <string> { "tag1" } }, Tags = new List <string> { "tag1" } }; IReadOnlyList <string> tags = scenario.AllTags(); CollectionAssert.AreEquivalent(new[] { "tag1" }, tags); }