Beispiel #1
0
 public LikeRepository(ReactorDbContext context) : base(context)
 {
     if (context == null)
     {
         throw new ArgumentNullException(nameof(context));
     }
 }
Beispiel #2
0
        public async Task FriendRequestExists_RequestIsNotCreated_ReturnFalse()
        {
            var options = InMemoryDbHelper.SetUpInMemoryDb("Request_Is_Not_Created");

            using (var dbContext = new ReactorDbContext(options))
            {
                dbContext.Set <Friend>();
            }

            var service = new FriendService(new FriendRepository(new ReactorDbContext(options)), _userService.Object);

            var result = await service.FriendRequestExistsAsync(It.IsAny <string>(), It.IsAny <string>());

            Assert.That(result, Is.False);
        }
Beispiel #3
0
        public async Task FriendRequestExists_RequestIsCreatedByRequestedToUser_ReturnTrue()
        {
            var options = InMemoryDbHelper.SetUpInMemoryDb("Request_Is_Created_By_RequestedToUser");

            using (var dbContext = new ReactorDbContext(options))
            {
                await dbContext.Set <Friend>().AddRangeAsync(new List <Friend>
                {
                    _notapprovedfriend
                });

                await dbContext.SaveChangesAsync();
            }

            var service = new FriendService(new FriendRepository(new ReactorDbContext(options)), _userService.Object);

            var result = await service.FriendRequestExistsAsync(_currentUser.Id, _otherUser1.Id);

            Assert.That(result, Is.True);
        }
Beispiel #4
0
 public UnitOfWork(ReactorDbContext context)
 {
     _context = context;
 }