public void IsSubsetOfShouldFailWhenFalse() { // arrange var assert = new Asserter(); var superset = new List <object>() { new object(), new object(), new object(), }; var subset = new List <object>() { superset[2], superset[0], new object(), }; var comparer = EqualityComparer <object> .Default; try { // act assert.IsSubsetOf(subset, superset, comparer); } catch (AssertFailedException) { // assert return; } Assert.Fail("An exception was expected, but not thrown."); }
public void IsSubsetOfShouldPassWhenTrue() { // arrange var assert = new Asserter(); var superset = new List <object>() { new object(), new object(), new object(), }; var subset = new List <object>() { superset[2], superset[0], }; var comparer = EqualityComparer <object> .Default; // act, assert assert.IsSubsetOf(subset, superset, comparer); }
public void IsSubsetOfShouldNotAllowNullComparer() { // arrange var assert = new Asserter(); var subset = new object[0]; var superset = new object[0]; var comparer = default(IEqualityComparer <object>); try { // act assert.IsSubsetOf(subset, superset, comparer); } catch (AssertFailedException ex) { // assert Assert.AreEqual(GetExpectedMessage(nameof(comparer)), ex.Message); return; } Assert.Fail("An exception was expected, but not thrown."); }