public async Task Edit_POST_InvalidResponse() { // arrange MockLanguageService.Setup_EditLanguage_Returns_LanguageEditResponse_Invalid(); var model = GetLanguageOneEditModel(); // act var result = await SystemUnderTest.Edit(model); // assert AssertErrorMessagesForInvalidOrFailedResponse <LanguageEditModel>(result); MockLanguageService.Verify_EditLanguage(); }
public async Task Edit_POST() { // arrange MockHostingEnvironment.Setup(x => x.WebRootPath).Returns(""); MockLanguageService.Setup_EditLanguage_Returns_LanguageEditResponse_Success(); var model = GetLanguageOneEditModel(); // act var result = await SystemUnderTest.Edit(model); // assert ((RedirectResult)result).Url.ShouldBe("/Language/List/"); MockLanguageService.Verify_EditLanguage(); }