示例#1
0
        public void FilterCriteria_Same_Object_Is_Not_Equal_CaseSensitive()
        {
            //---------------Set up test pack-------------------
            var uniqueId     = Guid.NewGuid().ToString();
            var itemActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId,

                FilterCriteria = new List <SharepointSearchTo>()
                {
                    new SharepointSearchTo("A", "a", "", 1)
                },
            };
            var createListItemActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId,

                FilterCriteria = new List <SharepointSearchTo>()
                {
                    new SharepointSearchTo("A", "A", "", 1)
                },
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(itemActivity);
            //---------------Execute Test ----------------------
            var equals = itemActivity.Equals(createListItemActivity);

            //---------------Test Result -----------------------
            Assert.IsFalse(@equals);
        }
示例#2
0
        public void FilterCriteria_Same_DifferentIndexNumbers_Object_Is_Not_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId = Guid.NewGuid().ToString();
            var activity = new SharepointUpdateListItemActivity()
            {
                UniqueID       = uniqueId,
                FilterCriteria = new List <SharepointSearchTo>()
                {
                    new SharepointSearchTo("a", "a", "a", 1),
                    new SharepointSearchTo("B", "B", "", 2)
                }
            };
            var listItemActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID       = uniqueId,
                FilterCriteria = new List <SharepointSearchTo>()
                {
                    new SharepointSearchTo("B", "B", "", 1),
                    new SharepointSearchTo("a", "a", "a", 2)
                }
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(activity);
            //---------------Execute Test ----------------------
            var @equals = activity.Equals(listItemActivity);

            //---------------Test Result -----------------------
            Assert.IsFalse(@equals);
        }
示例#3
0
        public void ReadListItems_Same_Object_IsEqual_CaseSensitive()
        {
            //---------------Set up test pack-------------------
            var uniqueId = Guid.NewGuid().ToString();
            var SharepointUpdateListItemActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID      = uniqueId,
                ReadListItems = new List <SharepointReadListTo>()
                {
                    new SharepointReadListTo("a", "a", "a", "a")
                }
            };
            var listItemActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID      = uniqueId,
                ReadListItems = new List <SharepointReadListTo>()
                {
                    new SharepointReadListTo("a", "a", "a", "a")
                }
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(SharepointUpdateListItemActivity);
            //---------------Execute Test ----------------------
            var @equals = SharepointUpdateListItemActivity.Equals(listItemActivity);

            //---------------Test Result -----------------------
            Assert.IsTrue(@equals);
        }
示例#4
0
        public void FilterCriteria_Same_Object_Is_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId           = Guid.NewGuid().ToString();
            var sharepointActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID      = uniqueId,
                ReadListItems = new List <SharepointReadListTo>()
            };
            var sharepoint = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId
                ,
                ReadListItems = new List <SharepointReadListTo>()
                ,
                FilterCriteria = new List <SharepointSearchTo>()
                {
                }
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(sharepointActivity);
            //---------------Execute Test ----------------------
            var @equals = sharepointActivity.Equals(sharepoint);

            //---------------Test Result -----------------------
            Assert.IsTrue(@equals);
        }
示例#5
0
        public void RequireAllCriteriaToMatch_Same_Object_Is_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId = Guid.NewGuid().ToString();
            var sharepointCopyFileActivity = new SharepointUpdateListItemActivity {
                UniqueID = uniqueId, RequireAllCriteriaToMatch = true
            };
            var sharepoint = new SharepointUpdateListItemActivity {
                UniqueID = uniqueId, RequireAllCriteriaToMatch = true
            };

            //---------------Assert Precondition----------------
            Assert.IsTrue(sharepointCopyFileActivity.Equals(sharepoint));
            //---------------Execute Test ----------------------
            sharepointCopyFileActivity.RequireAllCriteriaToMatch = true;
            sharepoint.RequireAllCriteriaToMatch = true;
            var @equals = sharepointCopyFileActivity.Equals(sharepoint);

            //---------------Test Result -----------------------
            Assert.IsTrue(@equals);
        }
