Esempio n. 1
0
 public RoundTripTableItem(Random rndGen)
 {
     this.String1      = Util.CreateSimpleRandomString(rndGen, 5);
     this.Date1        = new DateTime(rndGen.Next(1980, 2000), rndGen.Next(1, 12), rndGen.Next(1, 25), rndGen.Next(0, 24), rndGen.Next(0, 60), rndGen.Next(0, 60), DateTimeKind.Utc);
     this.Bool1        = rndGen.Next(2) == 0;
     this.Double1      = rndGen.Next(10000) * rndGen.NextDouble();
     this.EnumType     = (Types.EnumType)rndGen.Next(3);
     this.Int1         = rndGen.Next();
     this.Long1        = rndGen.Next();
     this.ComplexType1 = new ComplexType[] { new ComplexType(rndGen) };
     this.ComplexType2 = new ComplexType2(rndGen);
 }
Esempio n. 2
0
 public override string ToString()
 {
     return(string.Format(CultureInfo.InvariantCulture,
                          "RoundTripTableItem[Bool1={0},ComplexType1={1},ComplexType2={2},Date1={3},Double1={4},EnumType={5},Int1={6},Long1={7},String1={8}]",
                          Bool1.HasValue ? Bool1.Value.ToString() : "<<NULL>>",
                          Util.ArrayToString(ComplexType1),
                          ComplexType2 == null ? "<<NULL>>" : ComplexType2.ToString(),
                          Date1.HasValue ? Date1.Value.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fff") : "<<NULL>>",
                          Double1,
                          EnumType,
                          Int1.HasValue ? Int1.Value.ToString(CultureInfo.InvariantCulture) : "<<NULL>>",
                          Long1,
                          String1));
 }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            ComplexType2 other = obj as ComplexType2;

            if (other == null)
            {
                return(false);
            }
            if (this.Age != other.Age)
            {
                return(false);
            }
            if (this.Name != other.Name)
            {
                return(false);
            }
            if (!Util.CompareArrays(this.Friends, other.Friends))
            {
                return(false);
            }
            return(true);
        }