public async Task Any_ExistsEntity() { int id = InitializedEntities.FirstOrDefault(); if (await _personSoftUpdatableRepo.AnyAsync(x => x.ID == id)) { Assert.Pass(); } Assert.Fail(); }
public async Task UpdateTest() { int id = InitializedEntities.FirstOrDefault(); var findResult = await _personSoftUpdatableRepo.FindAsync(id); findResult.Name = "updateTest2"; await _personSoftUpdatableRepo.UpdateAsync(findResult); findResult = await _personSoftUpdatableRepo.FindAsync(id); Assert.AreEqual(findResult.Name, "updateTest2"); }
public async Task Find_ExistsEntity() { int id = InitializedEntities.FirstOrDefault(); var findResult = await _personSoftUpdatableRepo.FindAsync(id); if (findResult != null && findResult.ID == id) { Assert.Pass(); } Assert.Fail(); }
public async Task UpdateTest() { int id = InitializedEntities.FirstOrDefault(); var findResult = await _testGenericAsyncService.Get(id); Random rnd = new Random(); string newName = "updateTest" + rnd.Next(); findResult.Name = newName; await _testGenericAsyncService.Update(findResult); findResult = await _testGenericAsyncService.Get(id); Assert.AreEqual(newName, findResult.Name); }