public IEnumerable <RelationWebModel> Relations(Guid userId)
        {
            var model  = _relationService.GetUserRelations(userId);
            var result = Mapper.Map <IEnumerable <RelationWebModel> >(model);

            return(result);
        }
예제 #2
0
        public void GetUserRelations_ReturnsExpectedRelations()
        {
            // Act
            var relations = _relationService.GetUserRelations(_john.Id).ToList();

            // Assert
            bool containsKate         = relations.Any(x => x.InvitedUser.UserName == _kate.UserName);
            bool containsDave         = relations.Any(x => x.InvitingUser.UserName == _dave.UserName);
            bool containsTwoRelations = relations.Count == 2;

            Assert.IsTrue(containsTwoRelations && containsKate && containsDave);
        }