Exemplo n.º 1
0
        public bool Login(UserInfoTest userInfoTest)
        {
            if (userInfoTest.RoleInfoes == null || userInfoTest.PostInfoes != null || userInfoTest.LastPostInfo != null)
            {
                return(false);
            }

            return(userInfoTest.Username == "ali" && userInfoTest.Password == "123");
        }
Exemplo n.º 2
0
 public bool HelloBind(UserInfoTest userInfoTest, UserInfoTest userInfoTest2, UserInfoTest userInfoTest3)
 {
     if (userInfoTest.Id == 15 && userInfoTest.Age == 0 && userInfoTest.Password == null && userInfoTest.Username == null && userInfoTest.RoleInfoes == null && userInfoTest.PostInfoes == null &&
         userInfoTest2.Id == 15 && userInfoTest2.Age == 10 && userInfoTest2.Username == null && userInfoTest2.Password != null && userInfoTest2.RoleInfoes[0].Id == 5 &&
         userInfoTest3.Id == 15 && userInfoTest3.Username == "user name" && userInfoTest3.Age == 0 && userInfoTest3.Password == null)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
        public List <UserInfoTest> GetListOfUsers()
        {
            List <UserInfoTest> results       = new List <UserInfoTest>();
            UserInfoTest        userInfoTest1 = new UserInfoTest()
            {
                Id = 1, Age = 25, Password = "******", Username = "******"
            };

            userInfoTest1.PostInfoes = new List <PostInfoTest>()
            {
                new PostInfoTest()
                {
                    Id = 1, PostSecurityLink = "securityLink", Text = "hello guys...", Title = "work finished", User = userInfoTest1
                }
            };
            userInfoTest1.LastPostInfo = userInfoTest1.PostInfoes.FirstOrDefault();
            userInfoTest1.RoleInfoes   = new List <RoleInfoTest>()
            {
                new RoleInfoTest()
                {
                    Id = 1, Type = RoleTypeTest.Normal, User = userInfoTest1
                }
            };
            results.Add(userInfoTest1);

            UserInfoTest userInfoTest2 = new UserInfoTest()
            {
                Id = 2, Age = 32, Password = "******", Username = "******"
            };

            userInfoTest2.PostInfoes = new List <PostInfoTest>()
            {
                new PostInfoTest()
                {
                    Id = 2, PostSecurityLink = "securityLink2", Text = "today were good but...", Title = "good day", User = userInfoTest2
                }
            };
            userInfoTest2.LastPostInfo = userInfoTest2.PostInfoes.FirstOrDefault();
            userInfoTest2.RoleInfoes   = new List <RoleInfoTest>()
            {
                new RoleInfoTest()
                {
                    Id = 2, Type = RoleTypeTest.Admin, User = userInfoTest2
                }
            };
            results.Add(userInfoTest2);

            return(results);
        }