예제 #1
0
        public void GivenRandomSet_InsertAndDelete_ShouldNotThrowException()
        {
            var randomSet = new RandomSet();

            randomSet.Insert(0);
            randomSet.Insert(2);

            Assert.IsTrue(randomSet.Count == 2);

            randomSet.Delete(0);
            Assert.IsTrue(randomSet.Count == 1);
        }
예제 #2
0
        public void GivenRandomSet_InsertAndGet_ShouldReturnTheInsertedNumber()
        {
            var randomSet = new RandomSet();

            randomSet.Insert(0);
            var result = randomSet.GetRandom();

            Assert.IsTrue(result == 0);
        }