public async void Update_ShouldUpdate() { var service = new CrudServiceImpl(_context); service.Create(BogusDataGenerators.GetTape()); var tape = await service.GetSingle(1); tape.Title = "Updated title"; service.Update(tape); tape = await service.GetSingle(1); Assert.Equal("Updated title", tape.Title); }
public async void Remove_ShouldRemove() { var service = new CrudServiceImpl(_context); var tapes = await service.GetAll(); Assert.Equal(10, tapes.Count()); service.Delete(await service.GetSingle(1)); tapes = await service.GetAll(); Assert.Equal(9, tapes.Count()); }
public async void GetSingle_ShouldThrowNotFound() { var service = new CrudServiceImpl(_context); await Assert.ThrowsAsync <NotFoundException>(() => service.GetSingle(int.MaxValue)); }