PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Tests/GeneratorTests/GeneratorContainerBuilderTests.cs

http://github.com/techtalk/SpecFlow
C# | 38 lines | 35 code | 3 blank | 0 comment | 0 complexity | bb32b7b7d907ae0522c8d3048d701528 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. using System;
  2. using System.Linq;
  3. using FluentAssertions;
  4. using NUnit.Framework;
  5. using TechTalk.SpecFlow.Generator;
  6. using TechTalk.SpecFlow.Generator.Configuration;
  7. using TechTalk.SpecFlow.Generator.Interfaces;
  8. namespace TechTalk.SpecFlow.GeneratorTests
  9. {
  10. [TestFixture]
  11. public class GeneratorContainerBuilderTests
  12. {
  13. [Test]
  14. public void Should_create_a_container()
  15. {
  16. var container = GeneratorContainerBuilder.CreateContainer(new SpecFlowConfigurationHolder(), new ProjectSettings());
  17. container.Should().NotBeNull();
  18. }
  19. [Test]
  20. public void Should_register_generator_configuration_with_default_config()
  21. {
  22. var container = GeneratorContainerBuilder.CreateContainer(new SpecFlowConfigurationHolder(), new ProjectSettings());
  23. container.Resolve<GeneratorConfiguration>().Should().NotBeNull();
  24. }
  25. [Test]
  26. public void Should_register_generator_with_custom_settings_when_configured()
  27. {
  28. var container = GeneratorContainerBuilder.CreateContainer(new SpecFlowConfigurationHolder(@"
  29. <specFlow>
  30. <generator allowDebugGeneratedFiles=""true"" /><!-- default is false -->
  31. </specFlow>"), new ProjectSettings());
  32. container.Resolve<GeneratorConfiguration>().AllowDebugGeneratedFiles.Should().Be(true);
  33. }
  34. }
  35. }