Exemple #1
0
 public void FullMetadataLevelShouldReturnODataConventionalEntityMetadataBuilder()
 {
     testSubject.CreateEntityMetadataBuilder(
         new ODataEntry(),
         new TestFeedAndEntryTypeContext {
         UrlConvention = UrlConvention.CreateWithExplicitValue(generateKeyAsSegment: false)
     }, new ODataFeedAndEntrySerializationInfo(), /*actualEntityType*/ null,
         SelectedPropertiesNode.EntireSubtree,
         /*isResponse*/ true,
         /*keyAsSegment*/ false,
         /*requestUri*/ null).Should().BeAssignableTo <ODataConventionalEntityMetadataBuilder>();
 }
Exemple #2
0
        public void FullMetadataLevelCreateMetadataBuilderWithoutMetadataDocumentUriShouldThrow()
        {
            var metadataLevelWithoutMetadataDocumentUri = new JsonFullMetadataLevel(/*metadataDocumentUri*/ null, Model);

            Action test = () => metadataLevelWithoutMetadataDocumentUri
                          .CreateEntityMetadataBuilder(
                new ODataEntry(),
                new TestFeedAndEntryTypeContext(),
                new ODataFeedAndEntrySerializationInfo(),
                /*actualEntityType*/ null,
                SelectedPropertiesNode.EntireSubtree,
                /*isResponse*/ true,
                /*keyAsSegment*/ false,
                /*requestUri*/ null);

            test.ShouldThrow <ODataException>().WithMessage(ODataErrorStrings.ODataOutputContext_MetadataDocumentUriMissing);
        }