public async Task ReturnCreatedEntries() { var user = new TestServiceModel { FirstName = "ReturnCreatedEntries FirstName", LastName = "ReturnCreatedEntries LastName" }; var result = await testService.CreateAsync(user, cancellationToken); Assert.Same(user.Id, result.Id); Assert.Same(user.FirstName, result.FirstName); Assert.Same(user.LastName, result.LastName); await testService.DeleteAsync(user.Id, cancellationToken); }
public async Task DeleteEntries() { var cancellationToken = default(CancellationToken); var user = new TestServiceModel { FirstName = "DeleteEntries FirstName", LastName = "DeleteEntries LastName" }; var task = testService.CreateAsync(user, cancellationToken).ContinueWith(async(t) => { var result = t.Result; // delete async await testService.DeleteAsync(user.Id, cancellationToken); }).Unwrap() .ContinueWith(async(t) => { var i = await testService.GetByIdAsync(user.Id, cancellationToken); Assert.Null(i); }).Unwrap(); await task; }