示例#1
0
        public void ToUser_GoodUserInfo_User()
        {
            var userInfo = new UserInfo {
                Id = Guid.NewGuid(), Name = "user", IsOnline = true
            };

            User result = DalConverter.ToUser(userInfo);

            Assert.Equal(userInfo.Id, result.Id);
            Assert.Equal(userInfo.Name, result.Name);
            Assert.True(userInfo.IsOnline);
        }
示例#2
0
        public void ToUser_NullUserInfo_Throws()
        {
            Exception result = Assert.Throws <ArgumentException>(() => DalConverter.ToUser(null));

            Assert.IsType(typeof(ArgumentException), result);
        }
示例#3
0
        public User GetUserByName(string userName)
        {
            UserInfo userInfo = ServiceClient.GetUserByName(userName);

            return(DalConverter.ToUser(userInfo));
        }