public When_ProviderService_Is_Called_To_Create_Provider()
        {
            var httpContextAccessor = Substitute.For <IHttpContextAccessor>();

            var config = new MapperConfiguration(c =>
            {
                c.AddMaps(typeof(ProviderMapper).Assembly);
                c.ConstructServicesUsing(type =>
                                         type.Name.Contains("LoggedInUserEmailResolver") ?
                                         new LoggedInUserEmailResolver <CreateProviderDetailViewModel, Domain.Models.Provider>(httpContextAccessor) :
                                         type.Name.Contains("LoggedInUserNameResolver") ?
                                         (object)new LoggedInUserNameResolver <CreateProviderDetailViewModel, Domain.Models.Provider>(httpContextAccessor) :
                                         type.Name.Contains("UtcNowResolver") ?
                                         new UtcNowResolver <CreateProviderDetailViewModel, Domain.Models.Provider>(new DateTimeProvider()) :
                                         null);
            });
            var mapper = new Mapper(config);

            _repository = Substitute.For <IRepository <Domain.Models.Provider> >();
            var referenceRepository = Substitute.For <IRepository <ProviderReference> >();

            _repository.CreateAsync(Arg.Any <Domain.Models.Provider>())
            .Returns(ProviderId);

            var providerService = new ProviderService(mapper, _repository, referenceRepository);

            var viewModel = new CreateProviderDetailViewModel
            {
                UkPrn       = 123,
                Name        = "ProviderName",
                DisplayName = "Display name"
            };

            _result = providerService.CreateProviderAsync(viewModel).GetAwaiter().GetResult();
        }