Skip to content

Commit

Permalink
177261 Fixed UTs post refactoring error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooja More committed Oct 3, 2024
1 parent c0bb701 commit 0cc0c73
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void WhenBuildSapMessageXmlIsCalledWithNewCellWithNoUnitOfSaleHavingTypeI
A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A<string>.Ignored)).Returns(soapXml);

Assert.Throws<ERPFacadeException>(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!))
.Message.Should().Be("Required unit not found in event payload to generate {ActionName} action for {Product}.");
.Message.Should().Be("Required unit not found in event payload to generate CREATE ENC CELL action for US5AK9DI.");
}

[Test]
Expand All @@ -317,7 +317,7 @@ public void WhenBuildSapMessageXmlIsCalledWithReplaceCellWithNoUnitOfSaleHavingT
A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A<string>.Ignored)).Returns(soapXml);

Assert.Throws<ERPFacadeException>(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!))
.Message.Should().Be("Required unit not found in event payload to generate {ActionName} action for {Product}.");
.Message.Should().Be("Required unit not found in event payload to generate REPLACED WITH ENC CELL action for GB50382B.");
}

[Test]
Expand All @@ -333,7 +333,7 @@ public void WhenBuildSapMessageXmlIfRequiredAttributesNotProvided_ThenThrowERPFa
A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A<string>.Ignored)).Returns(soapXml);

Assert.Throws<ERPFacadeException>(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!))
.Message.Should().Be("Error while generating SAP action information. | Action : {ActionName} | XML Attribute : {attribute.XmlNodeName} | ErrorMessage : {Exception}");
.Message.Should().Be("Error while generating SAP action information. | Action : CREATE ENC CELL | XML Attribute : PROVIDER | ErrorMessage : Object reference not set to an instance of an object.");
}

[Test]
Expand All @@ -351,7 +351,7 @@ public void WhenBuildSapMessageXmlIfUkhoWeekNumberSectionNotProvided_ThenThrowER
A.CallTo(() => _fakePermitDecryption.Decrypt(A<string>.Ignored)).Returns(permitKeys);

Assert.Throws<ERPFacadeException>(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!))
.Message.Should().Be("UkhoWeekNumber section not found in enccontentpublished event payload while creating {Action} action.");
.Message.Should().Be("UkhoWeekNumber section not found in enccontentpublished event payload while creating CREATE ENC CELL action.");
}

[Test]
Expand All @@ -370,7 +370,7 @@ public void WhenBuildSapMessageXmlWithWrongUkhoWeekNumberDetails_ThenThrowERPFac
A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A<int>.Ignored, A<int>.Ignored, A<bool>.Ignored)).Throws<System.Exception>();

Assert.Throws<ERPFacadeException>(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!))
.Message.Should().Be("Error while generating SAP action information. | Action : {ActionName} | XML Attribute : {attribute.XmlNodeName} | ErrorMessage : {Exception}");
.Message.Should().Be("Error while generating SAP action information. | Action : CREATE ENC CELL | XML Attribute : VALIDFROM | ErrorMessage : Exception of type 'System.Exception' was thrown.");
}

[Test]
Expand All @@ -388,7 +388,7 @@ public void WhenBuildSapMessageXmlWithEmptyPermit_ThenThrowERPFacadeException()
A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A<int>.Ignored, A<int>.Ignored, A<bool>.Ignored)).Throws<System.Exception>();

Assert.Throws<ERPFacadeException>(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!))
.Message.Should().Be("Required details are missing in enccontentpublished event payload. | Property Name : {Property}");
.Message.Should().Be("Required details are missing in enccontentpublished event payload. | Property Name : permit");
}

[Test]
Expand Down

0 comments on commit 0cc0c73

Please sign in to comment.