-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typos and other problems reported by static analysis
- Loading branch information
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ public async Task Execute_ShouldUpdateOrganisation_WhenOrganisationExists() | |
AdditionalIdentifiers = [new OrganisationIdentifier | ||
{ | ||
Id = "FakeId", | ||
LegalName = "Illigal", | ||
LegalName = "Illegal", | ||
Scheme = "FakeScheme" | ||
}] | ||
} | ||
|
@@ -41,7 +41,7 @@ public async Task Execute_ShouldUpdateOrganisation_WhenOrganisationExists() | |
var result = await UseCase.Execute((_organisationId, updateOrganisation)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
} | ||
|
||
[Fact] | ||
|
@@ -66,7 +66,7 @@ public async Task Execute_ItAssignsVatIdentifierAsPrimaryWhenOtherIdentifierExis | |
var result = await UseCase.Execute((_organisationId, updateOrganisation)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Identifiers.First(i => i.Scheme == "Other").Primary.Should().BeFalse(); | ||
organisation.Identifiers.First(i => i.Scheme == "VAT").Primary.Should().BeTrue(); | ||
|
@@ -94,7 +94,7 @@ public async Task Execute_ItAssignsVatIdentifierAsPrimaryWhenPponIdentifierExist | |
var result = await UseCase.Execute((_organisationId, updateOrganisation)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Identifiers.First(i => i.Scheme == "GB-PPON").Primary.Should().BeFalse(); | ||
organisation.Identifiers.First(i => i.Scheme == "VAT").Primary.Should().BeTrue(); | ||
|
@@ -225,7 +225,7 @@ public async Task Execute_ShouldUpdateVatNumber_WhenVatIdentifierAlreadyExists() | |
var result = await UseCase.Execute((_organisationId, command)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Identifiers.Should().Contain(i => i.Scheme == "VAT" && i.IdentifierId == "999999"); | ||
organisation.Identifiers.Should().ContainSingle(); | ||
|
@@ -279,12 +279,10 @@ public async Task Execute_ShouldAssignPponAsPrimary_WhenVatIdentifierIsRemoved() | |
var result = await UseCase.Execute((_organisationId, command)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Identifiers.FirstOrDefault(i => | ||
i.Scheme == "GB-PPON" && | ||
i.IdentifierId == "c0777aeb968b4113a27d94e55b10c1b4" && | ||
i.Primary) | ||
i is { Scheme: "GB-PPON", IdentifierId: "c0777aeb968b4113a27d94e55b10c1b4", Primary: true }) | ||
.Should().NotBeNull(); | ||
organisation.Identifiers.Should().ContainSingle(); | ||
} | ||
|
@@ -317,7 +315,7 @@ public async Task Execute_ShouldNotInsertIdentifier_WhenIdentifierIdIsEmptyOrNul | |
var result = await UseCase.Execute((_organisationId, command)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Identifiers.FirstOrDefault(i => i.Scheme == "VAT").Should().BeNull(); | ||
} | ||
|
@@ -356,7 +354,7 @@ public async Task Execute_ShouldUpdateOrganisationName_WhenOrganisationAlreadyEx | |
var result = await UseCase.Execute((_organisationId, command)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Name.Should().Be("Updated Organisation Name"); | ||
} | ||
|
@@ -423,13 +421,13 @@ public async Task Execute_ShouldUpdateOrganisationEmail_WhenOrganisationContactP | |
var result = await UseCase.Execute((_organisationId, command)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.ContactPoints.FirstOrDefault()!.Email.Should().Be("[email protected]"); | ||
} | ||
|
||
[Fact] | ||
public async Task Execute_ShouldThrowInvalidUpdateOrganisationCommand_WhenOrganisationRegsiteredAddressIsNull() | ||
public async Task Execute_ShouldThrowInvalidUpdateOrganisationCommand_WhenOrganisationRegisteredAddressIsNull() | ||
{ | ||
var updateOrganisation = new UpdateOrganisation | ||
{ | ||
|
@@ -446,7 +444,7 @@ await act.Should() | |
} | ||
|
||
[Fact] | ||
public async Task Execute_ShouldThrowInvalidUpdateOrganisationCommand_WhenOrganisationRegsiteredAddressIsMissing() | ||
public async Task Execute_ShouldThrowInvalidUpdateOrganisationCommand_WhenOrganisationRegisteredAddressIsMissing() | ||
{ | ||
var updateOrganisation = new UpdateOrganisation | ||
{ | ||
|
@@ -456,11 +454,11 @@ public async Task Execute_ShouldThrowInvalidUpdateOrganisationCommand_WhenOrgani | |
Addresses = [ | ||
new OrganisationAddress | ||
{ | ||
Type=OrganisationInformation.AddressType.Postal, | ||
Type=OrganisationInformation.AddressType.Postal, | ||
StreetAddress = "1234 Test St", | ||
Locality = "Test City", | ||
PostalCode = "12345", | ||
CountryName = "Testland", | ||
CountryName = "Test Land", | ||
Country = "AB", | ||
Region="Test Region" | ||
} | ||
|
@@ -474,7 +472,7 @@ public async Task Execute_ShouldThrowInvalidUpdateOrganisationCommand_WhenOrgani | |
|
||
await act.Should() | ||
.ThrowAsync<InvalidUpdateOrganisationCommand>() | ||
.WithMessage("Missing Organisation regsitered address."); | ||
.WithMessage("Missing Organisation registered address."); | ||
} | ||
|
||
[Fact] | ||
|
@@ -492,7 +490,7 @@ public async Task Execute_ShouldUpdateOrganisationRegisteredAddress_WhenOrganisa | |
StreetAddress = "1234 Test St", | ||
Locality = "Test City", | ||
PostalCode = "12345", | ||
CountryName = "Testland updated", | ||
CountryName = "Test Land updated", | ||
Country = "AB", | ||
Region="Test Region" | ||
} | ||
|
@@ -505,9 +503,9 @@ public async Task Execute_ShouldUpdateOrganisationRegisteredAddress_WhenOrganisa | |
var result = await UseCase.Execute((_organisationId, command)); | ||
|
||
result.Should().BeTrue(); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation!), Times.Once); | ||
_organisationRepositoryMock.Verify(repo => repo.Save(organisation), Times.Once); | ||
|
||
organisation.Addresses.FirstOrDefault(x=>x.Type==OrganisationInformation.AddressType.Registered)!.Address!.CountryName.Should().Be("Testland updated"); | ||
organisation.Addresses.FirstOrDefault(x=>x.Type==OrganisationInformation.AddressType.Registered)!.Address.CountryName.Should().Be("Test Land updated"); | ||
} | ||
|
||
|
||
|
@@ -570,7 +568,7 @@ public async Task Execute_ShouldUpdateOrganisationRegisteredAddress_WhenOrganisa | |
StreetAddress = "1234 Test St", | ||
Locality = "Test City", | ||
PostalCode = "12345", | ||
CountryName = "Testland", | ||
CountryName = "Test Land", | ||
Country = "AB" | ||
} | ||
}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters