public void ErrorOnRemovingMissingKey() { var kl = new PrimaryKeyedList<DayOfWeek, HasInterface>() { new HasInterface(DayOfWeek.Tuesday) }; Assert.False(kl.Remove(DayOfWeek.Monday)); }
public void TestRemove() { var kl = new PrimaryKeyedList<DayOfWeek, HasInterface>() { new HasInterface(DayOfWeek.Monday), new HasInterface(DayOfWeek.Tuesday) }; var initialLength = kl.Count; Assert.True(kl.Remove(DayOfWeek.Monday)); Assert.That(kl, Contains.Item(new HasInterface(DayOfWeek.Tuesday))); Assert.That(kl, Does.Not.Contains(new HasInterface(DayOfWeek.Monday))); Assert.That(kl, Has.Property(nameof(kl.Count)).EqualTo(initialLength - 1)); }