-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
322 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,15 +28,15 @@ public async Task TestRealCharge() | |
}); | ||
WriteLine($"created token: ${token.Id}"); | ||
|
||
var charge = await client.Charges.Create(new CreateChargeRequest | ||
var charge = await client.Charges.Create(new CreateChargeParams | ||
{ | ||
Amount = 2000, | ||
Currency = "usd", | ||
Card = token.Id, | ||
}); | ||
WriteLine($"created charge: ${charge.Id}"); | ||
|
||
charge = await client.Charges.Update(charge.Id, new UpdateChargeRequest | ||
charge = await client.Charges.Update(charge.Id, new UpdateChargeParams | ||
{ | ||
Description = "TestRealCharge", | ||
Metadata = new Dictionary<string, object> { | ||
|
@@ -63,7 +63,7 @@ public async Task TestGettingUsedToken() | |
token = await client.Tokens.Get(token.Id); | ||
WriteLine($"retrieved token: {token.Id}"); | ||
|
||
var customer = await client.Customers.Create(new CreateCustomerRequest | ||
var customer = await client.Customers.Create(new CreateCustomerParams | ||
{ | ||
Email = "[email protected]", | ||
Card = token.Id, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System.Threading.Tasks; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using Omise.Models; | ||
using Omise.Resources; | ||
|
@@ -57,9 +58,12 @@ public void TestCreateCustomerRequest() | |
{ | ||
AssertSerializedRequest( | ||
BuildCreateRequest(), | ||
@"{""email"":""[email protected]""," + | ||
@"""description"":""Omise support""," + | ||
@"""card"":""card_test_123""}" | ||
new Dictionary<string, object> | ||
{ | ||
{ "card", "card_test_123" }, | ||
{ "description", "Omise support" }, | ||
{ "email", "[email protected]" }, | ||
} | ||
); | ||
} | ||
|
||
|
@@ -68,10 +72,13 @@ public void TestUpdateCustomerRequest() | |
{ | ||
AssertSerializedRequest( | ||
BuildUpdateRequest(), | ||
@"{""default_card"":""card_test_456""," + | ||
@"""email"":""[email protected]""," + | ||
@"""description"":""Omise example""," + | ||
@"""card"":""card_test_456""}" | ||
new Dictionary<string, object> | ||
{ | ||
{ "card", "card_test_456" }, | ||
{ "default_card", "card_test_456" }, | ||
{ "description", "Omise example" }, | ||
{ "email", "[email protected]" }, | ||
} | ||
); | ||
} | ||
|
||
|
@@ -97,15 +104,15 @@ public async Task TestFixturesGet() | |
[Test] | ||
public async Task TestFixturesCreate() | ||
{ | ||
var customer = await Fixtures.Create(new CreateCustomerRequest()); | ||
var customer = await Fixtures.Create(new CreateCustomerParams()); | ||
Assert.AreEqual(CustomerId, customer.Id); | ||
Assert.AreEqual("John Doe (id: 30)", customer.Description); | ||
} | ||
|
||
[Test] | ||
public async Task TestFixturesUpdate() | ||
{ | ||
var customer = await Fixtures.Update(CustomerId, new UpdateCustomerRequest()); | ||
var customer = await Fixtures.Update(CustomerId, new UpdateCustomerParams()); | ||
Assert.AreEqual(CustomerId, customer.Id); | ||
Assert.AreEqual("John Doe (id: 30)", customer.Description); | ||
} | ||
|
@@ -118,19 +125,19 @@ public async Task TestFixturesDestroy() | |
Assert.IsTrue(customer.Deleted); | ||
} | ||
|
||
protected CreateCustomerRequest BuildCreateRequest() | ||
protected CreateCustomerParams BuildCreateRequest() | ||
{ | ||
return new CreateCustomerRequest | ||
return new CreateCustomerParams | ||
{ | ||
Email = "[email protected]", | ||
Description = "Omise support", | ||
Card = "card_test_123" | ||
}; | ||
} | ||
|
||
protected UpdateCustomerRequest BuildUpdateRequest() | ||
protected UpdateCustomerParams BuildUpdateRequest() | ||
{ | ||
return new UpdateCustomerRequest | ||
return new UpdateCustomerParams | ||
{ | ||
Email = "[email protected]", | ||
Description = "Omise example", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.