public void CollectionRepository_CollectionNotFound() { using (var context = DataCreation.CreateDb("CollectionRepository_CollectionNotFound")) { //ARRANGE var repo = new CollectionRepository(new DatabaseFactory(context)); var collections = DataCreation.CreateCollections(); context.AddRange(collections); context.SaveChanges(); //ACT var collection = repo.GetById(Guid.NewGuid()); //ASSERT Assert.IsNull(collection); } }
public void CollectionRepository_Basic() { using (var context = DataCreation.CreateDb("CollectionRepository_Basic")) { //ARRANGE var repo = new CollectionRepository(new DatabaseFactory(context)); repo.Mapper = CreateMapper(); var collections = DataCreation.CreateCollections(); context.AddRange(collections); context.SaveChanges(); //ACT var collection = repo.GetById(collections[1].Id); //ASSERT Assert.AreEqual("Collection 2", collection.Name); Assert.AreEqual(collections[1].Id, collection.Id); } }