コード例 #1
0
        public void ValidateUserCredentials()
        {
            //Arrenge
            var userName = "******";
            var password = "******";

            var fakeUser = new User
            {
                UserId   = "1",
                UserName = userName,
                Password = password
            };

            A.CallTo(() => amazingTodoRepository.GetUser(userName, password)).Returns(fakeUser);


            //Act
            var authenticatedUser = amazingTodoapp.AuthenticateUser(userName, password);

            //Assert
            Assert.Equal(userName, authenticatedUser.UserName);
        }
コード例 #2
0
ファイル: AmazingTodoApp.cs プロジェクト: Lesthad/MariosTODO
 public User AuthenticateUser(string userName, string password)
 {
     currentUser = amazingTodoRepository.GetUser(userName, password);
     return(currentUser);
 }