Пример #1
0
        public void ServerScenario_HasDefinition()
        {
            this.SetupModels();

            const string applicationCsdl =
                @"<Schema Namespace=""foo"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
    <Annotations Target=""foo.Person"">
        <Annotation Term=""bar.MoreTransformedPersonTerm"">
            <Record>
                <PropertyValue Property=""Description"" String=""I know it!"" />
            </Record>
        </Annotation>
    </Annotations>
</Schema>";
            IEdmModel applicationModel = this.Parse(applicationCsdl, this.baseModel, this.vocabularyDefinitionModel);

            IEdmModel combinedModel = new CombiningModel(this.baseModel, applicationModel);

            IEnumerable <string> actualCsdls = this.GetSerializerResult(combinedModel);

            const string usingCsdl     = @"
<Schema Namespace=""foo"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
</Schema>";
            var          expectedCsdls = CsdlCombiner.GetCombinedCsdls(new[] { applicationCsdl, baseModelCsdl, usingCsdl });

            this.CompareCsdls(expectedCsdls, actualCsdls);
        }
Пример #2
0
        public void ServerScenario_HasDefinition()
        {
            this.SetupModels();

            const string applicationCsdl =
@"<Schema Namespace=""foo"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
    <Annotations Target=""foo.Person"">
        <Annotation Term=""bar.MoreTransformedPersonTerm"">
            <Record>
                <PropertyValue Property=""Description"" String=""I know it!"" />
            </Record>
        </Annotation>
    </Annotations>
</Schema>";
            IEdmModel applicationModel = this.Parse(applicationCsdl, this.baseModel, this.vocabularyDefinitionModel);

            IEdmModel combinedModel = new CombiningModel(this.baseModel, applicationModel);

            IEnumerable<string> actualCsdls = this.GetSerializerResult(combinedModel);

            const string usingCsdl = @"
<Schema Namespace=""foo"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
</Schema>";
            var expectedCsdls = CsdlCombiner.GetCombinedCsdls(new[] { applicationCsdl, baseModelCsdl, usingCsdl });
            this.CompareCsdls(expectedCsdls, actualCsdls);
        }