Skip to content

Commit

Permalink
fix generator test error
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy committed Jan 17, 2024
1 parent e9fc648 commit 3409091
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
14 changes: 10 additions & 4 deletions Tests/Reqnroll.GeneratorTests/GeneratorContainerBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ public void Should_register_generator_configuration_with_default_config()
[Fact]
public void Should_register_generator_with_custom_settings_when_configured()
{
var container = new GeneratorContainerBuilder().CreateContainer(new ReqnrollConfigurationHolder(ConfigSource.AppConfig, @"
<reqnroll>
<generator allowDebugGeneratedFiles=""true"" /><!-- default is false -->
</reqnroll>"), new ProjectSettings(), Enumerable.Empty<GeneratorPluginInfo>());
var container = new GeneratorContainerBuilder().CreateContainer(
new ReqnrollConfigurationHolder(
ConfigSource.Json,
"""
{
"generator": {
"allowDebugGeneratedFiles": true
}
}
"""), new ProjectSettings(), Enumerable.Empty<GeneratorPluginInfo>());
container.Resolve<ReqnrollConfiguration>().AllowDebugGeneratedFiles.Should().Be(true);
}
}
Expand Down
20 changes: 0 additions & 20 deletions Tests/Reqnroll.GeneratorTests/TestGeneratorFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,5 @@ public void Dispose()
//nop;
}
}

[Fact]
public void Should_create_custom_generator_when_configured_so()
{
var configurationHolder = new ReqnrollConfigurationHolder(ConfigSource.AppConfig, string.Format(@"
<reqnroll>
<generator>
<dependencies>
<register type=""{0}"" as=""{1}""/>
</dependencies>
</generator>
</reqnroll>",
typeof(DummyGenerator).AssemblyQualifiedName,
typeof(ITestGenerator).AssemblyQualifiedName));

var projectSettings = net35CSProjectSettings;
projectSettings.ConfigurationHolder = configurationHolder;
var generator = _factory.CreateGenerator(projectSettings, Enumerable.Empty<GeneratorPluginInfo>());
generator.Should().BeOfType<DummyGenerator>();
}
}
}

0 comments on commit 3409091

Please sign in to comment.