/
aprogrammer
/
Dapper.SimpleCRUD
Обзор
Документация
Войти
/
aprogrammer
/
Dapper.SimpleCRUD
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Dapper.SimpleCRUDTests/Assert.cs
53 строки
1 KB
Eric Coffman
async support and guid primary key support
30 дек 2014, 23:00
30 дек 2014, 23:00
6e2d4cd
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; namespace Dapper.SimpleCRUDTests { /// <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 equal 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 equal 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"); } } } }