Skip to content

Commit

Permalink
Merge pull request #82 from digipost/b_Identification_v2
Browse files Browse the repository at this point in the history
Bug: fixes the IdentificationValue as string causing nullpointer
Aleksander-OK
  • Loading branch information
kristianenge committed Oct 22, 2015
2 parents 8b4a943 + d6edc71 commit 57ab8e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static IIdentificationResult FromDataTransferObject(IdentificationResultD
}
else
{
identificationResult = new IdentificationResult(identificationResultDto.IdentificationResultType, identificationResultDto.IdentificationValue as string);
identificationResult = new IdentificationResult(identificationResultDto.IdentificationResultType, identificationResultDto.IdentificationValue.ToString());
}

return identificationResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,15 @@ public void IdentificationByPinReturnsUnidentifiedResultWithUnidentifiedReason()
public void IdentificationByPinReturnsInvalidResultWithInvalidReason()
{
//Arrange
const string invalidValue = "InvalidPersonalIdentificationNumber";
object invalidValue = InvalidReason.InvalidPersonalIdentificationNumber;
IdentificationResultDataTransferObject source = new IdentificationResultDataTransferObject
{
IdentificationResultCode = IdentificationResultCode.Invalid,
IdentificationValue = invalidValue,
IdentificationResultType = IdentificationResultType.InvalidReason
};

IdentificationResult expected = new IdentificationResult(IdentificationResultType.InvalidReason, invalidValue);
IdentificationResult expected = new IdentificationResult(IdentificationResultType.InvalidReason, invalidValue.ToString());

//Act
var actual = DataTransferObjectConverter.FromDataTransferObject(source);
Expand Down Expand Up @@ -562,15 +562,15 @@ public void IdentificationByAddressReturnsIdentifiedResultWithPersonalAliasResul
public void IdentificationByAddressReturnsUnidentifiedResultWithUnidentifiedReason()
{
//Arrange
var reason = "NotFound";
var reason = UnidentifiedReason.NotFound;
IdentificationResultDataTransferObject source = new IdentificationResultDataTransferObject
{
IdentificationResultCode = IdentificationResultCode.Unidentified,
IdentificationValue = reason,
IdentificationResultType = IdentificationResultType.UnidentifiedReason
};

IdentificationResult expected = new IdentificationResult(IdentificationResultType.UnidentifiedReason, reason);
IdentificationResult expected = new IdentificationResult(IdentificationResultType.UnidentifiedReason, reason.ToString());

//Act
var actual = DataTransferObjectConverter.FromDataTransferObject(source);
Expand Down Expand Up @@ -625,15 +625,15 @@ public void IdentificationByOrganizationNumberReturnsIdentifiedResultWithPersonA
public void IdentificationByOrganizationNumberReturnsUnidentifiedResultWithUnidentifiedReason()
{
//Arrange
var reason = "NotFound";
var reason = UnidentifiedReason.NotFound;
IdentificationResultDataTransferObject source = new IdentificationResultDataTransferObject
{
IdentificationResultCode = IdentificationResultCode.Unidentified,
IdentificationValue = reason,
IdentificationResultType = IdentificationResultType.UnidentifiedReason
};

IdentificationResult expected = new IdentificationResult(IdentificationResultType.UnidentifiedReason, reason);
IdentificationResult expected = new IdentificationResult(IdentificationResultType.UnidentifiedReason, reason.ToString());

//Act
var actual = DataTransferObjectConverter.FromDataTransferObject(source);
Expand All @@ -648,15 +648,15 @@ public void IdentificationByOrganizationNumberReturnsUnidentifiedResultWithUnide
public void IdentificationByOrganizationNumberReturnsInvalidResultWithInvalidReason()
{
//Arrange
const string invalidValue = "InvalidOrganisationNumber";
object invalidValue = InvalidReason.InvalidOrganisationNumber;
IdentificationResultDataTransferObject source = new IdentificationResultDataTransferObject
{
IdentificationResultCode = IdentificationResultCode.Invalid,
IdentificationValue = invalidValue,
IdentificationResultType = IdentificationResultType.InvalidReason
};

IdentificationResult expected = new IdentificationResult(IdentificationResultType.InvalidReason, invalidValue);
IdentificationResult expected = new IdentificationResult(IdentificationResultType.InvalidReason, invalidValue.ToString());

//Act
var actual = DataTransferObjectConverter.FromDataTransferObject(source);
Expand Down

0 comments on commit 57ab8e0

Please sign in to comment.