{
public static void Contains(string value, string substring) { }
public static void Equal(byte[] expected, byte[] actual) { }
+ public static void Equal<T>(System.Collections.Generic.HashSet<T> expected, System.Collections.Generic.HashSet<T> actual) { }
public static void GreaterThanOrEqualTo<T>(T actual, T greaterThanOrEqualTo, string userMessage = null) where T : System.IComparable { }
public static void GreaterThan<T>(T actual, T greaterThan, string userMessage = null) where T : System.IComparable { }
public static void LessThanOrEqualTo<T>(T actual, T lessThanOrEqualTo, string userMessage = null) where T : System.IComparable { }
</Compile>
</ItemGroup>
<ItemGroup>
+ <Reference Include="System.Collections" />
<Reference Include="System.Memory" />
<Reference Include="Microsoft.Win32.Registry" />
<Reference Include="System.Runtime" />
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Xunit;
throw new AssertActualExpectedException(expectedString, actualString, null);
}
}
+
+ /// <summary>Validates that the two sets contains the same elements. XUnit doesn't display the full collections.</summary>
+ public static void Equal<T>(HashSet<T> expected, HashSet<T> actual)
+ {
+ if (!actual.SetEquals(expected))
+ {
+ throw new XunitException($"Expected: {string.Join(", ", expected)}{Environment.NewLine}Actual: {string.Join(", ", actual)}");
+ }
+ }
}
}
if (bool.Parse(checkGroupsExact))
{
- Assert.Equal(expectedGroups, GetGroups());
+ AssertExtensions.Equal(expectedGroups, GetGroups());
}
else
{