public async Task ThenTheTempSupportRequestIsUpdated()
        {
            DfeSignInApiClient.GetOrganisations(DfeSignInId).Returns(new List <DfeOrganisation> {
                new DfeOrganisation
                {
                    Id        = SelectedOrganisationId,
                    Address   = "School Road, Village, Town, Staffs, WS12 4YQ",
                    Telephone = "029292929",
                    Name      = "Org1",
                    Urn       = "121212"
                }
            });

            await Handler.Handle(new AddDfESignInOrganisationCommand(TempSupportRequestId, SelectedOrganisationId), CancellationToken.None);

            var updatedTempSupportRequest = await DbContext.TempSupportRequests.SingleAsync(tsr => tsr.Id == TempSupportRequestId);

            updatedTempSupportRequest.BuildingAndStreet1.Should().Be("School Road");
            updatedTempSupportRequest.BuildingAndStreet2.Should().Be("Village");
            updatedTempSupportRequest.TownOrCity.Should().Be("Town");
            updatedTempSupportRequest.County.Should().Be("Staffs");
            updatedTempSupportRequest.Postcode.Should().Be("WS12 4YQ");
            updatedTempSupportRequest.PhoneNumber.Should().Be("029292929");
            updatedTempSupportRequest.OrganisationName.Should().Be("Org1");
            updatedTempSupportRequest.ReferenceId.Should().Be("121212");
            updatedTempSupportRequest.SelectedDfeSignInOrganisationId.Should().Be(SelectedOrganisationId);
        }
Esempio n. 2
0
        public async Task ThenTheTempSupportRequestAddressFieldsAreUpdated()
        {
            DfeSignInApiClient.GetOrganisations(DfeSignInId).Returns(new List <DfeOrganisation> {
                new DfeOrganisation
                {
                    Id        = SelectedOrganisationId,
                    Address   = null,
                    Telephone = "029292929",
                    Name      = "Org1",
                    Urn       = "121212"
                }
            });

            await Handler.Handle(new AddDfESignInOrganisationCommand(TempSupportRequestId, SelectedOrganisationId), CancellationToken.None);

            var updatedTempSupportRequest = await DbContext.TempSupportRequests.SingleAsync(tsr => tsr.Id == TempSupportRequestId);

            updatedTempSupportRequest.BuildingAndStreet1.Should().Be("");
            updatedTempSupportRequest.BuildingAndStreet2.Should().Be("");
            updatedTempSupportRequest.TownOrCity.Should().Be("");
            updatedTempSupportRequest.County.Should().Be("");
            updatedTempSupportRequest.Postcode.Should().Be("");
        }