public void Ctor_InitializesProperty_EdmType()
        {
            IEdmStructuredTypeReference edmType = new Mock<IEdmStructuredTypeReference>().Object;

            EdmStructuredObject edmObject = new EdmStructuredObject(42, edmType);

            Assert.Same(edmType, edmObject.EdmType);
        }
        public void TryGetValue_ReturnsFalse_IfInstanceIsNull()
        {
            IEdmStructuredTypeReference edmType = new Mock<IEdmStructuredTypeReference>().Object;
            EdmStructuredObject edmObject = new EdmStructuredObject(instance: null, edmType: edmType);
            object value;

            Assert.False(edmObject.TryGetValue("property", out value));
            Assert.Null(value);
        }
        public void GetEdmType_Returns_InitializedEdmType()
        {
            IEdmStructuredTypeReference edmType = new Mock<IEdmStructuredTypeReference>().Object;
            EdmStructuredObject edmObject = new EdmStructuredObject(42, edmType);

            IEdmTypeReference result = edmObject.GetEdmType();

            Assert.Same(edmType, edmObject.EdmType);
        }
        public void Ctor_InitializesProperty_Instance()
        {
            object instance = new object();
            IEdmStructuredTypeReference edmType = new Mock<IEdmStructuredTypeReference>().Object;

            EdmStructuredObject edmObject = new EdmStructuredObject(instance, edmType);

            Assert.Same(instance, edmObject.Instance);
        }
        public void TryGetValue_ReturnsFalse_IfPropertyIsNotPresent()
        {
            TestEntity instance = new TestEntity { Property = new object() };
            IEdmStructuredTypeReference edmType = new Mock<IEdmStructuredTypeReference>().Object;
            EdmStructuredObject edmObject = new EdmStructuredObject(instance, edmType);
            object value;

            Assert.False(edmObject.TryGetValue("NotPresentProperty", out value));
            Assert.Null(value);
        }