public void CanNotUpdateCopyWithAnotherTypeIdOtherThanOriginalPageTypeId() { using (var api = new Api(GetDb(), new ContentServiceFactory(services), storage, cache)) { var page = MissingPage.Create(api); page.Title = "New title"; page.OriginalPageId = PAGE_7_ID; var exn = Assert.Throws <InvalidOperationException>(() => { api.Pages.Save(page); }); Assert.Equal("Copy can not have a different content type", exn.Message); } }
public async Task CanNotUpdateCopyWithAnotherTypeIdOtherThanOriginalPageTypeId() { using (var api = CreateApi()) { var page = MissingPage.Create(api); page.Title = "New title"; page.OriginalPageId = PAGE_7_ID; var exn = await Assert.ThrowsAsync <InvalidOperationException>(async() => { await api.Pages.SaveAsync(page); }); Assert.Equal("Copy can not have a different content type", exn.Message); } }