public void IsUserBlocked_ShouldReturnTrue_WhenUserIsBlockedByOtherUser() { // Arrange _userBlockRepository.FindOne(Arg.Any <Expression <Func <UserBlockEntity, bool> > >()) .Returns(new UserBlockEntity()); // Act bool isBlocked = _userManager.IsUserBlocked(1, 2); // Assert Assert.That(isBlocked, Is.True); }
public bool IsUserBlocked(int userId, int blockedUserId) { UserBlockEntity userBlock = _userBlockRepository.FindOne(x => x.UserId == userId && x.BlockedUserId == blockedUserId); return(userBlock != null); }