public void GetUserDataByAccountNameTest() { #region arrange AccountInfoData accountID = new AccountInfoData() { UserId = 1, AccountName = "kevan", Password = "******", UserName = "******" }; UserDTO reUserDTO = new UserDTO() { UserID = 1, AccountName = "kevan", Password = "******", UserName = "******", Email = "*****@*****.**" }; _userRep.Stub(o => o.FindAccountData(Arg <string> .Is.Anything)).Return(reUserDTO); #endregion #region act var result = _target.GetUserDataByAccountName(accountID); #endregion #region assert Assert.AreEqual(result.UserID, reUserDTO.UserID); Assert.AreEqual(result.AccountName, reUserDTO.AccountName); Assert.AreEqual(result.Password, reUserDTO.Password); Assert.AreEqual(result.UserName, reUserDTO.UserName); Assert.AreEqual(result.Email, reUserDTO.Email); #endregion }