-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "spring cleaning in Contrib areas, more share of code between …
…framework versions in Contrib" This reverts commit 27abc44.
- Loading branch information
1 parent
2d0ae2b
commit c8bd264
Showing
12 changed files
with
1,362 additions
and
518 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Dapper.Contrib.Tests_NET45 | ||
{ | ||
/// <summary> | ||
/// Assert extensions borrowed from Sam's code in DapperTests | ||
/// </summary> | ||
static class Assert | ||
{ | ||
public static void IsEqualTo<T>(this T obj, T other) | ||
{ | ||
if (!obj.Equals(other)) | ||
{ | ||
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other)); | ||
} | ||
} | ||
|
||
public static void IsSequenceEqualTo<T>(this IEnumerable<T> obj, IEnumerable<T> other) | ||
{ | ||
if (!obj.SequenceEqual(other)) | ||
{ | ||
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other)); | ||
} | ||
} | ||
|
||
public static void IsFalse(this bool b) | ||
{ | ||
if (b) | ||
{ | ||
throw new ApplicationException("Expected false"); | ||
} | ||
} | ||
|
||
public static void IsTrue(this bool b) | ||
{ | ||
if (!b) | ||
{ | ||
throw new ApplicationException("Expected true"); | ||
} | ||
} | ||
|
||
public static void IsNull(this object obj) | ||
{ | ||
if (obj != null) | ||
{ | ||
throw new ApplicationException("Expected null"); | ||
} | ||
} | ||
|
||
} | ||
} |
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.