Skip to content

Commit

Permalink
commiting functional Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitinsl committed Jul 10, 2023
1 parent c4c2757 commit 5761eee
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 0 deletions.
32 changes: 32 additions & 0 deletions CnpSdkForNet/CnpSdkForNetTest/Functional/TestCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,37 @@ public void SimpleCaptureWithPassengerTransportData()///12.26
var response = _cnp.Capture(capture);
Assert.AreEqual("Approved", response.message);
}

[Test]
public void SimpleCaptureWithForeignRetailerIndicator()///12.31
{
var capture = new capture
{
id = "1",
cnpTxnId = 123456000,
orderId = "defaultOrderId",
amount = 106,
lodgingInfo = new lodgingInfo
{
bookingID = "BID1234555",
passengerName = "Rohan Sharma",
propertyAddress = new propertyAddress
{
name = "Xpress",
city = "Pune",
region = "WES",
country = countryTypeEnum.IN
},
travelPackageIndicator = travelPackageIndicatorEnum.AirlineReservation,
smokingPreference = "N",
numberOfRooms = 1,
tollFreePhoneNumber = "1234567890"
},
foreignRetailerIndicator= foreignRetailerIndicatorEnum.F

};
var response = _cnp.Capture(capture);
Assert.AreEqual("Approved", response.message);
}
}
}
44 changes: 44 additions & 0 deletions CnpSdkForNet/CnpSdkForNetTest/Functional/TestCaptureGivenAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,5 +496,49 @@ public void SimpleCaptureGivenAuthWithPassengerTransportData()///12.26
var response = _cnp.CaptureGivenAuth(capturegivenauth);
Assert.AreEqual("Approved", response.message);
}

[Test]
public void SimpleCaptureGivenAuthWithForeignRetailerIndicator()///12.31
{
var capturegivenauth = new captureGivenAuth
{
id = "1",
amount = 1176,
orderId = "123777774",
crypto = false,
authInformation = new authInformation
{
authDate = new DateTime(2023, 4, 9),
authCode = "543216",
authAmount = 6532,
},
orderSource = orderSourceType.ecommerce,
card = new cardType
{
type = methodOfPaymentTypeEnum.VI,
number = "4100000000000000",
expDate = "1210",
},
lodgingInfo = new lodgingInfo
{
bookingID = "BID23455",
passengerName = "Pratik Jaiswal",
propertyAddress = new propertyAddress
{
name = "Godrej",
city = "Pune",
region = "WES",
country = countryTypeEnum.IN
},
travelPackageIndicator = travelPackageIndicatorEnum.AirlineReservation,
smokingPreference = "N",
numberOfRooms = 1,
tollFreePhoneNumber = "1234567890"
},
foreignRetailerIndicator = foreignRetailerIndicatorEnum.F
};
var response = _cnp.CaptureGivenAuth(capturegivenauth);
Assert.AreEqual("Approved", response.message);
}
}
}
40 changes: 40 additions & 0 deletions CnpSdkForNet/CnpSdkForNetTest/Functional/TestForceCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,45 @@ public void SimpleForceCaptureWithPassengerTransportData()///12.26
var response = _cnp.ForceCapture(forcecapture);
Assert.AreEqual("Approved", response.message);
}

[Test]
public void SimpleForceCaptureWithForeignRetailerIndicator()///12.31
{
var forcecapture = new forceCapture
{
id = "1",
amount = 177,
orderId = "1234455",
orderSource = orderSourceType.ecommerce,
processingType = processingType.accountFunding,
businessIndicator = businessIndicatorEnum.consumerBillPayment,
card = new cardType
{
type = methodOfPaymentTypeEnum.VI,
number = "4100000000000001",
expDate = "1210"
},
merchantCategoryCode = "2222",
lodgingInfo = new lodgingInfo
{
bookingID = "BID1234556",
passengerName = "Sumit Patil",
propertyAddress = new propertyAddress
{
name = "Xpress",
city = "Pune",
region = "WES",
country = countryTypeEnum.IN
},
travelPackageIndicator = travelPackageIndicatorEnum.AirlineReservation,
smokingPreference = "N",
numberOfRooms = 1,
tollFreePhoneNumber = "1234567777"
},
foreignRetailerIndicator = foreignRetailerIndicatorEnum.F
};
var response = _cnp.ForceCapture(forcecapture);
Assert.AreEqual("Approved", response.message);
}
}
}
37 changes: 37 additions & 0 deletions CnpSdkForNet/CnpSdkForNetTest/Functional/TestSale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -918,5 +918,42 @@ public void SimpleSaleWithSellerInfo() //12.29
var responseObj = _cnp.Sale(saleObj);
StringAssert.AreEqualIgnoringCase("Approved", responseObj.message);
}

[Test]
public void SimpleSaleWithForeignRetailerIndicator()///12.31()
{
var saleObj = new sale
{
id = "1",
amount = 7878,
cnpTxnId = 123456,
orderId = "5355354",
orderSource = orderSourceType.ecommerce,
sofort = new sofortType
{
preferredLanguage = countryTypeEnum.US
},
lodgingInfo = new lodgingInfo
{
bookingID = "BID1234566",
passengerName = "Jitendra Verma",
propertyAddress = new propertyAddress
{
name = "Godrej",
city = "Pune",
region = "WES",
country = countryTypeEnum.IN
},
travelPackageIndicator = travelPackageIndicatorEnum.AirlineReservation,
smokingPreference = "N",
numberOfRooms = 1,
tollFreePhoneNumber = "1234567890"
},
foreignRetailerIndicator = foreignRetailerIndicatorEnum.F
};
saleObj.lodgingInfo.lodgingCharges.Add(new lodgingCharge() { name = lodgingExtraChargeEnum.GIFTSHOP });
var responseObj = _cnp.Sale(saleObj);
StringAssert.AreEqualIgnoringCase("Approved", responseObj.message);
}
}
}

0 comments on commit 5761eee

Please sign in to comment.