示例#6
0
        public void RequireAllCriteriaToMatch_Different_Object_Is_Not_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId = Guid.NewGuid().ToString();
            var activity = new SharepointUpdateListItemActivity {
                UniqueID = uniqueId, RequireAllCriteriaToMatch = true
            };
            var activity1 = new SharepointUpdateListItemActivity {
                UniqueID = uniqueId, RequireAllCriteriaToMatch = true
            };

            //---------------Assert Precondition----------------
            Assert.IsTrue(activity.Equals(activity1));
            //---------------Execute Test ----------------------
            activity.RequireAllCriteriaToMatch  = true;
            activity1.RequireAllCriteriaToMatch = false;
            var @equals = activity.Equals(activity1);

            //---------------Test Result -----------------------
            Assert.IsFalse(@equals);
        }
示例#7
0
        public void UniqueIDDifferent_EmptySharepoint_Object_Is_Not_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId  = Guid.NewGuid().ToString();
            var activity1 = new SharepointUpdateListItemActivity();
            var selectAndApplyActivity = new SharepointUpdateListItemActivity();

            //---------------Assert Precondition----------------
            Assert.IsNotNull(activity1);
            //---------------Execute Test ----------------------
            var @equals = activity1.Equals(selectAndApplyActivity);

            //---------------Test Result -----------------------
            Assert.IsFalse(@equals);
        }
示例#8
0
        public void Equals_Given_Same_Object_IsEqual()
        {
            //---------------Set up test pack-------------------
            var uniqueId  = Guid.NewGuid().ToString();
            var activity1 = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, DisplayName = "a"
            };
            var selectAndApplyActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, DisplayName = "a"
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(activity1);
            //---------------Execute Test ----------------------
            var @equals = activity1.Equals(selectAndApplyActivity);

            //---------------Test Result -----------------------
            Assert.IsTrue(@equals);
        }
示例#9
0
        public void SharepointServerResourceId_Different_Object_Is_Not_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId           = Guid.NewGuid().ToString();
            var sharepointActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, SharepointServerResourceId = Guid.NewGuid()
            };
            var sharepoint = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, SharepointServerResourceId = Guid.NewGuid()
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(sharepointActivity);
            //---------------Execute Test ----------------------
            var @equals = sharepointActivity.Equals(sharepoint);

            //---------------Test Result -----------------------
            Assert.IsFalse(@equals);
        }
示例#10
0
        public void SharepointList_Different_Object_Is_Not_Equal_CaseSensitive()
        {
            //---------------Set up test pack-------------------
            var uniqueId = Guid.NewGuid().ToString();
            var activity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, SharepointList = "AAA"
            };
            var activity1 = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, SharepointList = "aaa"
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(activity);
            //---------------Execute Test ----------------------
            var @equals = activity.Equals(activity1);

            //---------------Test Result -----------------------
            Assert.IsFalse(@equals);
        }
示例#11
0
        public void SharepointList_Same_Object_IsEqual()
        {
            //---------------Set up test pack-------------------
            var uniqueId     = Guid.NewGuid().ToString();
            var itemActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, SharepointList = "a"
            };
            var activity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId, SharepointList = "a"
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(itemActivity);
            //---------------Execute Test ----------------------
            var @equals = itemActivity.Equals(activity);

            //---------------Test Result -----------------------
            Assert.IsTrue(@equals);
        }
示例#12
0
        public void UniqueIDEquals_EmptySharepoint_Object_Is_Equal()
        {
            //---------------Set up test pack-------------------
            var uniqueId           = Guid.NewGuid().ToString();
            var sharepointActivity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId
            };
            var activity = new SharepointUpdateListItemActivity()
            {
                UniqueID = uniqueId
            };

            //---------------Assert Precondition----------------
            Assert.IsNotNull(sharepointActivity);
            //---------------Execute Test ----------------------
            var equals = sharepointActivity.Equals(activity);

            //---------------Test Result -----------------------
            Assert.IsTrue(@equals);
        }