-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathAppDomainResolutionTests.cs
More file actions
42 lines (36 loc) · 1.21 KB
/
AppDomainResolutionTests.cs
File metadata and controls
42 lines (36 loc) · 1.21 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
41
42
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
namespace AutoMapper.Extensions.Microsoft.DependencyInjection.Tests
{
using System;
using AutoMapper.Internal;
using Shouldly;
using Xunit;
public class AppDomainResolutionTests
{
private readonly IServiceProvider _provider;
public AppDomainResolutionTests()
{
IServiceCollection services = new ServiceCollection();
services.AddSingleton<ILoggerFactory>(NullLoggerFactory.Instance);
services.AddAutoMapper(_ => { }, typeof(AppDomainResolutionTests));
_provider = services.BuildServiceProvider();
}
[Fact]
public void ShouldResolveConfiguration()
{
_provider.GetService<IConfigurationProvider>().ShouldNotBeNull();
}
[Fact]
public void ShouldConfigureProfiles()
{
_provider.GetService<IConfigurationProvider>().Internal().GetAllTypeMaps().Count.ShouldBe(5);
}
[Fact]
public void ShouldResolveMapper()
{
_provider.GetService<IMapper>().ShouldNotBeNull();
}
}
}