public void TestFixtureSetup() { this.LoadTestConfiguration(); string tableName = this.GenerateRandomTableName(); this.SetupRTableEnv(tableName); // Initialize the table to be queried to the tail replica CloudTableClient tableClient = this.repTable.GetTailTableClient(); this.currentTable = tableClient.GetTableReference(repTable.TableName); // Setup TableBatchOperation batch = new TableBatchOperation(); string pk = Guid.NewGuid().ToString(); for (int m = 0; m < BatchSize; m++) { ComplexEntity complexEntity = new ComplexEntity(pk, string.Format("{0:0000}", m)); complexEntity.String = string.Format("{0:0000}", m); complexEntity.Binary = new byte[] { 0x01, 0x02, (byte)m }; complexEntity.BinaryPrimitive = new byte[] { 0x01, 0x02, (byte)m }; complexEntity.Bool = m % 2 == 0 ? true : false; complexEntity.BoolPrimitive = m % 2 == 0 ? true : false; complexEntity.Double = m + ((double)m / 100); complexEntity.DoublePrimitive = m + ((double)m / 100); complexEntity.Int32 = m; complexEntity.IntegerPrimitive = m; complexEntity.Int64 = (long)int.MaxValue + m; complexEntity.LongPrimitive = (long)int.MaxValue + m; complexEntity.Guid = Guid.NewGuid(); batch.Insert(complexEntity); if (m == Midpoint) { this.middleRef = complexEntity; } // Add delay to make times unique Thread.Sleep(100); } this.currentTable.ExecuteBatch(batch); }
public static void AssertEquality(ComplexEntity a, ComplexEntity b) { Assert.AreEqual(a.String, b.String); Assert.AreEqual(a.Int64, b.Int64); Assert.AreEqual(a.Int64N, b.Int64N); Assert.AreEqual(a.Int64Null, b.Int64Null); Assert.AreEqual(a.LongPrimitive, b.LongPrimitive); Assert.AreEqual(a.LongPrimitiveN, b.LongPrimitiveN); Assert.AreEqual(a.LongPrimitiveNull, b.LongPrimitiveNull); Assert.AreEqual(a.Int32, b.Int32); Assert.AreEqual(a.Int32N, b.Int32N); Assert.AreEqual(a.Int32Null, b.Int32Null); Assert.AreEqual(a.IntegerPrimitive, b.IntegerPrimitive); Assert.AreEqual(a.integerPrimitiveN, b.IntegerPrimitiveN); Assert.AreEqual(a.IntegerPrimitiveNull, b.IntegerPrimitiveNull); Assert.AreEqual(a.Guid, b.Guid); Assert.AreEqual(a.GuidN, b.GuidN); Assert.AreEqual(a.GuidNull, b.GuidNull); Assert.AreEqual(a.Double, b.Double); Assert.AreEqual(a.DoubleN, b.DoubleN); Assert.AreEqual(a.DoubleNull, b.DoubleNull); Assert.AreEqual(a.DoublePrimitive, b.DoublePrimitive); Assert.AreEqual(a.DoublePrimitiveN, b.DoublePrimitiveN); Assert.AreEqual(a.DoublePrimitiveNull, b.DoublePrimitiveNull); Assert.AreEqual(a.BinaryPrimitive, b.BinaryPrimitive); Assert.AreEqual(a.Binary, b.Binary); Assert.AreEqual(a.BoolPrimitive, b.BoolPrimitive); Assert.AreEqual(a.BoolPrimitiveN, b.BoolPrimitiveN); Assert.AreEqual(a.BoolPrimitiveNull, b.BoolPrimitiveNull); Assert.AreEqual(a.Bool, b.Bool); Assert.AreEqual(a.BoolN, b.BoolN); Assert.AreEqual(a.BoolNull, b.BoolNull); Assert.AreEqual(a.DateTimeOffsetN, b.DateTimeOffsetN); Assert.AreEqual(a.DateTimeOffset, b.DateTimeOffset); Assert.AreEqual(a.DateTimeOffsetNull, b.DateTimeOffsetNull); Assert.AreEqual(a.DateTime, b.DateTime); Assert.AreEqual(a.DateTimeN, b.DateTimeN); Assert.AreEqual(a.DateTimeNull, b.DateTimeNull); }