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); }
public void ToUser_NullUserInfo_Throws() { Exception result = Assert.Throws <ArgumentException>(() => DalConverter.ToUser(null)); Assert.IsType(typeof(ArgumentException), result); }
public User GetUserByName(string userName) { UserInfo userInfo = ServiceClient.GetUserByName(userName); return(DalConverter.ToUser(userInfo)); }