public void DynamicDictionaryProperty_Works_ToSetOpenComplexType() { // Arrange ODataModelBuilder builder = new ODataModelBuilder(); // Act ComplexTypeConfiguration<SimpleOpenComplexType> complexType = builder.ComplexType<SimpleOpenComplexType>(); complexType.Property(c => c.IntProperty); complexType.HasDynamicProperties(c => c.DynamicProperties); // Act & Assert Assert.True(complexType.IsOpen); }
public void GetEdmModel_WorksOnModelBuilder_ForOpenComplexType() { // Arrange ODataModelBuilder builder = new ODataModelBuilder(); ComplexTypeConfiguration<SimpleOpenComplexType> complex = builder.ComplexType<SimpleOpenComplexType>(); complex.Property(c => c.IntProperty); complex.HasDynamicProperties(c => c.DynamicProperties); // Act IEdmModel model = builder.GetEdmModel(); // Assert Assert.NotNull(model); IEdmComplexType complexType = Assert.Single(model.SchemaElements.OfType<IEdmComplexType>()); Assert.True(complexType.IsOpen); IEdmProperty edmProperty = Assert.Single(complexType.Properties()); Assert.Equal("IntProperty", edmProperty.Name); }