Пример #1
0
        public async Task GetCommentByIdJsonShouldReturnCommentJson()
        {
            // Arrange
            var db = this.GetDatabase();

            var comment = new Comment
            {
                Id      = "slihdbflisdbnfawef",
                MovieId = "lihsbdfjsndfsf",
                UserId  = "s;lkdf;sldfkg"
            };

            var json = JsonConvert.SerializeObject(comment);

            db.AddRange(comment);

            await db.SaveChangesAsync();

            var commentsService = new CommentsService(db);

            // Act
            var result = commentsService.GetCommentByIdJson(comment.Id);

            // Assert
            result
            .Should()
            .Equals(json);
        }