Beispiel #1
0
 private static Models.ApprenticeshipProvider.Provider MapFrom(ProviderResponseItem provider)
 {
     return(new Models.ApprenticeshipProvider.Provider()
     {
         Ukprn = provider.Ukprn,
         Name = provider.Name,
         Email = provider.Email,
         Phone = provider.Phone
     });
 }
 private static ProvidersView MapFrom(ProviderResponseItem provider)
 {
     return(new ProvidersView
     {
         CreatedDate = DateTime.UtcNow,
         Provider = new Models.ApprenticeshipProvider.Provider()
         {
             Ukprn = provider.Ukprn,
             Name = provider.Name,
             Email = provider.Email,
             Phone = provider.Phone,
             NationalProvider = false // Obsolete - no longer valid at this level
         }
     });
 }
        public void Arrange()
        {
            _provider = new ProviderResponseItem
            {
                Email = "*****@*****.**"
            };
            _mockProviderService = new Mock <IProviderService>();
            _mockApiClient       = new Mock <IApiClient>();
            _mockLog             = new Mock <ILog>();

            _providerName = Guid.NewGuid().ToString();

            _mockApiClient
            .Setup(m => m.Get <ProviderResponseItem>(It.IsAny <GetProviderRequest>()))
            .ReturnsAsync(_provider);

            _mockLog
            .Setup(m => m.Warn(It.IsAny <Exception>(), It.IsAny <string>()))
            .Verifiable();

            _sut = new EmployerFinance.Services.ProviderServiceRemote(_mockProviderService.Object, _mockApiClient.Object, _mockLog.Object);
        }