Esempio n. 1
0
            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"));
            }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
            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);
            }