-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
96 additions
and
15 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
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using VirtoCommerce.Skyflow.Core.Models; | ||
using Xunit; | ||
|
||
namespace VirtoCommerce.Skyflow.Tests; | ||
|
||
[Trait("Category", "Unit")] | ||
public class SkyflowCardTest | ||
{ | ||
[Theory] | ||
[InlineData("10", "20", false)] | ||
[InlineData("01", "38", true)] | ||
[InlineData("02", "98", true)] | ||
public void MonthYearTest(string month, string year, bool isActive) | ||
{ | ||
var card = new SkyflowCard { ExpiryMonth = month, ExpiryYear = year, }; | ||
|
||
Assert.Equal(isActive, card.Active); | ||
} | ||
|
||
[Theory] | ||
[InlineData("10/20", false)] | ||
[InlineData("01/2038", true)] | ||
[InlineData("02/98", true)] | ||
public void ExpireDateTest(string expireDate, bool isActive) | ||
{ | ||
var card = new SkyflowCard { CardExpiration = expireDate }; | ||
|
||
Assert.Equal(isActive, card.Active); | ||
} | ||
|
||
[Fact] | ||
public void CurrentMonthTests() | ||
{ | ||
var month = DateTime.UtcNow.Month.ToString("00"); | ||
var year = DateTime.UtcNow.Year.ToString("00"); | ||
var card = new SkyflowCard { ExpiryMonth = month, ExpiryYear = year, }; | ||
|
||
Assert.True(card.Active); | ||
} | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.