/Tests/GeneratorTests/GeneratorContainerBuilderTests.cs
C# | 38 lines | 35 code | 3 blank | 0 comment | 0 complexity | bb32b7b7d907ae0522c8d3048d701528 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
- using System;
- using System.Linq;
- using FluentAssertions;
- using NUnit.Framework;
- using TechTalk.SpecFlow.Generator;
- using TechTalk.SpecFlow.Generator.Configuration;
- using TechTalk.SpecFlow.Generator.Interfaces;
- namespace TechTalk.SpecFlow.GeneratorTests
- {
- [TestFixture]
- public class GeneratorContainerBuilderTests
- {
- [Test]
- public void Should_create_a_container()
- {
- var container = GeneratorContainerBuilder.CreateContainer(new SpecFlowConfigurationHolder(), new ProjectSettings());
- container.Should().NotBeNull();
- }
- [Test]
- public void Should_register_generator_configuration_with_default_config()
- {
- var container = GeneratorContainerBuilder.CreateContainer(new SpecFlowConfigurationHolder(), new ProjectSettings());
- container.Resolve<GeneratorConfiguration>().Should().NotBeNull();
- }
- [Test]
- public void Should_register_generator_with_custom_settings_when_configured()
- {
- var container = GeneratorContainerBuilder.CreateContainer(new SpecFlowConfigurationHolder(@"
- <specFlow>
- <generator allowDebugGeneratedFiles=""true"" /><!-- default is false -->
- </specFlow>"), new ProjectSettings());
- container.Resolve<GeneratorConfiguration>().AllowDebugGeneratedFiles.Should().Be(true);
- }
- }
- }