public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is SearchCatalogObjectsRequest other &&
                   ((Cursor == null && other.Cursor == null) || (Cursor?.Equals(other.Cursor) == true)) &&
                   ((ObjectTypes == null && other.ObjectTypes == null) || (ObjectTypes?.Equals(other.ObjectTypes) == true)) &&
                   ((IncludeDeletedObjects == null && other.IncludeDeletedObjects == null) || (IncludeDeletedObjects?.Equals(other.IncludeDeletedObjects) == true)) &&
                   ((IncludeRelatedObjects == null && other.IncludeRelatedObjects == null) || (IncludeRelatedObjects?.Equals(other.IncludeRelatedObjects) == true)) &&
                   ((BeginTime == null && other.BeginTime == null) || (BeginTime?.Equals(other.BeginTime) == true)) &&
                   ((Query == null && other.Query == null) || (Query?.Equals(other.Query) == true)) &&
                   ((Limit == null && other.Limit == null) || (Limit?.Equals(other.Limit) == true)));
        }
Ejemplo n.º 2
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        internal void TS_GetRandomValue(out object obj, object CurrentType, ObjectTypes dataType, bool SameType, bool MustBeDifferentValue, CheckType checkType)
        {
            ObjectTypes newObjectType = dataType;

            // If we pass in unknown, determine the correct data type
            if (dataType.Equals(ObjectTypes.Unknown))
            {
                dataType = this.Get_ObjectTypes(CurrentType);
                if (dataType.Equals(ObjectTypes.IPAddress))
                    ThrowMe(CheckType.IncorrectElementConfiguration, "Don't know how to get a random IPAddress");
            }

            // Get a new type if SameType == false
            if (!SameType)
            {
                do
                {
					newObjectType = (ObjectTypes)(int)Helpers.RandomValue(0, (int)ObjectTypes.Last);
                } while (newObjectType.Equals(ObjectTypes.Last) || newObjectType.Equals(ObjectTypes.IPAddress) || newObjectType.Equals(newObjectType));

                dataType = newObjectType;
            }

            // Try 10 times to find the random value
            int TryCount = 0;

            do
            {
                if (TryCount > 10)
                    ThrowMe(checkType, "Could not determine a random value different from the current value in 10 tries");

				obj = Helpers.GetRandomValidValue(m_le, null);
            } while (MustBeDifferentValue.Equals(true) && obj.Equals(CurrentType));

            Comment("Returning random value of (" + obj.GetType() + ")" + obj);
            m_TestStep++;
        }