public void Init() { _type = typeof(string); _type2 = typeof(SomeValues); _dbnull = DBNull.Value; _assembly = typeof(SomeValues).Assembly; _intEnum = IntEnum.bbb; _byteEnum = ByteEnum.ccc; _bool = true; _bool2 = false; _byte = 254; _char = 'A'; _dateTime = new DateTime(1972, 7, 13, 1, 20, 59); _decimal = (decimal)101010.10101; _double = 123456.6789; _short = -19191; _int = -28282828; _long = 37373737373; _sbyte = -123; _float = (float)654321.321; _ushort = 61616; _uint = 464646464; _ulong = 55555555; Point p = new Point(); p.x = 56; p.y = 67; object boxedPoint = p; long i = 22; object boxedLong = i; _objects = new object[] { "string", (int)1234, null, /*boxedPoint, boxedPoint,*/ boxedLong, boxedLong }; _strings = new string[] { "an", "array", "of", "strings", "I", "repeat", "an", "array", "of", "strings" }; _ints = new int[] { 4, 5, 6, 7, 8 }; _intsMulti = new int[2, 3, 4] { { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } }, { { 13, 14, 15, 16 }, { 17, 18, 19, 20 }, { 21, 22, 23, 24 } } }; _intsJagged = new int[2][] { new int[3] { 1, 2, 3 }, new int[2] { 4, 5 } }; _simples = new SimpleClass[] { new SimpleClass('a'), new SimpleClass('b'), new SimpleClass('c') }; _simplesMulti = new SimpleClass[2, 3] { { new SimpleClass('d'), new SimpleClass('e'), new SimpleClass('f') }, { new SimpleClass('g'), new SimpleClass('j'), new SimpleClass('h') } }; _simplesJagged = new SimpleClass[2][] { new SimpleClass[1] { new SimpleClass('i') }, new SimpleClass[2] { null, new SimpleClass('k') } }; _almostEmpty = new object[2000]; _almostEmpty[1000] = 4; _emptyObjectArray = new object[0]; _emptyTypeArray = new Type[0]; _emptySimpleArray = new SimpleClass[0]; _emptyIntArray = new int[0]; _emptyStringArray = new string[0]; _emptyPointArray = new Point[0]; _doubles = new double[] { 1010101.101010, 292929.29292, 3838383.38383, 4747474.474, 56565.5656565, 0, Double.NaN, Double.MaxValue, Double.MinValue, Double.NegativeInfinity, Double.PositiveInfinity }; _sampleDelegate = new SampleDelegate(SampleCall); _sampleDelegate2 = new SampleDelegate(_simples[0].SampleCall); _sampleDelegate3 = new SampleDelegate(new SimpleClass('x').SampleCall); _sampleDelegateStatic = new SampleDelegate(SampleStaticCall); _sampleDelegateCombined = (SampleDelegate)Delegate.Combine(new Delegate[] { _sampleDelegate, _sampleDelegate2, _sampleDelegate3, _sampleDelegateStatic }); // This is to test that references are correctly solved _shared1 = new SimpleClass('A'); _shared2 = new SimpleClass('A'); _shared3 = _shared1; _falseSerializable = new FalseISerializable(2); }
public void Init() { _type = typeof (string); _type2 = typeof (SomeValues); _dbnull = DBNull.Value; _assembly = typeof (SomeValues).Assembly; _intEnum = IntEnum.bbb; _byteEnum = ByteEnum.ccc; _bool = true; _bool2 = false; _byte = 254; _char = 'A'; _dateTime = new DateTime (1972,7,13,1,20,59); _decimal = (decimal)101010.10101; _double = 123456.6789; _short = -19191; _int = -28282828; _long = 37373737373; _sbyte = -123; _float = (float)654321.321; _ushort = 61616; _uint = 464646464; _ulong = 55555555; Point p = new Point(); p.x = 56; p.y = 67; object boxedPoint = p; long i = 22; object boxedLong = i; _objects = new object[] { "string", (int)1234, null , /*boxedPoint, boxedPoint,*/ boxedLong, boxedLong}; _strings = new string[] { "an", "array", "of", "strings","I","repeat","an", "array", "of", "strings" }; _ints = new int[] { 4,5,6,7,8 }; _intsMulti = new int[2,3,4] { { {1,2,3,4},{5,6,7,8},{9,10,11,12}}, { {13,14,15,16},{17,18,19,20},{21,22,23,24} } }; _intsJagged = new int[2][] { new int[3] {1,2,3}, new int[2] {4,5} }; _simples = new SimpleClass[] { new SimpleClass('a'),new SimpleClass('b'),new SimpleClass('c') }; _simplesMulti = new SimpleClass[2,3] {{new SimpleClass('d'),new SimpleClass('e'),new SimpleClass('f')}, {new SimpleClass('g'),new SimpleClass('j'),new SimpleClass('h')}}; _simplesJagged = new SimpleClass[2][] { new SimpleClass[1] { new SimpleClass('i') }, new SimpleClass[2] {null, new SimpleClass('k')}}; _almostEmpty = new object[2000]; _almostEmpty[1000] = 4; _emptyObjectArray = new object[0]; _emptyTypeArray = new Type[0]; _emptySimpleArray = new SimpleClass[0]; _emptyIntArray = new int[0]; _emptyStringArray = new string[0]; _emptyPointArray = new Point[0]; _doubles = new double[] { 1010101.101010, 292929.29292, 3838383.38383, 4747474.474, 56565.5656565, 0, Double.NaN, Double.MaxValue, Double.MinValue, Double.NegativeInfinity, Double.PositiveInfinity }; _sampleDelegate = new SampleDelegate(SampleCall); _sampleDelegate2 = new SampleDelegate(_simples[0].SampleCall); _sampleDelegate3 = new SampleDelegate(new SimpleClass('x').SampleCall); _sampleDelegateStatic = new SampleDelegate(SampleStaticCall); _sampleDelegateCombined = (SampleDelegate)Delegate.Combine (new Delegate[] {_sampleDelegate, _sampleDelegate2, _sampleDelegate3, _sampleDelegateStatic }); // This is to test that references are correctly solved _shared1 = new SimpleClass('A'); _shared2 = new SimpleClass('A'); _shared3 = _shared1; _falseSerializable = new FalseISerializable (2); }