Populate(
            int stringSize,
            int binarySize)
        {
            PartitionKey = typeof(AllDataImplicit).Name;
            RowKey       = Guid.NewGuid().ToString();

            BoolProperty        = DataGenerator.Rnd.Next(2) == 1;
            BoolPropertyNull    = null;
            BoolPropertyNullNot = DataGenerator.Rnd.Next(2) == 1;

            IntProperty        = DataGenerator.Rnd.Next(Int32.MaxValue);
            IntPropertyNull    = null;
            IntPropertyNullNot = DataGenerator.Rnd.Next(int.MaxValue);

            Int64Property        = (Int64)(DataGenerator.Rnd.Next(Int32.MaxValue) * DataGenerator.Rnd.Next(Int32.MaxValue));
            Int64PropertyNull    = null;
            Int64PropertyNullNot = (Int64)(DataGenerator.Rnd.Next(Int32.MaxValue) * DataGenerator.Rnd.Next(Int32.MaxValue));

            DoubleProperty        = DataGenerator.Rnd.NextDouble() * Double.MaxValue;
            DoublePropertyNull    = null;
            DoublePropertyNullNot = DataGenerator.Rnd.NextDouble() * Double.MaxValue;

            DateTimeProperty        = DateTime.UtcNow;
            DateTimePropertyNull    = null;
            DateTimePropertyNullNot = DateTime.UtcNow;

            GuidProperty        = Guid.NewGuid();
            GuidPropertyNull    = null;
            GuidPropertyNullNot = Guid.NewGuid();

            StringProperty     = DataGenerator.GetStringSizeFixed(stringSize);
            StringPropertyNull = null;

            BinaryProperty = DataGenerator.GetBytesSizeFixed(binarySize);
        }
Beispiel #2
0
        Populate(
            int stringSize,
            int binarySize)
        {
            PartitionKey = typeof(KeyDataWithList).Name;
            RowKey       = Guid.NewGuid().ToString();

            // ---------------------------------------------------------------------------------------------------------
            Items = new ArrayList();

            Items.Add(DataGenerator.Rnd.Next(2) == 1);
            Items.Add(DataGenerator.Rnd.Next(Int32.MaxValue));
            Items.Add((long)(DataGenerator.Rnd.NextDouble() * Int64.MaxValue));
            Items.Add(DataGenerator.Rnd.NextDouble() * Double.MaxValue);
            Items.Add(DateTime.UtcNow);
            Items.Add(Guid.NewGuid());
            Items.Add(DataGenerator.GetStringSizeFixed(stringSize));
            Items.Add(DataGenerator.GetBytesSizeFixed(binarySize));


            // ---------------------------------------------------------------------------------------------------------
            Ints = new List <int>();

            Ints.Add(100);
            Ints.Add(1000);
            Ints.Add(10000);


            // ---------------------------------------------------------------------------------------------------------
            Objects = new List <object>();

            Objects.Add("Object1");
            Objects.Add(420);
            Objects.Add("Object3");

            // ---------------------------------------------------------------------------------------------------------
            Doubles = new double[3];

            Doubles[0] = 100.001;
            Doubles[1] = 1000.0001;
            Doubles[2] = 10000.00001;

            // ---------------------------------------------------------------------------------------------------------
            People = new List <PersonInfo>();

            People.Add(PersonInfo.CreateNew());

            // ---------------------------------------------------------------------------------------------------------
            Int16Enums = new List <Int16Enum>();

            Int16Enums.Add(Int16Enum.Value3);
            Int16Enums.Add(Int16Enum.Value2);
            Int16Enums.Add(Int16Enum.Value1);

            // ---------------------------------------------------------------------------------------------------------
            ULongs = new ulong[3];

            ULongs[0] = ulong.MinValue;
            ULongs[1] = (ulong)(DataGenerator.Rnd.Next(int.MinValue, int.MaxValue) *
                                DataGenerator.Rnd.Next(int.MinValue, int.MaxValue));
            ULongs[2] = ulong.MaxValue;
        }
