public void GetsSource() { // Given IDocument document = new TestDocument(new NormalizedPath("/a/b/c.txt")); // When dynamic dynamicDocument = document.AsDynamic(); // Then ((object)dynamicDocument.Source).ShouldBe(new NormalizedPath("/a/b/c.txt")); }
public void DynamicObjectConvertsBackToDocument() { // Given IDocument document = new TestDocument { { "A", "a" }, { "B", 2 } }; // When IDocument dynamicDocument = (IDocument)document.AsDynamic(); // Then dynamicDocument.GetString("A").ShouldBe("a"); dynamicDocument["B"].ShouldBe(2); }
public void GetsDynamicObject() { // Given IDocument document = new TestDocument { { "A", "a" }, { "B", 2 } }; // When dynamic dynamicDocument = document.AsDynamic(); // Then ((object)dynamicDocument.A).ShouldBe("a"); ((object)dynamicDocument.B).ShouldBe(2); }