Exemple #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);
        }
Exemple #2
0
        public void TestScheduleItemStatus()
        {
            DateTime start = DateTime.Now;
            HermesScheduleItemStatus item = CreateScheduleItemStatus();

            for (int i = 1; i <= ITERATION; i++)
            {
                item.LastModifiedBy = "test" + i;
                provider.SaveScheduleItemStatus(item);
                HermesScheduleItemStatus result = provider.GetScheduleItemStatus(item.Id);
                Assert.AreEqual(item.LastModifiedBy, result.LastModifiedBy);
                provider.DeleteScheduleItemStatus(item.Id);
                Assert.IsNull(provider.GetScheduleItemStatus(item.Id));
            }
            Console.WriteLine("ScheduleItemStatus run {0} times, taking {1}ms.", ITERATION,
                              (DateTime.Now - start).TotalMilliseconds.ToString("n"));
        }
Exemple #3
0
 public void TestSaveScheduleItemStatus_InvalidConnection()
 {
     invalidProvider.SaveScheduleItemStatus(CreateItemStatus());
 }
Exemple #4
0
 public void TestSaveScheduleItemStatus_ScheduleItemStatusIsNull()
 {
     provider.SaveScheduleItemStatus(null);
 }
Exemple #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);
        }