public async Task CheckIfGetViewModelAsyncWorksCorrectly() { this.SeedDatabase(); var expectedModel = new PrivacyDetailsViewModel { Id = this.firstPrivacy.Id, PageContent = this.firstPrivacy.PageContent, }; var viewModel = await this.privacyService.GetViewModelAsync <PrivacyDetailsViewModel>(); var expectedObj = JsonConvert.SerializeObject(expectedModel); var actualResultObj = JsonConvert.SerializeObject(viewModel); Assert.Equal(expectedObj, actualResultObj); }
public async Task <IActionResult> Remove(PrivacyDetailsViewModel privacyDetailsViewModel) { await this.privacyService.DeleteByIdAsync(privacyDetailsViewModel.Id); return(this.RedirectToAction("Privacy", "Home", new { area = string.Empty })); }