Beispiel #1
0
        public async Task GetLikesShouldReturnLikesCount()
        {
            ApplicationDbContext db = GetDb();

            var repository = new EfRepository <Like>(db);

            var service = new LikesService(repository);

            var like = new Like
            {
                CommentId = 34,
                UserId    = "userId",
            };

            await db.AddAsync(like);

            await db.SaveChangesAsync();

            var count = service.GetLikes(34);

            Assert.Equal(1, count);
        }