Beispiel #1
0
        public void UpdateTaskAttributes_TwoTaskTypesMatchAll_OneNewValue()
        {
            SaveTask(CreateTasksWithOneAttribute());
            SaveTask(CreateTasksWithTwoAttributes());
            SaveTask(CreateTasksWithThreeAttributes());

            IDictionary <string, string> searchAttributes = new Dictionary <string, string>
            {
                { "key1", "value1" }
            };
            IDictionary <string, string> replaceAttributes = new Dictionary <string, string>
            {
                { "key1", "modifiedvalue1" }
            };

            Svc.UpdateTaskAttributes(new[] { "taskType/", "/PensioB/Sempera/Affiliation/ManualCapitalAcquiredVerificationNeeded/" }, searchAttributes, replaceAttributes);

            CheckAttributeOccurrences("key1", "value1", 0);
            CheckAttributeOccurrences("key2", "value2", 2);
            CheckAttributeOccurrences("key3", "value3", 1);
            CheckAttributeOccurrences("key1", "modifiedvalue1", 3);

            FindTasksResult findTasksResult = Svc.FindTasks("taskType/", replaceAttributes, null);

            Assert.IsNotNull(findTasksResult);
            Assert.AreEqual(2, findTasksResult.NumberOfMatchingTasks);
        }
Beispiel #2
0
        public void UpdateTaskAttributes_OneTaskTypesMatchesTwo_OneNewValue()
        {
            SaveTask(CreateTasksWithOneAttribute());
            SaveTask(CreateTasksWithTwoAttributes());
            SaveTask(CreateTasksWithThreeAttributes());

            IDictionary <string, string> searchAttributes = new Dictionary <string, string>
            {
                { "key1", "value1" }
            };
            IDictionary <string, string> replaceAttributes = new Dictionary <string, string>
            {
                { "key1", "modifiedvalue1" }
            };

            Svc.UpdateTaskAttributes(new string[1] {
                "taskType/"
            }, searchAttributes, replaceAttributes);

            CheckAttributeOccurrences("key1", "value1", 1);
            CheckAttributeOccurrences("key2", "value2", 2);
            CheckAttributeOccurrences("key3", "value3", 1);
            CheckAttributeOccurrences("key1", "modifiedvalue1", 2);

            FindTasksResult findTasksResult = Svc.FindTasks("taskType/", replaceAttributes, null);

            Assert.IsNotNull(findTasksResult);
            Assert.AreEqual(2, findTasksResult.NumberOfMatchingTasks);
        }
Beispiel #3
0
        public void UpdateTaskAttributes_ThreeCorrectAttributes_OneMatchingReplaceAttribute()
        {
            CreateSomeTasksForSearching();
            IDictionary <string, string> searchAttributes = new Dictionary <string, string>
            {
                { "TypeName", "/PensioB/Sempera/Affiliation" },
                { "RetirementPlanName", "construo" },
                { "AffiliationID", "285" },
            };
            IDictionary <string, string> replaceAttributes = new Dictionary <string, string>
            {
                { "RetirementPlanName", "construo-test" },
            };
            IDictionary <string, string> newSearchAttributes = new Dictionary <string, string>
            {
                { "TypeName", "/PensioB/Sempera/Affiliation" },
                { "RetirementPlanName", "construo-test" },
                { "AffiliationID", "285" },
            };

            Svc.UpdateTaskAttributes(new[] { @"/PensioB/Sempera/Affiliation/ManualCapitalAcquiredVerificationNeeded" }, searchAttributes, replaceAttributes);
            FindTasksResult oldFindTasksResult = Svc.FindTasks(@"/PensioB/Sempera/Affiliation/ManualCapitalAcquiredVerificationNeeded", searchAttributes, null);
            FindTasksResult newFindTasksResult = Svc.FindTasks(@"/PensioB/Sempera/Affiliation/ManualCapitalAcquiredVerificationNeeded", newSearchAttributes, null);

            Assert.IsNotNull(oldFindTasksResult);
            Assert.AreEqual(0, oldFindTasksResult.NumberOfMatchingTasks);
            Assert.IsNotNull(newFindTasksResult);
            Assert.AreEqual(1, newFindTasksResult.NumberOfMatchingTasks);
            foreach (Task task in newFindTasksResult.Tasks)
            {
                Assert.AreEqual(task.Attributes["TypeName"], "/PensioB/Sempera/Affiliation");
                Assert.AreEqual(task.Attributes["RetirementPlanName"], "construo-test");
                Assert.AreEqual(task.Attributes["AffiliationID"], "285");
            }
        }
Beispiel #4
0
        public void UpdateTaskAttributes_DiffNoOfAttributes_All_OneNewValue()
        {
            SaveTask(CreateTasksWithOneAttribute());
            SaveTask(CreateTasksWithTwoAttributes());
            SaveTask(CreateTasksWithThreeAttributes());

            IDictionary <string, string> searchAttributes = new Dictionary <string, string>
            {
                { "key1", "value1" }
            };
            IDictionary <string, string> replaceAttributes = new Dictionary <string, string>
            {
                { "key1", "modifiedvalue1" }
            };

            Svc.UpdateTaskAttributes(new string[0], searchAttributes, replaceAttributes);

            IDictionary <string, string> newSearchAttributes = new Dictionary <string, string>
            {
                { "key1", "modifiedvalue1" }
            };
            FindTasksResult oldFindTasksResult = Svc.FindTasks(string.Empty, searchAttributes, null);
            FindTasksResult newFindTasksResult = Svc.FindTasks(string.Empty, newSearchAttributes, null);

            Assert.IsNotNull(oldFindTasksResult);
            Assert.AreEqual(0, oldFindTasksResult.NumberOfMatchingTasks);
            Assert.IsNotNull(newFindTasksResult);
            Assert.AreEqual(3, newFindTasksResult.NumberOfMatchingTasks);
        }
Beispiel #5
0
        public void UpdateTaskAttributes_ZeroSearchAttributes_ThreeCorrectAttributes()
        {
            CreateSomeTasksForSearching();
            IDictionary <string, string> searchAttributes  = new Dictionary <string, string>();
            IDictionary <string, string> replaceAttributes = new Dictionary <string, string>
            {
                { "TypeName", "/PensioB/Sempera/Affiliation" },
                { "RetirementPlanName", "construo" },
                { "AffiliationID", "285" },
            };

            Svc.UpdateTaskAttributes(new[] { @"/PensioB/Sempera/Affiliation/ManualCapitalAcquiredVerificationNeeded" }, searchAttributes, replaceAttributes);
        }