private ActorRelationship CreateRelationship(int requestor, int acceptor) { var actorRelationship = new ActorRelationship { RequestorId = requestor, AcceptorId = acceptor }; _relationshipController.CreateRelationship(actorRelationship); return(actorRelationship); }
public void DoesDeleteRelationshipWhenUserDeleted() { // Arrange var requestor = Helpers.CreateUser($"{nameof(DoesDeleteRelationshipWhenUserDeleted)} Requestor"); var acceptor = Helpers.CreateUser($"{nameof(DoesDeleteRelationshipWhenUserDeleted)} Acceptor"); var relationship = new ActorRelationship { RequestorId = requestor.Id, AcceptorId = acceptor.Id }; _relationshipController.CreateRelationship(relationship); // Act _userController.Delete(requestor.Id); // Assert var relationships = _relationshipController.GetRelatedActors(requestor.Id, ActorType.User); Assert.Empty(relationships); }