public void DuplicatePropertyCustomAnnotationShouldFail() { DuplicatePropertyNamesChecker duplicateChecker = new DuplicatePropertyNamesChecker(false, true); Action action = () => duplicateChecker.AddCustomPropertyAnnotation("property", "custom.name"); action.ShouldNotThrow(); action.ShouldThrow <ODataException>().WithMessage(ErrorStrings.DuplicatePropertyNamesChecker_DuplicateAnnotationForPropertyNotAllowed("custom.name", "property")); }
public void DuplicatePropertyODataAnnotationShouldFail() { DuplicatePropertyNamesChecker duplicateChecker = new DuplicatePropertyNamesChecker(false, true); Action action = () => duplicateChecker.AddODataPropertyAnnotation("property", JsonLightConstants.ODataAnnotationNamespacePrefix + "name", null); action.ShouldNotThrow(); action.ShouldThrow <ODataException>().WithMessage(ErrorStrings.DuplicatePropertyNamesChecker_DuplicateAnnotationForPropertyNotAllowed(JsonLightConstants.ODataAnnotationNamespacePrefix + "name", "property")); }