public void Test1()
        {
            ConfigurationStorageImp ss = new ConfigurationStorageImp();
            List<TaskStatus> l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.AllTasks);
            Console.WriteLine("[] All Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0) Console.WriteLine("Test Not Found !!");
            Console.WriteLine(" - PASSED -");
            Console.WriteLine("=============================================================");
            //checking active tasks
            l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.ActiveTasks);
            Console.WriteLine("[] Active Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0) Console.WriteLine("Test Not Found !!");
            Console.WriteLine(" - PASSED -");
            Console.WriteLine("=============================================================");
            //checking waiting tasks
            l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.WaitingTasks);
            Console.WriteLine("[] Waiting Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0) Console.WriteLine("Test Not Found !!");
            Console.WriteLine(" - PASSED -");
            Console.WriteLine("=============================================================");

            l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.IdleTasks);
            Console.WriteLine("[] Idle Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0) Console.WriteLine("Test Not Found !!");
            Console.WriteLine(" - PASSED -");
        }
        //Testing if all the methods works when data hasn't been found.
        public void Test5()
        {
            //testing the method:getWorkDetails
            ConfigurationStorageImp ss = new ConfigurationStorageImp();

            Console.WriteLine("[] Trying to get detailts of a user that does not exist");
            List <TaskStatus> l = ss.getWorkDetails("a7b717e0-4fad-3593-a621-026b6f05713d", QueryOption.IdleTasks);

            Console.WriteLine("[] Idle Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0)
            {
                Console.WriteLine("Test Not Found !!");
            }
            Console.WriteLine(" - PASSED -");

            //testing the releaseWorkResources method
            Console.WriteLine("[] Trying to remove task that does not exist...");

            ss = new ConfigurationStorageImp();
            ss.releaseWorkResources("e4a55914-0827-4d70-be22-d2ecac77cdfa");
            Console.WriteLine(" - PASSED -");
        }
Esempio n. 3
0
 /**
  * returns the task status which suits the query
  */
 public List <TaskStatus> getWorkDetails(String userID, QueryOption option)
 {
     return(_configurationStorageImp.getWorkDetails(userID, option));
 }
        public void Test1()
        {
            ConfigurationStorageImp ss = new ConfigurationStorageImp();
            List <TaskStatus>       l  = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.AllTasks);

            Console.WriteLine("[] All Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0)
            {
                Console.WriteLine("Test Not Found !!");
            }
            Console.WriteLine(" - PASSED -");
            Console.WriteLine("=============================================================");
            //checking active tasks
            l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.ActiveTasks);
            Console.WriteLine("[] Active Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0)
            {
                Console.WriteLine("Test Not Found !!");
            }
            Console.WriteLine(" - PASSED -");
            Console.WriteLine("=============================================================");
            //checking waiting tasks
            l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.WaitingTasks);
            Console.WriteLine("[] Waiting Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0)
            {
                Console.WriteLine("Test Not Found !!");
            }
            Console.WriteLine(" - PASSED -");
            Console.WriteLine("=============================================================");

            l = ss.getWorkDetails("a7b717e0-4fad-4293-a621-026b6f05713d", QueryOption.IdleTasks);
            Console.WriteLine("[] Idle Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0)
            {
                Console.WriteLine("Test Not Found !!");
            }
            Console.WriteLine(" - PASSED -");
        }
        //Testing if all the methods works when data hasn't been found.
        public void Test5()
        {
            //testing the method:getWorkDetails
            ConfigurationStorageImp ss = new ConfigurationStorageImp();
            Console.WriteLine("[] Trying to get detailts of a user that does not exist");
            List <TaskStatus> l = ss.getWorkDetails("a7b717e0-4fad-3593-a621-026b6f05713d", QueryOption.IdleTasks);
            Console.WriteLine("[] Idle Tasks saved for the specified user ...");
            foreach (TaskStatus task in l)
            {
                Console.WriteLine("TaskId          : " + task.getTaskID());
                Console.WriteLine("TaskName        : " + task.getTaskName());
                Console.WriteLine("TaskStatus      : " + task.getTaskStatus());
                Console.WriteLine("TaskElapsedTime : " + task.getTaskElapsedTime());
                Console.WriteLine("=============================================================");
            }
            if (l.Count == 0) Console.WriteLine("Test Not Found !!");
            Console.WriteLine(" - PASSED -");

            //testing the releaseWorkResources method
            Console.WriteLine("[] Trying to remove task that does not exist...");

            ss = new ConfigurationStorageImp();
            ss.releaseWorkResources("e4a55914-0827-4d70-be22-d2ecac77cdfa");
            Console.WriteLine(" - PASSED -");
        }