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())); } } }
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); }