public void RemoveAtSingle() { //**************************************** var Seed = Environment.TickCount; var Random = new Random(Seed); //**************************************** var Dictionary = new Dictionary <int, int>(16); foreach (var(Left, Right) in YieldRandom(Random, 16)) { Dictionary.Add(Left, Right); } var Records = new BiDictionary <int, int>(Dictionary); //**************************************** var InnerIndex = Random.Next(Records.Count); var Key = Records.Lefts[InnerIndex]; Records.RemoveAt(InnerIndex); Assert.IsTrue(Dictionary.Remove(Key)); Assert.IsFalse(Records.ContainsLeft(Key)); //**************************************** Assert.AreEqual(15, Records.Count, "Count incorrect. Bad Seed was {0}", Seed); CollectionAssert.AreEquivalent(Dictionary, Records, "Collections don't match. Bad Seed was {0}", Seed); foreach (var MyPair in Dictionary) { Assert.IsTrue(Records.TryGetRight(MyPair.Key, out var Value)); Assert.AreEqual(MyPair.Value, Value); } }