Commit e14839f7 authored by mrange's avatar mrange

Updated IsEqualTo and IsSequenceEqualTo so that they don't throw if first parameter is null.

parent d7ba878d
......@@ -10,7 +10,7 @@ static class Assert
public static void IsEqualTo<T>(this T obj, T other)
{
if (!obj.Equals(other))
if (!Equals(obj, other))
{
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other));
}
......@@ -18,7 +18,7 @@ public static void IsEqualTo<T>(this T obj, T other)
public static void IsSequenceEqualTo<T>(this IEnumerable<T> obj, IEnumerable<T> other)
{
if (!obj.SequenceEqual(other))
if (!(obj ?? new T[0]).SequenceEqual(other ?? new T[0]))
{
throw new ApplicationException(string.Format("{0} should be equals to {1}", obj, other));
}
......
......@@ -2121,7 +2121,7 @@ public void TestMultiSelectWithSomeEmptyGrids()
four[0].IsEqualTo(4);
}
}
[ActiveTest]
public void TestDynamicMutation()
{
var obj = connection.Query("select 1 as [a], 2 as [b], 3 as [c]").Single();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment