public static FromDocument ( |
||
doc | ||
return |
public void TestFromDocument() { String colname = "tests"; String id = "32312312"; Document doc = new Document().Append(DBRef.RefName, colname).Append(DBRef.IdName, id); DBRef expected = new DBRef(colname, id); Assert.AreEqual(expected, DBRef.FromDocument(doc)); }
public void TestFromIncompleteDocumentThrowsArguementException() { bool thrown = false; try { DBRef.FromDocument(new Document().Append(DBRef.RefName, "tests")); } catch (ArgumentException) { thrown = true; } Assert.IsTrue(thrown, "ArgumentException should have been thrown when trying to create convert from incomplete document"); }