public ContractStatusChangePublisherTests()
        {
            _dummyContract = new Models.Contract {
                Id = 1, ContractNumber = "Test", ContractVersion = 1, Ukprn = 123456
            };
            _mockServiceBusMessagingService = Mock.Of <IServiceBusMessagingService>(MockBehavior.Strict);
            _mockAuditService = Mock.Of <IAuditService>(MockBehavior.Strict);
            _mockLogger       = Mock.Of <ILogger <Interfaces.IContractStatusChangePublisher> >(MockBehavior.Strict);

            SetupNotifyAsyncPrivateMethodCalls();
            Mock.Get(_mockLogger)
            .Setup(l => l.Log(LogLevel.Information, 0, It.IsAny <It.IsAnyType>(), null, It.IsAny <Func <It.IsAnyType, Exception, string> >()));
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContractNotificationService"/> class.
 /// </summary>
 /// <param name="authenticationService">The authentication service.</param>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="configurationOptions">The configuration options.</param>
 /// <param name="serviceBusMessagingService">The messaging service to use for queuing reminders.</param>
 /// <param name="logger">ILogger reference to log output.</param>
 /// <param name="auditService">The audit service.</param>
 public ContractNotificationService(
     IAuthenticationService <ContractsDataApiConfiguration> authenticationService,
     HttpClient httpClient,
     IOptions <ContractsDataApiConfiguration> configurationOptions,
     IServiceBusMessagingService serviceBusMessagingService,
     ILoggerAdapter <ContractNotificationService> logger,
     IAuditService auditService)
     : base(authenticationService, httpClient, Options.Create(configurationOptions.Value))
 {
     _logger               = logger;
     _sbMessagingService   = serviceBusMessagingService;
     _auditService         = auditService;
     _dataApiConfiguration = configurationOptions.Value;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContractStatusChangePublisher"/> class.
 /// </summary>
 /// <param name="serviceBusMessagingService">The messaging service to use for queuing status change messages.</param>
 /// <param name="auditService">The shared audit service.</param>
 /// <param name="logger">The logger.</param>
 public ContractStatusChangePublisher(IServiceBusMessagingService serviceBusMessagingService, IAuditService auditService, ILogger <IContractStatusChangePublisher> logger)
 {
     _serviceBusMessagingService = serviceBusMessagingService;
     _auditService = auditService;
     _logger       = logger;
 }