public void ShouldRemove() { var set = new AddressSet <int> { 0, 1, 2, 3 }; set.Remove(0); set.Remove(2); set.ToList().Should().ContainInOrder(1, 3); }
public void ShouldBeAbleToRemoveItem(int times) { var set = new AddressSet <int> { 0, 1, 2, 3 }; for (var j = 0; j < times; j++) { for (var i = 0; i < set.Count; i++) { var real = set.ToList()[i]; real.Should().Be(i); } } set.Remove(3); for (var j = 0; j < times; j++) { set.Contains(3).Should().BeFalse(); for (var i = 0; i < set.Count; i++) { var real = set.ToList()[i]; real.Should().Be(i); } } }
public void ShouldNotMoveIfNotExists() { var set = new AddressSet <int> { 0, 1 }; set.Remove(3); set.Count.Should().Be(2); set.ToList().Should().ContainInOrder(0, 1); }
public void ShouldProvideSnapshotAfterUpdate() { // Given var set = new AddressSet <int> { 0, 1, 2 }; // When set.Remove(1); set.Add(42); var snaphost = set.Snaphost; // Then snaphost.Should().HaveCount(3); snaphost.Should().ContainInOrder(0, 2, 42); }