-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathBuilderAssertions_Should.cs
49 lines (40 loc) · 1.3 KB
/
BuilderAssertions_Should.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Autofac;
using Xunit;
namespace FluentAssertions.Autofac;
// ReSharper disable InconsistentNaming
public class BuilderAssertions_Should
{
[Fact]
public void Support_testing_assembly_modules_registrations()
{
var builder = new ContainerBuilder();
var assembly = typeof(BuilderAssertions_Should)
.Assembly;
builder.RegisterAssemblyModules(assembly);
builder.Should().RegisterAssemblyModules(assembly);
builder.Should().RegisterModule<SampleModule>();
builder.Should().RegisterModule<SampleModule2>();
}
[Fact]
public void Support_testing_module_registration()
{
var builder = new ContainerBuilder();
builder.RegisterModule<SampleModule>();
var builderShould = builder.Should();
builderShould.RegisterModule<SampleModule>();
builderShould.RegisterModule(typeof(SampleModule));
builderShould.RegisterModule<SampleModule2>();
}
// ReSharper disable once MemberCanBePrivate.Global
public class SampleModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterModule<SampleModule2>();
}
}
// ReSharper disable once MemberCanBePrivate.Global
public class SampleModule2 : Module
{
}
}