Ejemplo n.º 1
0
        public void SetUp()
        {
            cm.Clear(false);
            cm.LoadFile(CONF);
            cm.LoadFile("../../test_files/stress/ConnectionFactory.xml");

            string name =
                cm.GetValue("HermesNS.TC.Services.ScheduleItem.Persistence.HermesScheduleItemPersistenceProvider",
                            "connectionName");

            provider = new HermesScheduleItemPersistenceProvider(name, new HermesScheduleItemPersistenceHelper());
            group    = CreateActivityGroup();

            provider.SaveActivityGroup(group);

            activityType = CreateActivityType();
            provider.SaveActivityType(activityType);
            activity = CreateActivity();
            provider.SaveActivity(activity);

            itemStatus = CreateScheduleItemStatus();
            provider.SaveScheduleItemStatus(itemStatus);
            requestStatus = CreateScheduleItemRequestStatus();
            provider.SaveScheduleItemRequestStatus(requestStatus);
            scheduleItem = CreateScheduleItem();
            provider.SaveScheduleItem(scheduleItem);
        }
Ejemplo n.º 2
0
        public void TestScheduleItemRequestStatus()
        {
            DateTime start = DateTime.Now;
            HermesScheduleItemRequestStatus item = CreateScheduleItemRequestStatus();

            for (int i = 1; i <= ITERATION; i++)
            {
                item.LastModifiedBy = "test" + i;
                provider.SaveScheduleItemRequestStatus(item);
                provider.DeleteScheduleItemRequestStatus(item.Id);
            }
            Console.WriteLine("ScheduleItemRequestStatus run {0} times, taking {1}ms.", ITERATION,
                              (DateTime.Now - start).TotalMilliseconds.ToString("n"));
        }
Ejemplo n.º 3
0
 public void TestSaveScheduleItemRequestStatus_InvalidConnection()
 {
     invalidProvider.SaveScheduleItemRequestStatus(CreateRequestStatus());
 }
Ejemplo n.º 4
0
 public void TestSaveScheduleItemRequestStatus_ScheduleRequestStatusIsNull()
 {
     provider.SaveScheduleItemRequestStatus(null);
 }
Ejemplo n.º 5
0
        public void TestSaveScheduleItem_Accuracy()
        {
            HermesScheduleItem first = AccuracyTestsHelper.CreateHermesScheduleItem();

            instance.SaveActivityGroup(first.Activity.ActivityType.ActivityGroup);
            instance.SaveActivityType(first.Activity.ActivityType);
            instance.SaveActivity(first.Activity);
            instance.SaveScheduleItemRequestStatus(first.ScheduleItemRequestStatus);
            instance.SaveScheduleItemStatus(first.ScheduleItemStatus);
            instance.SaveScheduleItem(first);

            // Verify
            HermesScheduleItem second = instance.GetScheduleItem(first.Id);

            AccuracyTestsHelper.VerifyHermesScheduleItem(first, second);
        }