public async Task TestPutMemeItemUpdate() { using (var context = new FeedMeContext(options)) { // Given string title = "putMeme"; Detail memeItem1 = context.Detail.Where(x => x.Title == memeTitles[0]).Single(); memeItem1.Title = title; // When DetailsController memeController = new DetailsController(context, configuration); IActionResult result = await memeController.PutDetail(memeItem1.Id, memeItem1) as IActionResult; // Then memeItem1 = context.Detail.Where(x => x.Title == title).Single(); } }
public async Task TestPutMemeItemNoContentStatusCode() { using (var context = new FeedMeContext(options)) { // Given string title = "putMeme"; Detail memeItem1 = context.Detail.Where(x => x.Title == memeTitles[0]).Single(); memeItem1.Title = title; // When DetailsController memeController = new DetailsController(context, configuration); IActionResult result = await memeController.PutDetail(memeItem1.Id, memeItem1) as IActionResult; // Then Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(NoContentResult)); } }