public void Cannot_call_HttpGetHandler_with_HttpPost_request() { try { ServiceControllerContext.AssertServiceRestrictions( new HttpGetHandler(), EndpointAttributes.External | EndpointAttributes.HttpPost | EndpointAttributes.InSecure, "name"); } catch (UnauthorizedAccessException uae) { Assert.That(uae.Message.Contains(string.Format("'{0}'", EndpointAttributes.HttpGet))); return; } Assert.Fail("UnauthorizedAccessException should've been thrown"); }
public void Internal_only_handler_cannot_be_called_externally() { try { ServiceControllerContext.AssertServiceRestrictions( new InternalOnlyHandler(), EndpointAttributes.External, "name"); } catch (UnauthorizedAccessException uae) { Assert.That(uae.Message.Contains(string.Format("'{0}'", EndpointAttributes.Internal))); return; } Assert.Fail("UnauthorizedAccessException should've been thrown"); }
public void Can_call_HttpGetHandler_with_HttpGet_request() { ServiceControllerContext.AssertServiceRestrictions( new HttpGetHandler(), EndpointAttributes.External | EndpointAttributes.HttpGet | EndpointAttributes.InSecure, "name"); }
public void Internal_only_handler_can_be_called_internally() { ServiceControllerContext.AssertServiceRestrictions( new InternalOnlyHandler(), EndpointAttributes.Internal, "name"); }