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"); }
public static void TestCanCount() { var repository = new ModelRepository(); repository.DeleteAll(); repository.Insert(getModels()); var count = repository.CountAll(); Assert.True(count == getModels().Count(), "Incorrect count"); }
public static void TestCanCount() { var repository = new ModelRepository (); repository.DeleteAll (); repository.Insert (getModels ()); var count = repository.CountAll (); Assert.True (count == getModels ().Count (), "Incorrect count"); }
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"); }
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"); }
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"); }