Exemplo n.º 1
0
        public void AuthorizationRequestHelper_GetAuthorizationRequest_IHubIncomingInvokerContext_RequestTypeIsParsedCorrectly()
        {
            Verify_RequestType(() =>
            {
                var context = AuthorizeHubAttributeTests.CreateHubIncomingInvokerContext(true, "xxx");
                return(context.GetAuthorizationRequest());
            }, WebServerRequestType.Unknown);


            var hubs = new[]
            {
                new Tuple <Type, string>(typeof(EsbHub), "esb"),
                new Tuple <Type, string>(typeof(ResourcesHub), "resources")
            };

            foreach (var hub in hubs)
            {
                Tuple <Type, string> hub1 = hub;
                Func <string, AuthorizationRequest> getAuthorizationRequest = methodName =>
                {
                    var context = AuthorizeHubAttributeTests.CreateHubIncomingInvokerContext(true, methodName, hub1.Item2);
                    return(context.GetAuthorizationRequest());
                };
                Verify_RequestTypeIsParsedCorrectly(hub1.Item1, hub1.Item2, getAuthorizationRequest);
            }
        }
Exemplo n.º 2
0
 public void AuthorizationRequestHelper_GetAuthorizationRequest_HubDescriptor_RequestTypeIsParsedCorrectly()
 {
     Verify_RequestType(() =>
     {
         var request = AuthorizeHubAttributeTests.CreateRequest(false);
         return(new HubDescriptor().GetAuthorizationRequest(request.Object));
     }, WebServerRequestType.HubConnect);
 }