コード例 #1
0
        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);
        }
コード例 #2
0
        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" });
        }
コード例 #3
0
        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}");
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #8
0
        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}");
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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;
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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}");
        }
コード例 #16
0
        public async Task Setup()
        {
            var expected = ChapterBuilder.WithLibrary(LibraryId).Build();

            _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{expected.BookId}/chapters/{-RandomData.Number}");
        }
コード例 #17
0
        public async Task Setup()
        {
            var chapter = ChapterBuilder.WithLibrary(LibraryId).Build();

            _response = await Client.DeleteAsync($"/libraries/{LibraryId}/books/{chapter.BookId}/chapters/{chapter.ChapterNumber}");
        }
コード例 #18
0
 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" });
 }
コード例 #19
0
        public async Task Setup()
        {
            _expected = ChapterBuilder.WithLibrary(LibraryId).WithContents().Build();

            _response = await Client.DeleteAsync($"/libraries/{LibraryId}/books/{_expected.BookId}/chapters/{_expected.ChapterNumber}");
        }
コード例 #20
0
        public async Task Setup()
        {
            ChapterBuilder.WithLibrary(LibraryId).Build(4);

            _response = await Client.GetAsync($"/libraries/{LibraryId}/books/{-RandomData.Number}/chapters");
        }