public async Task WhenGetRelationshipsGetsCalled() { Setup(); AuthService.Setup(service => service.AuthorizeSelf(It.IsAny <string>(), It.IsAny <Guid>())).Returns(true); RelationshipsRepository.Setup(repository => repository.GetRelationshipsByIdAndType( It.IsAny <Guid>(), It.IsAny <RelationshipType>())).ReturnsAsync(_relationships); _result = await RelationshipsController.GetRelationships(_userId, RelationshipTypeId); }
public async Task WhenAreAlreadyFriendsGetsCalled() { Setup(); RelationshipsRepository.Setup(repository => repository.GetRelationshipByIdsAndType(It.IsAny <Guid>(), It.IsAny <Guid>(), It.IsAny <RelationshipType>())).ReturnsAsync(new Relationship()); _result = await RelationshipsService.AreAlreadyFriends(_userOneId, _userTwoId); }
public async Task WhenAddFriendGetsCalled() { Setup(); _relationship = new Relationship(_userOneId, _userTwoId, RelationshipType.Friend); RelationshipsRepository.Setup(repository => repository.CreateRelationship(It.IsAny <Relationship>())) .Callback <Relationship>(rel => _usedRelationship = rel); await RelationshipsService.AddFriend(_userOneId, _userTwoId); }