예제 #1
0
            public void ShouldConvertToRel()
            {
                object obj = new Relationship(1, -2, -3, "Type",
                                              new Dictionary <string, object> {
                    { "key1", "value1" }, { "key2", 2 }
                });

                var actual = obj.As <IRelationship>();

                actual.Id.Should().Be(1);
                actual.Type.Should().Be("Type");
                actual.Properties["key1"].As <string>().Should().Be("value1");
                actual.Properties["key2"].As <string>().Should().Be("2");

                obj.As <string>().Should().Be($"{obj.GetType()}");
            }