コード例 #1
0
        public void RemoveMoreElementsThanCollectionHave()
        {
            //Arrange
            IntDataBase db = new IntDataBase(new List <int>()
            {
                1, 2
            });

            //Act
            db.Remove();
            db.Remove();

            //Assert
            Assert.Throws <InvalidOperationException>(() => db.Remove());
        }
コード例 #2
0
        public void RemoveManyElements()
        {
            //Arrange
            IntDataBase db = new IntDataBase(new List <int>()
            {
                1, 2, 3, 4
            });

            //Act
            db.Remove();
            db.Remove();
            db.Remove();

            //Assert
            CollectionAssert.AreEqual(new int[] { 1 }, db.Elements);
        }