예제 #1
0
        public static List <RequestData> logRandomRequestData(this ActivityTracking activityTracking, int count, bool createLargeRequest)
        {
            var requestsLogged = new List <RequestData>();

            for (var i = 0; i < count; i++)
            {
                var requestData = activityTracking.randomRequestData(createLargeRequest);
                requestsLogged.Add(activityTracking.LogRequest(requestData));
            }
            return(requestsLogged);
        }
예제 #2
0
        public static RequestData randomRequestData(this ActivityTracking activityTracking, bool createLargeRequest)
        {
            var requestData = new RequestData()
            {
                Url       = "/{0}.asmx/{1}".format(10.randomLetters(), 10.randomLetters()),
                Date      = DateTime.Now,
                SessionID = Guid.NewGuid(),
                UserName  = 10.randomLetters(),
                PostData  = (createLargeRequest)
                                                                                                                ? "{{ {0} : '{1}' + '{2}' }}".format(50.randomLetters(), 500.randomLetters(), 5000.randomLetters())
                                                                                                                : "{{ {0} : '{1}'  }}".format(5.randomLetters(), 30.randomLetters())
            };

            return(requestData);
        }
예제 #3
0
        private Guid _sessionID; // for unit tests

        #endregion Fields

        #region Constructors

        public TM_WebServices()
        {
            UnityInjection.resolve(this);
            try
            {
                javascriptProxy.adminSessionID = sessionID;
            }
            catch(Exception ex)	// this will happen on the unit tests
            {
                "TM_WebServices.ctor: {0}".error(ex.Message);
            }
            if (sessionID!= Guid.Empty)
                new UserRoleBaseSecurity().MapRolesBasedOnSessionGuid(sessionID);

            if (GetCurrentUserRoles().size()==0)
                if (TMConfig.Current.ShowContentToAnonymousUsers)
                    UserGroup.Reader.setThreadPrincipalWithRoles();
                else
                    UserGroup.Anonymous.setThreadPrincipalWithRoles();

            activityTracking = new ActivityTracking();
            activityTracking.LogRequest();
        }
예제 #4
0
 public static List <RequestData> logRandomRequestData(this ActivityTracking activityTracking, int count)
 {
     return(activityTracking.logRandomRequestData(count, false));
 }
예제 #5
0
 public static RequestData logRandomRequestData(this ActivityTracking activityTracking)
 {
     return(activityTracking.logRandomRequestData(1)[0]);
 }
예제 #6
0
 // Random data
 public static RequestData randomRequestData(this ActivityTracking activityTracking)
 {
     return(activityTracking.randomRequestData(false));
 }
예제 #7
0
 public static ActivityTracking clearPastRequestsObject(this ActivityTracking activityTracking)
 {
     activityTracking.PastRequests.Clear();
     return(activityTracking);
 }