Esempio n. 1
0
        public void CommonEqualityOps_AreObjectsEqualUnSafe_Objects_ReturnFalse()
        {
            string str  = default(string);
            string strB = "asd";
            var    handlerActivityIsEqual = CommonEqualityOps.AreObjectsEqualUnSafe(str, strB);

            Assert.IsFalse(handlerActivityIsEqual);
        }
Esempio n. 2
0
        public void CommonEqualityOps_AreObjectsEqualUnSafe_ReturnTrue()
        {
            var _name          = "workflowName";
            var _path          = "resourcePath";
            var _match         = "Input";
            var searchVal      = new SearchResult(Guid.NewGuid(), _name, _path, SearchItemType.WorkflowName, _match);
            var otherSearchVal = new SearchResult(Guid.NewGuid(), _name, _path, SearchItemType.WorkflowName, _match);

            var areConditionsEqual = CommonEqualityOps.AreObjectsEqualUnSafe(searchVal.Name, otherSearchVal.Name);

            Assert.IsTrue(areConditionsEqual);
        }
Esempio n. 3
0
        public bool Equals(ActivityFunc <string, bool> x, ActivityFunc <string, bool> y)
        {
            if (x == null && y == null)
            {
                return(true);
            }

            if (x == null || y == null)
            {
                return(false);
            }

            IEqualityComparer <DelegateArgument> argumentComparer = new DelegateArgumentComparer();
            var argumentsAreEqual = argumentComparer.Equals(x.Argument, y.Argument);
            var resultAreEqual    = argumentComparer.Equals(x.Result, y.Result);

            var @equals = string.Equals(x.DisplayName, y.DisplayName);
            var handlerActivityIsEqual = CommonEqualityOps.AreObjectsEqualUnSafe(x.Handler, y.Handler);


            //var handlerActivityIsEqual = x.Handler?.Equals(y.Handler) ?? true;//All activities have an implemantation of Equals at this stage :)
            return(equals && argumentsAreEqual && resultAreEqual && handlerActivityIsEqual);
        }