Esempio n. 1
0
        public void InitializeDeepInsertSupportTypeWorksWithCsdl()
        {
            // Arrange
            string annotation = @"
                <Annotation Term=""Org.OData.Capabilities.V1.DeepInsertSupport"" >
                  <Record>
                    <PropertyValue Property=""Supported"" Bool=""false"" />
                    <PropertyValue Property=""ContentIDSupported"" Bool=""true"" />
                  </Record>
                </Annotation>";

            IEdmModel model = CapabilitiesModelHelper.GetEdmModelSetInline(annotation);

            Assert.NotNull(model); // guard

            IEdmEntitySet calendars = model.EntityContainer.FindEntitySet("Calendars");

            Assert.NotNull(calendars); // guard

            // Act
            DeepInsertSupportType deepInsert = model.GetRecord <DeepInsertSupportType>(calendars);

            // Assert
            VerifyDeepInsertSupportType(deepInsert);
        }
Esempio n. 2
0
        private static void VerifyDeepInsertSupportType(DeepInsertSupportType deepInsert)
        {
            Assert.NotNull(deepInsert);

            Assert.NotNull(deepInsert.Supported);
            Assert.False(deepInsert.Supported.Value);

            Assert.NotNull(deepInsert.ContentIDSupported);
            Assert.True(deepInsert.ContentIDSupported.Value);
        }
Esempio n. 3
0
        public void InitializeDeepInsertSupportTypeWithRecordSuccess()
        {
            // Assert
            IEdmRecordExpression record = new EdmRecordExpression(
                new EdmPropertyConstructor("Supported", new EdmBooleanConstant(false)),
                new EdmPropertyConstructor("ContentIDSupported", new EdmBooleanConstant(true)));

            // Act
            DeepInsertSupportType deepInsert = new DeepInsertSupportType();

            deepInsert.Initialize(record);

            // Assert
            VerifyDeepInsertSupportType(deepInsert);
        }