summaryrefslogtreecommitdiff
path: root/src/Notepad/Test/Extensions
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2018-11-04 15:22:16 -0700
committermo <mo.khan@gmail.com>2018-11-04 15:22:16 -0700
commit5ee1f55497a4e30322a56f133f897ecde1612967 (patch)
treebf544e0879234c3623869627d8786776cb19b8e9 /src/Notepad/Test/Extensions
initial commit.HEADmaster
Diffstat (limited to 'src/Notepad/Test/Extensions')
-rw-r--r--src/Notepad/Test/Extensions/AssertionExtensions.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Notepad/Test/Extensions/AssertionExtensions.cs b/src/Notepad/Test/Extensions/AssertionExtensions.cs
new file mode 100644
index 0000000..980d325
--- /dev/null
+++ b/src/Notepad/Test/Extensions/AssertionExtensions.cs
@@ -0,0 +1,35 @@
+using System.Collections.Generic;
+using System.Linq;
+using MbUnit.Framework;
+
+namespace Notepad.Test.Extensions {
+ public static class AssertionExtensions {
+ public static void ShouldBeEqualTo<T>(this T itemToValidate, T expectedValue) {
+ Assert.AreEqual(expectedValue, itemToValidate);
+ }
+
+ public static void ShouldBeSameInstanceAs<T>(this T left, T right) {
+ Assert.IsTrue(ReferenceEquals(left, right));
+ }
+
+ public static void ShouldNotBeNull<T>(this T itemToCheck) where T : class {
+ Assert.IsNotNull(itemToCheck);
+ }
+
+ public static void ShouldBeGreaterThan(this int actual, int expected) {
+ Assert.GreaterThan(actual, expected);
+ }
+
+ public static void ShouldBeLessThan(this int actual, int expected) {
+ Assert.Less(actual, expected);
+ }
+
+ public static void ShouldContain<T>(this IEnumerable<T> itemsToPeekInto, T itemToLookFor) {
+ Assert.IsTrue(itemsToPeekInto.Contains(itemToLookFor));
+ }
+
+ public static void ShouldNotContain<T>(this IEnumerable<T> itemsToPeekInto, T itemToLookFor) {
+ Assert.IsFalse(itemsToPeekInto.Contains(itemToLookFor));
+ }
+ }
+} \ No newline at end of file