public void TestUpdate() { using (var repo = new RoomRepository(new GamesBackendContext(_options))) { repo.Insert(new Room() { Name = "Naam" }); } using (var repo = new RoomRepository(new GamesBackendContext(_options))) { repo.Update(new Room() { Id = 1, Name = "UpdatedName" }); } using (var repo = new RoomRepository(new GamesBackendContext(_options))) { Assert.AreEqual(1, repo.Count()); Assert.AreEqual("UpdatedName", repo.Find(1).Name); } }
public void TestAdd() { using (var repo = new RoomRepository(new GamesBackendContext(_options))) { repo.Insert(new Room() { Name = "Naam" }); } using (var repo = new RoomRepository(new GamesBackendContext(_options))) { Assert.AreEqual(1, repo.Count()); } }
public void TestDelete() { using (var repo = new RoomRepository(new GamesBackendContext(_options))) { var pen = new Room() { Name = "Name" }; repo.Insert(pen); repo.Delete(1); } using (var repo = new RoomRepository(new GamesBackendContext(_options))) { Assert.AreEqual(0, repo.Count()); } }
public void TestFindAll() { using (var repo = new RoomRepository(new GamesBackendContext(_options))) { var pen = new Room() { Name = "Entity" }; repo.Insert(pen); pen = new Room() { Name = "Name" }; repo.Insert(pen); } using (var repo = new RoomRepository(new GamesBackendContext(_options))) { Assert.AreEqual(2, repo.Count()); } }