Exemple #1
0
            public bool Compare(RandomClass1 other, bool verbose)
            {
                var result = ThisIsaField == other.ThisIsaField;

                result &= AndThisIsAProperty == other.AndThisIsAProperty;
                result &= AString == other.AString;
                result &= AndALargeNumber == other.AndALargeNumber;
                result &= Array != null && other.Array != null;

                if (null != Array && null != other.Array)
                {
                    for (var i = 0; i < Array.Length && i < other.Array.Length; ++i)
                    {
                        result &= Array[i] == other.Array[i];
                    }
                }
                if (verbose)
                {
                    Console.WriteLine("ThisIsAField:");
                    Console.WriteLine("Me: {0}, Them: {1}", ThisIsaField, other.ThisIsaField);
                    Console.WriteLine("AndThisIsAProperty:");
                    Console.WriteLine("Me: {0}, Them: {1}", AndThisIsAProperty, other.AndThisIsAProperty);
                    Console.WriteLine("AString:");
                    Console.WriteLine("Me: {0}, Them: {1}", AString, other.AString);
                    Console.WriteLine("AndALargeNumber:");
                    Console.WriteLine("Me: {0}, Them: {1}", AndALargeNumber, other.AndALargeNumber);
                    Console.WriteLine("Array:");
                    Console.WriteLine("Me: {0}, Them: {1}", Array.CombineToString(), other.Array.CombineToString());
                }
                return(result);
            }
Exemple #2
0
 private static IEnumerable <RandomClass1> CreateSomething(long count)
 {
     while (count-- > 0)
     {
         yield return(RandomClass1.MakeRandom());
     }
 }