public async Task Can_be_called_without_sender_uses_sender_in_client_configuration() { //Arrange var sender = new Sender(BringPublicOrganizationNumber); var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), sender); var fakeHttpClientHandlerChecksCorrectSender = new FakeHttpClientHandlerChecksCorrectSenderResponse(); var portalClient = new PortalClient(clientConfiguration) { HttpClient = GetHttpClientWithHandler(fakeHttpClientHandlerChecksCorrectSender) }; //Act await portalClient.GetStatusChange().ConfigureAwait(false); //Assert Assert.Contains(sender.OrganizationNumber, fakeHttpClientHandlerChecksCorrectSender.RequestUri); }
public async Task Called_with_both_senders_uses_parameter_sender() { //Arrange var parameterSender = new Sender(PostenOrganizationNumber); var clientConfigurationSender = new Sender(BringPublicOrganizationNumber); var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetPostenTestCertificate(), clientConfigurationSender); var fakeHttpClientHandlerChecksCorrectSender = new FakeHttpClientHandlerChecksCorrectSenderResponse(); var portalClient = new PortalClient(clientConfiguration) { HttpClient = GetHttpClientWithHandler(fakeHttpClientHandlerChecksCorrectSender) }; //Act await portalClient.GetStatusChange(parameterSender).ConfigureAwait(false); //Assert Assert.Contains(parameterSender.OrganizationNumber, fakeHttpClientHandlerChecksCorrectSender.RequestUri); }