Пример #1
0
        public void UT_User_CreateAccount_PasswordInvalid_2()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserCreateAccountV1(repo);

            if (service.Exec(null, new NewUserData {
                Name = "xxx", Email = "*****@*****.**", Password = "******"
            }))
            {
                Assert.Fail("CreateAccount // cannot be empty");
            }
        }
Пример #2
0
        public void UT_User_CreateAccount_UserExist()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserCreateAccountV1(repo);

            if (service.Exec(null, new NewUserData {
                Name = "xxx", Email = "*****@*****.**", Password = "******"
            }))
            {
                Assert.Fail("CreateAccount // Existing user cannot create same account");
            }
        }
Пример #3
0
        public void UT_User_CreateAccount_EmailInvalid_3()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserCreateAccountV1(repo);

            if (service.Exec(null, new NewUserData {
                Name = "xxx", Email = "fddd@fdsd"
            }))
            {
                Assert.Fail("CreateAccount // Email invalid 3 accepted");
            }
        }
Пример #4
0
        public void UT_User_CreateAccount_NameInvalid()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserCreateAccountV1(repo);

            if (service.Exec(null, new NewUserData {
                Name = ""
            }))
            {
                Assert.Fail("CreateAccount // Name empty accepted");
            }
        }
Пример #5
0
        public void UT_User_Authenticate_OK()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserAuthenticateV1(repo);
            var ua      = new AuthenticatedUser();

            if (!service.Exec(null, new LoginInformation {
                Login = "******", Passwd = "123456"
            }, ref ua))
            {
                Assert.Fail("Authenticate // Failed!");
            }
        }
Пример #6
0
        public void UT_User_Authenticate_PasswordInvalid_2()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserAuthenticateV1(repo);
            var ua      = new AuthenticatedUser();

            if (service.Exec(null, new LoginInformation {
                Login = "******", Passwd = "123"
            }, ref ua))
            {
                Assert.Fail("Authenticate // Password invalid passed");
            }
        }
Пример #7
0
        public void UT_User_Authenticate_LoginInvalid()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserAuthenticateV1(repo);
            var ua      = new AuthenticatedUser();

            if (service.Exec(null, new LoginInformation {
                Login = ""
            }, ref ua))
            {
                Assert.Fail("Authenticate // Login empty accepted");
            }
        }
Пример #8
0
        public void UT_User_Comments()
        {
            var repo    = new mockUserRepositoryUserExists();
            var service = new UserCommentsV1(repo);

            var dto = service.Exec(null, new AuthenticatedUser(), 0, 1);

            if (dto.total != 1)
            {
                Assert.Fail("dto.total");
            }

            if (dto.list.Count != 1)
            {
                Assert.Fail("dto.list");
            }
        }