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);
        }
Example #2
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);
        }
        public async Task Setup()
        {
            var book = BookBuilder.WithLibrary(LibraryId).Build();

            _newChapter = new ChapterView {
                Title = RandomData.Name, BookId = book.Id, ChapterNumber = RandomData.Number
            };

            _response = await Client.PutObject($"/libraries/{LibraryId}/books/{book.Id}/chapters/{_newChapter.ChapterNumber}", _newChapter);

            _chapterAssert = ChapterAssert.FromResponse(_response, LibraryId);
        }
Example #4
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);
        }
Example #5
0
 public void ShouldUpdateDatabaseWithAssignment()
 {
     ChapterAssert.FromResponse(_response, LibraryId)
     .ShouldBeSavedNoAssignmentForWriting(DatabaseConnection)
     .ShouldBeSavedAssignmentForReviewing(DatabaseConnection, _reviewer);
 }
Example #6
0
 public void ShouldAssignChapterToUser()
 {
     ChapterAssert.FromResponse(_response, LibraryId)
     .ShouldNotBeAssignedForWriting()
     .ShouldBeAssignedToUserForReviewing(_reviewer);
 }