コード例 #1
0
        public void TestDeleteMethodWhereItemDoesntExist()
        {
            Person person = new Person(203, "Delete203");
            int    count  = CountItemsInDatabase();

            DatabaseModifier.DeleteItemFromDatabase(person);
            int countAfter = CountItemsInDatabase();

            Assert.AreEqual(count, countAfter);
        }
コード例 #2
0
        public void TestDeleteMethod()
        {
            Person person = new Person(104, "Delete104");

            DatabaseModifier.AddData(person);
            int count = CountItemsInDatabase();

            DatabaseModifier.DeleteItemFromDatabase(person);
            int countAfter = CountItemsInDatabase();

            Assert.AreEqual(count - 1, countAfter);
        }