-
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
1 parent
3c9bb99
commit fe2cb8d
Showing
4 changed files
with
94 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
|
||
namespace eXtensionSharp.test; | ||
|
||
public class XIsIfExtensionTest | ||
{ | ||
[Test] | ||
public void xis_if_test() | ||
{ | ||
var expected = false; | ||
var a = "a"; | ||
a.xIf("b", () => Assert.AreEqual(expected, true), () => Assert.AreEqual(expected, false)); | ||
Check warning on line 14 in test/XIsIfExtensionTest.cs GitHub Actions / build
Check warning on line 14 in test/XIsIfExtensionTest.cs GitHub Actions / build
Check warning on line 14 in test/XIsIfExtensionTest.cs GitHub Actions / build
Check warning on line 14 in test/XIsIfExtensionTest.cs GitHub Actions / build
|
||
} | ||
|
||
[Test] | ||
public void xis_if_test2() | ||
{ | ||
var expected = false; | ||
var a = 1; | ||
var result = 0; | ||
a.xIf(2, () => result = 1, () => result = 2); | ||
Assert.AreNotEqual(a, result); | ||
Check warning on line 24 in test/XIsIfExtensionTest.cs GitHub Actions / build
|
||
} | ||
} |
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,23 @@ | ||
using NUnit.Framework; | ||
|
||
namespace eXtensionSharp.test; | ||
|
||
|
||
public class XNumberExtentionsTest | ||
{ | ||
[Test] | ||
public void xto_13_length_phonenumber_test() | ||
{ | ||
var text = "8201011112222"; | ||
var number = text.xToPhoneNumber(); | ||
Assert.That(number, Is.EqualTo("+82-010-1111-2222")); | ||
} | ||
|
||
[Test] | ||
public void xto_13_under_length_phonenumber_test2() | ||
{ | ||
var text = "01011112222"; | ||
var number = text.xToPhoneNumber(); | ||
Assert.That(number, Is.EqualTo("010-1111-2222")); | ||
} | ||
} |