Files
Nick Craver ae7a29a9f1 VS 2017 .csproj Migration
Due to the way VS test works (by injecting an executable entry point), the performance tests needed to be factored out. I also organized all of our existing tests better along the way.
Actual code changes to Dapper itself are very minor, only formatting and documentation fixes (which we need many more of).

The build.ps1 script is upated to work, but note that <frameworkAssemblies> is not working in .nuspec inside the packages in the new .csproj system. I consider this to be a blocker. Issue is here: https://github.com/NuGet/Home/issues/4853
2017-03-25 19:34:10 -04:00

53 lines
1.3 KiB
C#

using System.Collections.Generic;
namespace Dapper.Tests
{
public static class Assert
{
public static void IsEqualTo<T>(this T actual, T expected)
{
Xunit.Assert.Equal(expected, actual);
}
public static void IsSequenceEqualTo<T>(this IEnumerable<T> actual, IEnumerable<T> expected)
{
Xunit.Assert.Equal(expected, actual ?? new T[0]);
}
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(string message = null)
{
Xunit.Assert.True(false, message ?? "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);
}
}
}