コード例 #1
0
 public void ParseNullPropertyContextUriShouldThrowForPayloadKindsExceptPropertyAndUnsupported()
 {
     foreach (ODataPayloadKind payloadKind in Enum.GetValues(typeof(ODataPayloadKind)))
     {
         if (payloadKind != ODataPayloadKind.Property && payloadKind != ODataPayloadKind.Unsupported)
         {
             Action parseContextUri = () => ODataJsonLightContextUriParser.Parse(new EdmModel(), ContextUriForNullProperty, payloadKind, ODataReaderBehavior.DefaultBehavior, true);
             parseContextUri.ShouldThrow <ODataException>().WithMessage(ErrorStrings.ODataJsonLightContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind(ContextUriForNullProperty, payloadKind.ToString()));
         }
     }
 }
コード例 #2
0
        private void RunTest(ContextUriParserTestCase testCase)
        {
            this.Assert.ExpectedException(
                () =>
            {
                ODataJsonLightContextUriParseResult parseResult = ODataJsonLightContextUriParser.Parse(
                    testCase.Model ?? this.testModel,
                    testCase.ContextUri,
                    testCase.PayloadKind,
                    null,
                    true);

                this.CompareContextUriParseResults(testCase.ExpectedResult, parseResult, testCase.ResourcePath);
            },
                testCase.ExpectedException,
                this.ExceptionVerifier);
        }