Skip to content

Commit

Permalink
Resloved few review comments AB#143937
Browse files Browse the repository at this point in the history
  • Loading branch information
MitaliSingh16 committed Feb 29, 2024
1 parent 6e50ae8 commit 916b8b9
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/SAPXmlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -614,39 +614,21 @@ private static bool VerifyCreateENCCell(string childCell, ZMAT_ACTIONITEMS item,
private static bool VerifyDecryptedPermit(string childCell, ZMAT_ACTIONITEMS item, string permitState)
{
Console.WriteLine("Action#:" + ActionCounter + ".Childcell:" + childCell);
foreach (Product product in JsonPayload.Data.Products)
{
AttrNotMatched.Clear();
if (permitState.Contains("Same"))
{

if (!item.ACTIVEKEY.Equals(Config.TestConfig.PermitWithSameKey.ACTIVEKEY))
AttrNotMatched.Add(nameof(item.ACTIVEKEY));
if (!item.NEXTKEY.Equals(Config.TestConfig.PermitWithSameKey.NEXTKEY))
AttrNotMatched.Add(nameof(item.NEXTKEY));
}
else if (permitState.Contains("Different"))
{
if (!item.ACTIVEKEY.Equals(Config.TestConfig.PermitWithDifferentKey.ACTIVEKEY))
AttrNotMatched.Add(nameof(item.ACTIVEKEY));
if (!item.NEXTKEY.Equals(Config.TestConfig.PermitWithDifferentKey.NEXTKEY))
AttrNotMatched.Add(nameof(item.NEXTKEY));
}

if (AttrNotMatched.Count == 0)
{
Console.WriteLine("CREATE ENC CELL Action's ACTIVEKEY and NEXTKEY Data is correct");
return true;
}
else
{
Console.WriteLine("CREATE ENC CELL Action's ACTIVEKEY and NEXTKEY Data is incorrect");
Console.WriteLine("Not matching attributes are:");
foreach (string attribute in AttrNotMatched)
{ Console.WriteLine(attribute); }
return false;
}
if (permitState.Contains("Same"))
{

if (!item.ACTIVEKEY.Equals(Config.TestConfig.PermitWithSameKey.ACTIVEKEY))
AttrNotMatched.Add(nameof(item.ACTIVEKEY));
if (!item.NEXTKEY.Equals(Config.TestConfig.PermitWithSameKey.NEXTKEY))
AttrNotMatched.Add(nameof(item.NEXTKEY));
}
else if (permitState.Contains("Different"))
{
if (!item.ACTIVEKEY.Equals(Config.TestConfig.PermitWithDifferentKey.ACTIVEKEY))
AttrNotMatched.Add(nameof(item.ACTIVEKEY));
if (!item.NEXTKEY.Equals(Config.TestConfig.PermitWithDifferentKey.NEXTKEY))
AttrNotMatched.Add(nameof(item.NEXTKEY));
}
return true;
}
Expand Down Expand Up @@ -1231,6 +1213,7 @@ public static string UpdatePermitField(string requestBody, string permitState)
var products = jsonObj["data"]["products"];
foreach (var product in products)
{
Assert.That(Config.TestConfig.PermitWithSameKey.Permit != "","Permit String is empty");
product["permit"] = Config.TestConfig.PermitWithSameKey.Permit;
}
}
Expand All @@ -1239,6 +1222,7 @@ public static string UpdatePermitField(string requestBody, string permitState)
var products = jsonObj["data"]["products"];
foreach (var product in products)
{
Assert.That(Config.TestConfig.PermitWithDifferentKey.Permit!= "", "Permit String is empty");
product["permit"] = Config.TestConfig.PermitWithDifferentKey.Permit;
}
}
Expand Down

0 comments on commit 916b8b9

Please sign in to comment.