public void trying_to_map_a_string_that_doesnt_correspond_to_enum_val_throws_exception() { var testItem = new XmlRpcComment { }; Assert.Throws<ArgumentException>(delegate { Map.To.Comment(testItem); }); }
public void trying_to_map_a_string_that_doesnt_correspond_to_enum_val_throws_exception() { var testItem = new XmlRpcComment { }; Assert.Throws <ArgumentException>(delegate { Map.To.Comment(testItem); }); }
public void can_map_to_comment_from_xmlRpcComment() { var statusEnum = CommentStatus.Approve; var statusEnumName = Enum.GetName(typeof(CommentStatus), statusEnum); var xmlRpcComment = new XmlRpcComment { author = "test author", author_email = "*****@*****.**", author_url = "www.test.com", parent = "0", content = "This is some test content", post_id = "234", }; var result = Map.To.Comment(xmlRpcComment); Assert.AreEqual(xmlRpcComment.author, result.AuthorName); Assert.AreEqual(xmlRpcComment.author_email, result.AuthorEmail); Assert.AreEqual(xmlRpcComment.author_url, result.AuthorUrl); Assert.AreEqual(xmlRpcComment.parent, result.ParentCommentID); Assert.AreEqual(xmlRpcComment.content, result.Content); }