Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jillingk committed Mar 28, 2024
1 parent 76c1c94 commit 4b31c77
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Adyen.Test/SaleToAcquirerDataTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Adyen.Test
[TestClass]
public class SaleToAcquirerDataTest
{
private readonly string _json = "{\"metadata\":{\"key\":\"value\"},\"shopperEmail\":\"myemail@mail.com\",\"shopperReference\":\"13164308\",\"recurringProcessingModel\":\"Subscription\",\"recurringContract\":\"RECURRING,ONECLICK\",\"shopperStatement\":\"YOUR SHOPPER STATEMENT\",\"recurringDetailName\":\"VALUE\",\"recurringTokenService\":\"VALUE\",\"store\":\"store value\",\"merchantAccount\":\"merchantAccount\",\"currency\":\"EUR\",\"applicationInfo\":{\"adyenLibrary\":{\"name\":\"adyen-dotnet-api-library\",\"version\":\""+ClientConfig.LibVersion+ "\"},\"externalPlatform\":{\"integrator\":\"externalPlatformIntegrator\",\"name\":\"externalPlatformName\",\"version\":\"2.0.0\"},\"merchantDevice\":{\"os\":\"merchantDeviceOS\",\"osVersion\":\"10.12.6\",\"reference\":\"4c32759faaa7\"}},\"tenderOption\":\"ReceiptHandler,AllowPartialAuthorisation,AskGratuity\",\"authorisationType\":\"PreAuth\",\"additionalData\":{\"key.key\":\"value\",\"key.keyTwo\":\"value2\"}}";
private readonly string _base64 = "eyJtZXRhZGF0YSI6eyJrZXkiOiJ2YWx1ZSJ9LCJzaG9wcGVyRW1haWwiOiJteWVtYWlsQG1haWwuY29tIiwic2hvcHBlclJlZmVyZW5jZSI6IjEzMTY0MzA4IiwicmVjdXJyaW5nUHJvY2Vzc2luZ01vZGVsIjoiU3Vic2NyaXB0aW9uIiwicmVjdXJyaW5nQ29udHJhY3QiOiJSRUNVUlJJTkcsT05FQ0xJQ0siLCJzaG9wcGVyU3RhdGVtZW50IjoiWU9VUiBTSE9QUEVSIFNUQVRFTUVOVCIsInJlY3VycmluZ0RldGFpbE5hbWUiOiJWQUxVRSIsInJlY3VycmluZ1Rva2VuU2VydmljZSI6IlZBTFVFIiwic3RvcmUiOiJzdG9yZSB2YWx1ZSIsInNjYyI6bnVsbCwibWVyY2hhbnRBY2NvdW50IjoibWVyY2hhbnRBY2NvdW50IiwiY3VycmVuY3kiOiJFVVIiLCJhcHBsaWNhdGlvbkluZm8iOnsiYWR5ZW5MaWJyYXJ5Ijp7Im5hbWUiOiJhZHllbi1kb3RuZXQtYXBpLWxpYnJhcnkiLCJ2ZXJzaW9uIjoiMTQuMi4xIn0sImV4dGVybmFsUGxhdGZvcm0iOnsiaW50ZWdyYXRvciI6ImV4dGVybmFsUGxhdGZvcm1JbnRlZ3JhdG9yIiwibmFtZSI6ImV4dGVybmFsUGxhdGZvcm1OYW1lIiwidmVyc2lvbiI6IjIuMC4wIn0sIm1lcmNoYW50RGV2aWNlIjp7Im9zIjoibWVyY2hhbnREZXZpY2VPUyIsIm9zVmVyc2lvbiI6IjEwLjEyLjYiLCJyZWZlcmVuY2UiOiI0YzMyNzU5ZmFhYTcifX0sInRlbmRlck9wdGlvbiI6IlJlY2VpcHRIYW5kbGVyLEFsbG93UGFydGlhbEF1dGhvcmlzYXRpb24sQXNrR3JhdHVpdHkiLCJhdXRob3Jpc2F0aW9uVHlwZSI6IlByZUF1dGgiLCJhZGRpdGlvbmFsRGF0YSI6eyJrZXkua2V5IjoidmFsdWUiLCJrZXkua2V5VHdvIjoidmFsdWUyIn19";

[TestMethod]
public void SerializationTest()
Expand Down Expand Up @@ -49,12 +49,7 @@ public void SerializationTest()
saleToAcquirerData.TenderOption = "ReceiptHandler,AllowPartialAuthorisation,AskGratuity";
var additionalData = new Dictionary<string, string> { { "key.key", "value" }, { "key.keyTwo", "value2" } };
saleToAcquirerData.AdditionalData = additionalData;
Assert.AreEqual(saleToAcquirerData.ToBase64(), JsonToBase64());
}

private string JsonToBase64()
{
return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(_json));
Assert.AreEqual(saleToAcquirerData.ToBase64(), _base64);
}
}
}

0 comments on commit 4b31c77

Please sign in to comment.