Beispiel #3
0
        Populate(
            int stringSize,
            int binarySize)
        {
            PartitionKey = typeof(AllDataExplicit).Name;
            RowKey       = Guid.NewGuid().ToString();

            // Fields + Nullable. 8 + 8 + 6 = 22
            StringField     = DataGenerator.GetStringSizeFixed(stringSize);
            StringFieldNull = null;

            BoolField        = DataGenerator.Rnd.Next(2) == 1;
            BoolFieldNull    = null;
            BoolFieldNullNot = DataGenerator.Rnd.Next(2) == 1;

            IntField        = DataGenerator.Rnd.Next(Int32.MaxValue);
            IntFieldNull    = null;
            IntFieldNullNot = DataGenerator.Rnd.Next(int.MaxValue);

            Int64Field        = (Int64)(DataGenerator.Rnd.Next(Int32.MaxValue) * DataGenerator.Rnd.Next(Int32.MaxValue));
            Int64FieldNull    = null;
            Int64FieldNullNot = (Int64)(DataGenerator.Rnd.Next(Int32.MaxValue) * DataGenerator.Rnd.Next(Int32.MaxValue));

            DoubleField        = DataGenerator.Rnd.NextDouble() * Double.MaxValue;
            DoubleFieldNull    = null;
            DoubleFieldNullNot = DataGenerator.Rnd.NextDouble() * Double.MaxValue;

            DateTimeField        = DateTime.UtcNow;
            DateTimeFieldNull    = null;
            DateTimeFieldNullNot = DateTime.UtcNow;

            GuidField        = Guid.NewGuid();
            GuidFieldNull    = null;
            GuidFieldNullNot = Guid.NewGuid();

            BinaryField     = DataGenerator.GetBytesSizeFixed(binarySize);
            BinaryFieldNull = null;

            // intrinsic morphs + Nullable. 7 * 4 = 28
            ByteFieldMin     = Byte.MinValue;
            ByteFieldMax     = Byte.MaxValue;
            ByteFieldNull    = null;
            ByteFieldNullNot = (byte)DataGenerator.Rnd.Next(byte.MaxValue);

            SByteFieldMin     = SByte.MinValue;
            SByteFieldMax     = SByte.MaxValue;
            SByteFieldNull    = null;
            SByteFieldNullNot = (sbyte)DataGenerator.Rnd.Next(sbyte.MaxValue);

            Int16FieldMin     = Int16.MinValue;
            Int16FieldMax     = Int16.MaxValue;
            Int16FieldNull    = null;
            Int16FieldNullNot = (Int16)DataGenerator.Rnd.Next(Int16.MaxValue);

            UInt16FieldMin     = UInt16.MinValue;
            UInt16FieldMax     = UInt16.MaxValue;
            UInt16FieldNull    = null;
            UInt16FieldNullNot = (UInt16)DataGenerator.Rnd.Next(UInt16.MaxValue);

            UInt32FieldMin     = UInt32.MinValue;
            UInt32FieldMax     = UInt32.MaxValue;
            UInt32FieldNull    = null;
            UInt32FieldNullNot = (UInt32)DataGenerator.Rnd.Next(UInt16.MaxValue);

            UInt64FieldMin     = UInt64.MinValue;
            UInt64FieldMax     = UInt64.MaxValue;
            UInt64FieldNull    = null;
            UInt64FieldNullNot = (UInt64)(DataGenerator.Rnd.Next(Int32.MaxValue) * DataGenerator.Rnd.Next(Int32.MaxValue));

            CharFieldMin     = Char.MinValue;
            CharFieldMax     = Char.MaxValue;
            CharFieldNull    = null;
            CharFieldNullNot = (Char)DataGenerator.Rnd.Next(Char.MaxValue);

            // Enums - 8
            ByteEnumField        = ByteEnum.Value2;
            ByteEnumFieldNull    = null;
            ByteEnumFieldNullNot = ByteEnum.Value1;

            SByteEnumField        = SByteEnum.Value2;
            SByteEnumFieldNull    = null;
            SByteEnumFieldNullNot = SByteEnum.Value1;

            Int16EnumField        = Int16Enum.Value2;
            Int16EnumFieldNull    = null;
            Int16EnumFieldNullNot = Int16Enum.Value1;

            UInt16EnumField        = UInt16Enum.Value2;
            UInt16EnumFieldNull    = null;
            UInt16EnumFieldNullNot = UInt16Enum.Value1;

            Int32EnumField        = Int32Enum.Value2;
            Int32EnumFieldNull    = null;
            Int32EnumFieldNullNot = Int32Enum.Value1;

            UInt32EnumField        = UInt32Enum.Value2;
            UInt32EnumFieldNull    = null;
            UInt32EnumFieldNullNot = UInt32Enum.Value1;

            Int64EnumField        = Int64Enum.Value2;
            Int64EnumFieldNull    = null;
            Int64EnumFieldNullNot = Int64Enum.Value1;

            UInt64EnumField        = UInt64Enum.Value2;
            UInt64EnumFieldNull    = null;
            UInt64EnumFieldNullNot = UInt64Enum.Value1;

            // Object
            // Create a derived generic object type to validate correct de-serialization
            var employeeInfo = EmployeeInfo <int> .CreateNew();

            employeeInfo.Dummy = 101;

            PersonInfo = employeeInfo;
        }