private static void VerifyModificationQueryOptions(ModificationQueryOptionsType query)
        {
            Assert.NotNull(query);

            Assert.Null(query.SearchSupported);
            Assert.Null(query.SortSupported);

            Assert.NotNull(query.ExpandSupported);
            Assert.True(query.ExpandSupported);

            Assert.NotNull(query.SelectSupported);
            Assert.True(query.SelectSupported);

            Assert.NotNull(query.ComputeSupported);
            Assert.False(query.ComputeSupported); // false

            Assert.NotNull(query.FilterSupported);
            Assert.True(query.FilterSupported);
        }
        public void InitializInsertRestrictionsTypeWithRecordSuccess()
        {
            // Assert
            IEdmRecordExpression record = new EdmRecordExpression(
                new EdmPropertyConstructor("ExpandSupported", new EdmBooleanConstant(true)),
                new EdmPropertyConstructor("SelectSupported", new EdmBooleanConstant(true)),
                new EdmPropertyConstructor("ComputeSupported", new EdmBooleanConstant(false)),
                new EdmPropertyConstructor("FilterSupported", new EdmBooleanConstant(true))
                // SearchSupported
                // SortSupported
                );

            // Act
            ModificationQueryOptionsType query = new ModificationQueryOptionsType();

            query.Initialize(record);

            // Assert
            VerifyModificationQueryOptions(query);
        }
        public void InitializeModificationQueryOptionsTypeWorksWithCsdl()
        {
            // Arrange
            string annotation = @"<Annotation Term=""Org.OData.Capabilities.V1.ModificationQueryOptions"">
                <Record>
                  <PropertyValue Property=""ExpandSupported"" Bool=""true"" />
                  <PropertyValue Property=""SelectSupported"" Bool=""true"" />
                  <PropertyValue Property=""ComputeSupported"" Bool=""false"" />
                  <PropertyValue Property=""FilterSupported"" Bool=""true"" />
                </Record>
              </Annotation>";

            IEdmModel model = GetEdmModel(annotation);

            Assert.NotNull(model); // guard
            Assert.NotNull(model.EntityContainer);

            // Act
            ModificationQueryOptionsType query = model.GetRecord <ModificationQueryOptionsType>(model.EntityContainer);

            // Assert
            VerifyModificationQueryOptions(query);
        }