示例#1
0
        public void CreateIfNotExistProfile()
        {
            User user = CreateMockingUser();

            user.Profile = profiles.CreateIfNotExistProfile(user.UserId);
            Assert.AreEqual(user.Profile.UserId, user.UserId);
        }
示例#2
0
        public void GetUserByGenderWithLiked()
        {
            DeleteUsers();
            User     first    = CreateMockingUser();
            User     second   = CreateMockingUser();
            User     third    = CreateMockingUser();
            Profiles profiles = new Profiles(context);

            first.Profile = profiles.CreateIfNotExistProfile(first.UserId);
            profiles.UpdateGender(first.Profile, "1", ref message);
            users.CreateLike(first.UserId, third.UserId);
            var successWithLiked = users.GetUsersByGender(first.UserId, true, 0, 1);

            Assert.AreEqual(successWithLiked[0].user_id, second.UserId);
        }
示例#3
0
        public void GetReciprocalUsers()
        {
            DeleteUsers();
            User     firstUser  = CreateMockingUser();
            User     secondUser = CreateMockingUser();
            User     thirdUser  = CreateMockingUser();
            Profiles profiles   = new Profiles(context);

            firstUser.Profile = profiles.CreateIfNotExistProfile(firstUser.UserId);
            profiles.UpdateGender(firstUser.Profile, "1", ref message);
            users.CreateLike(secondUser.UserId, firstUser.UserId);
            users.CreateLike(thirdUser.UserId, firstUser.UserId);
            var success = users.GetReciprocalUsers(firstUser.UserId, true, 0, 2);

            Assert.AreEqual(success[0].user_id, secondUser.UserId);
            Assert.AreEqual(success[1].user_id, thirdUser.UserId);
        }
示例#4
0
        public void GetUserByGenderWithBlocked()
        {
            DeleteUsers();
            User     first    = CreateMockingUser();
            User     second   = CreateMockingUser();
            User     third    = CreateMockingUser();
            Profiles profiles = new Profiles(context);

            first.Profile = profiles.CreateIfNotExistProfile(first.UserId);
            profiles.UpdateGender(first.Profile, "1", ref message);
            Blocks blocks = new Blocks(users, context);

            blocks.BlockUser(first.UserToken, third.UserPublicToken, "Test block.", ref message);
            var successWithBlocked = users.GetUsersByGender(first.UserId, true, 0, 1);

            Assert.AreEqual(successWithBlocked[0].user_id, second.UserId);
        }
示例#5
0
        public void GetReciprocalUsersWithBlocked()
        {
            DeleteUsers();
            User     firstUser  = CreateMockingUser();
            User     secondUser = CreateMockingUser();
            User     thirdUser  = CreateMockingUser();
            Profiles profiles   = new Profiles(context);

            firstUser.Profile = profiles.CreateIfNotExistProfile(firstUser.UserId);
            profiles.UpdateGender(firstUser.Profile, "1", ref message);
            users.CreateLike(thirdUser.UserId, firstUser.UserId);
            users.CreateLike(secondUser.UserId, firstUser.UserId);
            Blocks blocks = new Blocks(users, context);

            blocks.BlockUser(firstUser.UserToken, secondUser.UserPublicToken, "Test block.", ref message);
            var success = users.GetReciprocalUsers(firstUser.UserId, true, 0, 1);

            Assert.AreEqual(success[0].user_id, thirdUser.UserId);
        }