-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathAutofacAssertionExtensions_Should.cs
More file actions
40 lines (35 loc) · 1.1 KB
/
AutofacAssertionExtensions_Should.cs
File metadata and controls
40 lines (35 loc) · 1.1 KB
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
using System;
using Autofac;
using NSubstitute;
using Xunit;
namespace FluentAssertions.Autofac;
// ReSharper disable InconsistentNaming
public class AutofacAssertionExtensions_Should
{
[Fact]
public void Provide_builder_extension()
{
var builder = new ContainerBuilder();
builder.Should().ShouldBeOfType<BuilderAssertions>();
}
[Fact]
public void Provide_register_extension()
{
var container = new ContainerBuilder().Build();
container.Should().Have().ShouldBeOfType<ContainerRegistrationAssertions>();
}
[Fact]
public void Provide_register_extension_on_lifetime_scope()
{
var scope = new ContainerBuilder().Build().BeginLifetimeScope();
scope.Should().Have().ShouldBeOfType<ContainerRegistrationAssertions>();
}
[Fact]
public void Provide_resolve_extension()
{
var builder = new ContainerBuilder();
builder.RegisterInstance(Substitute.For<IDisposable>());
var container = builder.Build();
container.Should().Resolve<IDisposable>().ShouldBeOfType<ResolveAssertions>();
}
}