예제 #1
0
        public static void TestCanDeleteAll()
        {
            var repository = new ModelRepository();

            repository.Insert(getModels());

            var preCount = repository.CountAll();

            repository.DeleteAll();

            var postCount = repository.CountAll();

            Assert.True(preCount > 0, "No records were available to delete");
            Assert.True(postCount == 0, "Failed to delete all records");
        }
예제 #2
0
        public static void TestCanCount()
        {
            var repository = new ModelRepository();

            repository.DeleteAll();
            repository.Insert(getModels());

            var count = repository.CountAll();

            Assert.True(count == getModels().Count(), "Incorrect count");
        }
예제 #3
0
        public static void TestCanCount()
        {
            var repository = new ModelRepository ();

            repository.DeleteAll ();
            repository.Insert (getModels ());

            var count = repository.CountAll ();

            Assert.True (count == getModels ().Count (), "Incorrect count");
        }
예제 #4
0
        public static void TestCanDeleteAll()
        {
            var repository = new ModelRepository ();

            repository.Insert (getModels ());

            var preCount = repository.CountAll ();

            repository.DeleteAll ();

            var postCount = repository.CountAll ();

            Assert.True (preCount > 0, "No records were available to delete");
            Assert.True (postCount == 0, "Failed to delete all records");
        }
예제 #5
0
        public static void TestCanDelete()
        {
            var repository = new ModelRepository ();

            repository.Insert (getModels ());

            var models = repository.GetAll ();

            var list = new List<long> () { models.First ().Id };

            repository.Delete (list);

            var postCount = repository.CountAll ();
            var reRead = repository.Get (list);

            Assert.True (postCount == models.Count () - 1, "Post delete count is incorrect");
            Assert.True (reRead.Count () == 0, "Could retrieve the model after deletion");
        }
예제 #6
0
        public static void TestCanDelete()
        {
            var repository = new ModelRepository();

            repository.Insert(getModels());

            var models = repository.GetAll();

            var list = new List <long> ()
            {
                models.First().Id
            };

            repository.Delete(list);

            var postCount = repository.CountAll();
            var reRead    = repository.Get(list);


            Assert.True(postCount == models.Count() - 1, "Post delete count is incorrect");
            Assert.True(reRead.Count() == 0, "Could retrieve the model after deletion");
        }