-
Notifications
You must be signed in to change notification settings - Fork 5
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
108 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Text; | ||
using Skybrud.Essentials.Security; | ||
using Skybrud.Essentials.Strings; | ||
|
||
namespace TestProject1.Security; | ||
|
||
[TestClass] | ||
public class Md5Tests { | ||
|
||
[TestMethod] | ||
public void GetMd5Hash() { | ||
|
||
string a = SecurityUtils.GetMd5Hash("Hello there!"); | ||
string b = SecurityUtils.GetMd5Hash("Hello there!", HexFormat.LowerCase); | ||
string c = SecurityUtils.GetMd5Hash("Hello there!", HexFormat.UpperCase); | ||
|
||
string d = SecurityUtils.GetMd5Hash("Hello there!", Encoding.UTF8); | ||
string e = SecurityUtils.GetMd5Hash("Hello there!", HexFormat.LowerCase, Encoding.UTF8); | ||
string f = SecurityUtils.GetMd5Hash("Hello there!", HexFormat.UpperCase, Encoding.UTF8); | ||
|
||
Assert.AreEqual("a77b55332699835c035957df17630d28", a, "#a"); | ||
Assert.AreEqual("a77b55332699835c035957df17630d28", b, "#b"); | ||
Assert.AreEqual("A77B55332699835C035957DF17630D28", c, "#c"); | ||
|
||
Assert.AreEqual("a77b55332699835c035957df17630d28", d, "#d"); | ||
Assert.AreEqual("a77b55332699835c035957df17630d28", e, "#e"); | ||
Assert.AreEqual("A77B55332699835C035957DF17630D28", f, "#f"); | ||
|
||
} | ||
|
||
} |
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,34 @@ | ||
using Skybrud.Essentials.Strings.Extensions; | ||
|
||
namespace TestProject1.Strings; | ||
|
||
[TestClass] | ||
public class JoinTests { | ||
|
||
[TestMethod] | ||
public void JoinT() { | ||
|
||
string[] array = { "hello", "world" }; | ||
|
||
Assert.AreEqual("hello,world", array.Join(',')); | ||
Assert.AreEqual("hello,world", array.Join(",")); | ||
|
||
Assert.AreEqual("hello,world", array.Join(',')); | ||
Assert.AreEqual("hello,world", array.Join(",")); | ||
|
||
} | ||
|
||
[TestMethod] | ||
public void JoinObject() { | ||
|
||
object[] array = { "hello", "world" }; | ||
|
||
Assert.AreEqual("hello,world", array.Join(',')); | ||
Assert.AreEqual("hello,world", array.Join(",")); | ||
|
||
Assert.AreEqual("hello,world", array.Join(',')); | ||
Assert.AreEqual("hello,world", array.Join(",")); | ||
|
||
} | ||
|
||
} |
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,17 @@ | ||
using Skybrud.Essentials.Time; | ||
|
||
namespace TestProject1.Time; | ||
|
||
[TestClass] | ||
public class EssentialsMonthTests { | ||
|
||
[TestMethod] | ||
public void ToStringDefault() { | ||
|
||
EssentialsMonth month = new(2024, 3); | ||
|
||
Assert.AreEqual("2024-03", month.ToString()); | ||
|
||
} | ||
|
||
} |
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,17 @@ | ||
using Skybrud.Essentials.Time; | ||
|
||
namespace TestProject1.Time; | ||
|
||
[TestClass] | ||
public class EssentialsWeekTests { | ||
|
||
[TestMethod] | ||
public void ToStringDefault() { | ||
|
||
EssentialsWeek week = new(2024, 13); | ||
|
||
Assert.AreEqual("2024-W13", week.ToString()); | ||
|
||
} | ||
|
||
} |
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