コード例 #1
0
        public void Empty_Id_And_Password_Login_Test()
        {
            IRepository    repo = new Mocks.RepositoryMock();
            LoginViewModel vm   = new LoginViewModel();

            vm.Repository = repo;

            vm.Username = "";
            vm.Password = "";

            vm.LoginCommand.Execute(null);

            Assert.AreEqual("Please enter a username.\nPlease enter a password.", vm.ValidationErrors);
        }
コード例 #2
0
        public void Invalid_Password_Login_Test()
        {
            IRepository    repo = new Mocks.RepositoryMock();
            LoginViewModel vm   = new LoginViewModel();

            vm.Repository = repo;

            vm.Username = "******";
            vm.Password = "******";

            vm.LoginCommand.Execute(null);

            Assert.AreEqual("Password is incorrect", vm.ValidationErrors);
        }