public async Task Setup() { var book = BookBuilder.WithLibrary(LibraryId).Build(); var chapter = ChapterBuilder.WithLibrary(LibraryId).Build(); _response = await Client.PostString($"/libraries/{-RandomData.Number}/books/{book.Id}/chapters/{chapter.Id}/contents?language={RandomData.Locale}", RandomData.String, RandomData.Locale); }
public async Task Setup() { var reader = AccountBuilder.InLibrary(LibraryId).As(Role.Reader).Build(); _chapter = ChapterBuilder.WithLibrary(LibraryId).WithContents().WithoutAnyAssignment().Build(); _response = await Client.PostObject($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.ChapterNumber}/assign", new { AccountId = reader.Id, Type = "write" }); }
public async Task Setup() { var _newContents = RandomData.Words(12); var chapter = ChapterBuilder.WithLibrary(LibraryId).WithoutContents().Build(); _response = await Client.DeleteAsync($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.ChapterNumber}/contents?language={RandomData.Locale}"); }
public async Task Setup() { _chapter = ChapterBuilder.WithLibrary(LibraryId).Private().WithContents().Build(); var content = ChapterBuilder.Contents.Single(x => x.ChapterId == _chapter.Id); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.Id}/contents?language={content.Language}"); }
public async Task Setup() { _expected = ChapterBuilder.WithLibrary(LibraryId).Build(4).First(); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{_expected.BookId}/chapters/{_expected.ChapterNumber}"); _assert = ChapterAssert.FromResponse(_response, LibraryId); }
public async Task Setup() { _chapter = ChapterBuilder.WithLibrary(LibraryId).Build(); _response = await Client.PostString($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.ChapterNumber}/contents", RandomData.String, null); _assert = new ChapterContentAssert(_response, Library); }
public async Task Setup() { _chapter = ChapterBuilder.WithLibrary(LibraryId).Public().Build(); _contents = RandomData.String; _response = await Client.PostString($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.ChapterNumber}/contents?language={RandomData.Locale}", _contents, RandomData.Locale); _assert = new ChapterContentAssert(_response, LibraryId); }
public async Task Setup() { var _newContents = RandomData.Words(12); var chapter = ChapterBuilder.WithLibrary(LibraryId).WithContents().Build(); _content = ChapterBuilder.Contents.Single(x => x.ChapterId == chapter.Id); _response = await Client.DeleteAsync($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.ChapterNumber}/contents?language={_content.Language}"); }
public async Task Setup() { _chapter = ChapterBuilder.WithLibrary(LibraryId).Public().WithContents().Build(); _content = ChapterBuilder.Contents.Single(x => x.ChapterId == _chapter.Id); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.ChapterNumber}/contents?language={_content.Language}"); _assert = new ChapterContentAssert(_response, LibraryId); }
public async Task Setup() { _chapters = ChapterBuilder.WithLibrary(LibraryId).WithContents().Build(4); _book = DatabaseConnection.GetBookById(_chapters.PickRandom().BookId); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{_book.Id}/chapters"); _view = _response.GetContent <ListView <ChapterView> >().Result; }
public async Task Setup() { _chapter = ChapterBuilder.WithLibrary(LibraryId).Public().WithContents().Build(); _content = ChapterBuilder.Contents.Single(x => x.ChapterId == _chapter.Id); _newContents = RandomData.String; _response = await Client.PutString($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.Id}/contents?language={_content.Language}", _newContents); }
public async Task Setup() { var chapters = ChapterBuilder.WithLibrary(LibraryId).WithContents(2).Build(4); _expected = chapters.PickRandom(); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{_expected.BookId}/chapters/{_expected.ChapterNumber}"); _assert = ChapterAssert.FromResponse(_response, LibraryId); }
public async Task Setup() { var chapters = ChapterBuilder.WithLibrary(LibraryId).WithContents().Build(4); var chapter = chapters.PickRandom(); var chapter2 = new ChapterView { Title = RandomData.Name }; _response = await Client.PutObject($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.ChapterNumber}", chapter2); }
public async Task Setup() { var chapters = ChapterBuilder.WithLibrary(LibraryId).Build(4); var chapter = chapters.PickRandom(); newChapter = new ChapterView { Title = RandomData.Name, BookId = chapter.BookId }; _response = await Client.PutObject($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.ChapterNumber}", newChapter); _assert = ChapterAssert.FromResponse(_response, LibraryId); }
public async Task Setup() { var chapter = ChapterBuilder.WithLibrary(LibraryId).WithoutContents().Build(); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.Id}/contents?language={RandomData.Locale}"); }
public async Task Setup() { var expected = ChapterBuilder.WithLibrary(LibraryId).Build(); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{expected.BookId}/chapters/{-RandomData.Number}"); }
public async Task Setup() { var chapter = ChapterBuilder.WithLibrary(LibraryId).Build(); _response = await Client.DeleteAsync($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.ChapterNumber}"); }
public async Task Setup() { _chapter = ChapterBuilder.WithLibrary(LibraryId).WithContents().WithoutAnyAssignment().Build(); _response = await Client.PostObject($"/libraries/{LibraryId}/books/{_chapter.BookId}/chapters/{_chapter.ChapterNumber}/assign", new { Type = "review" }); }
public async Task Setup() { _expected = ChapterBuilder.WithLibrary(LibraryId).WithContents().Build(); _response = await Client.DeleteAsync($"/libraries/{LibraryId}/books/{_expected.BookId}/chapters/{_expected.ChapterNumber}"); }
public async Task Setup() { ChapterBuilder.WithLibrary(LibraryId).Build(4); _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{-RandomData.Number}/chapters"); }