public void ToMessage_GoodMessageInfo_Message() { var messageInfo = new MessageInfo { Text = "text", CreateDate = DateTime.Now, SenderId = Guid.NewGuid(), Sender = new UserInfo { Id = Guid.NewGuid() } }; Message result = DalConverter.ToMessage(messageInfo); Assert.Equal(messageInfo.Text, result.Text); Assert.Equal(messageInfo.CreateDate, result.CreateDate); Assert.Equal(messageInfo.SenderId, result.SenderId); }
public void ToMessage_NullMessageInfo_Throws() { Exception result = Assert.Throws <ArgumentException>(() => DalConverter.ToMessage(null)); Assert.IsType(typeof(ArgumentException), result); }