public override InputFormat GetValue(HttpContext context) { try { return(_repository.inputFormat(context.Request.MediaType)); } catch (MediaTypeNotSupportedException e) { throw new WebApplicationException(Response.status(Response.Status.UNSUPPORTED_MEDIA_TYPE).entity(e.Message).build()); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void canProvideJsonFormat() public virtual void CanProvideJsonFormat() { assertNotNull(_repository.inputFormat(MediaType.valueOf("application/json"))); }