mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-26 02:30:00 +08:00
This eliminates the dual solutions and brings Contrib into the project.json fold. - Tests are ported to xUnit though SQLite is disabled on DNX due to Issue #375 (Interop loads fail in the VS runner and params are busted regardless). - Projects are consolidated down to what's currently possible with project.json. - Contrib moved to: Dapper.Contrib and Dapper.Tests.Contrib (so tests appear at the end, no other reason vs. Dapper.Contrib.Tests) - EF moved to: Dapper.EntityFramework(.StrongName) - Rainbow moved to: Dapper.Rainbow - SqlBuilder moved to: Dapper.SqlBuilder - Packages are removed since it's not current-tooling friendly to keep them (nor was it using them). - xUnit implemented in Contrib via abstracts - this allow us to very quickly add any database provider to the rig in a very concise way. - Contrib unit tests fixed in various places - they were not parallel-runner friendly - Nuspecs removed, since they aren't used anymore (to eliminate confusion) - Removed speed tests for libraries that aren't on current versions of .Net (what would we be comparing?) - Perf tests moved to Dapper.Tests (consolidation from Dapper.DNX.Tests), but aren't activated yet (no define)
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Dapper.Tests
|
|
{
|
|
public static class Assert
|
|
{
|
|
public static void IsEqualTo<T>(this T obj, T other)
|
|
{
|
|
Xunit.Assert.Equal(obj, other);
|
|
}
|
|
|
|
public static void IsSequenceEqualTo<T>(this IEnumerable<T> obj, IEnumerable<T> other)
|
|
{
|
|
Xunit.Assert.Equal(obj ?? new T[0], other);
|
|
}
|
|
public static void IsMoreThan(this int a, int b)
|
|
{
|
|
Xunit.Assert.True(a > b, $"{a} should be larger than {b}");
|
|
}
|
|
|
|
public static void IsMoreThan(this long a, int b)
|
|
{
|
|
Xunit.Assert.True(a > b, $"{a} should be larger than {b}");
|
|
}
|
|
|
|
public static void Fail()
|
|
{
|
|
Xunit.Assert.True(false, "Expectation failed");
|
|
}
|
|
public static void IsFalse(this bool b)
|
|
{
|
|
Xunit.Assert.False(b);
|
|
}
|
|
|
|
public static void IsTrue(this bool b)
|
|
{
|
|
Xunit.Assert.True(b);
|
|
}
|
|
|
|
public static void IsNull(this object obj)
|
|
{
|
|
Xunit.Assert.Null(obj);
|
|
}
|
|
|
|
public static void IsNotNull(this object obj)
|
|
{
|
|
Xunit.Assert.NotNull(obj);
|
|
}
|
|
}
|
|
}
|