public void ShouldNotAddIfAlreadyExists() { // ReSharper disable once UseObjectOrCollectionInitializer var set = new ConcurrentRoundRobinSet <int> { 0, 1, 2, 3 }; set.Add(0); set.Add(1); set.Add(2); set.Add(3); set.Count.Should().Be(4); set.Should().ContainInOrder(0, 1, 2, 3); }
public void ShouldClear() { // Given var set = new ConcurrentRoundRobinSet <int> { 0, 1, 2, 3 }; int ignored; set.TryNext(out ignored); set.Index.Should().Be(1); // When set.Clear(); // Then set.Should().BeEmpty(); set.Index.Should().Be(0); }