public void Initialize() { MyInt16 = 1; MyInt32 = 2; MyInt64 = 3; MyUInt16 = 4; MyUInt32 = 5; MyUInt64 = 6; MyByte = 7; MySByte = 8; MyChar = 'a'; MyString = "Hello"; MyBooleanTrue = true; MyBooleanFalse = false; MySingle = 1.1f; MyDouble = 2.2d; MyDecimal = 3.3m; MyDateTime = new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc); MyDateTimeOffset = new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)); MyEnum = SampleEnum.Two; MyInt64Enum = SampleEnumInt64.MinNegative; MyUInt64Enum = SampleEnumUInt64.Max; MySimpleStruct = new SimpleStruct { One = 11, Two = 1.9999 }; MyInt16Array = new short[] { 1 }; MyInt32Array = new int[] { 2 }; MyInt64Array = new long[] { 3 }; MyUInt16Array = new ushort[] { 4 }; MyUInt32Array = new uint[] { 5 }; MyUInt64Array = new ulong[] { 6 }; MyByteArray = new byte[] { 7 }; MySByteArray = new sbyte[] { 8 }; MyCharArray = new char[] { 'a' }; MyStringArray = new string[] { "Hello" }; MyBooleanTrueArray = new bool[] { true }; MyBooleanFalseArray = new bool[] { false }; MySingleArray = new float[] { 1.1f }; MyDoubleArray = new double[] { 2.2d }; MyDecimalArray = new decimal[] { 3.3m }; MyDateTimeArray = new DateTime[] { new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc) }; MyDateTimeOffsetArray = new DateTimeOffset[] { new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)) }; MyEnumArray = new SampleEnum[] { SampleEnum.Two }; MyStringList = new List <string>() { "Hello" }; MyStringIEnumerableT = new string[] { "Hello" }; MyStringIListT = new string[] { "Hello" }; MyStringICollectionT = new string[] { "Hello" }; MyStringIReadOnlyCollectionT = new string[] { "Hello" }; MyStringIReadOnlyListT = new string[] { "Hello" }; MyStringISetT = new HashSet <string> { "Hello" }; }
public void Initialize() { MyInt16 = 1; MyInt32 = 2; MyInt64 = 3; MyUInt16 = 4; MyUInt32 = 5; MyUInt64 = 6; MyByte = 7; MySByte = 8; MyChar = 'a'; MyString = "Hello"; MyBooleanTrue = true; MyBooleanFalse = false; MySingle = 1.1f; MyDouble = 2.2d; MyDecimal = 3.3m; MyDateTime = new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc); MyDateTimeOffset = new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)); MyGuid = new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6"); MyUri = new Uri("https://github.com/dotnet/runtime"); MyEnum = SampleEnum.Two; MyInt64Enum = SampleEnumInt64.MinNegative; MyUInt64Enum = SampleEnumUInt64.Max; MyInt16Array = new short[] { 1 }; MyInt32Array = new int[] { 2 }; MyInt64Array = new long[] { 3 }; MyUInt16Array = new ushort[] { 4 }; MyUInt32Array = new uint[] { 5 }; MyUInt64Array = new ulong[] { 6 }; MyByteArray = new byte[] { 7 }; MySByteArray = new sbyte[] { 8 }; MyCharArray = new char[] { 'a' }; MyStringArray = new string[] { "Hello" }; MyBooleanTrueArray = new bool[] { true }; MyBooleanFalseArray = new bool[] { false }; MySingleArray = new float[] { 1.1f }; MyDoubleArray = new double[] { 2.2d }; MyDecimalArray = new decimal[] { 3.3m }; MyDateTimeArray = new DateTime[] { new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc) }; MyDateTimeOffsetArray = new DateTimeOffset[] { new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)) }; MyGuidArray = new Guid[] { new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6") }; MyUriArray = new Uri[] { new Uri("https://github.com/dotnet/runtime") }; MyEnumArray = new SampleEnum[] { SampleEnum.Two }; MySimpleStruct = new SimpleStruct { One = 11, Two = 1.9999 }; MySimpleTestStruct = new SimpleTestStruct { MyInt64 = 64, MyString = "Hello", MyInt32Array = new int[] { 32 } }; MyInt16TwoDimensionArray = new int[2][]; MyInt16TwoDimensionArray[0] = new int[] { 10, 11 }; MyInt16TwoDimensionArray[1] = new int[] { 20, 21 }; MyInt16TwoDimensionList = new List <List <int> >(); MyInt16TwoDimensionList.Add(new List <int> { 10, 11 }); MyInt16TwoDimensionList.Add(new List <int> { 20, 21 }); MyInt16ThreeDimensionArray = new int[2][][]; MyInt16ThreeDimensionArray[0] = new int[2][]; MyInt16ThreeDimensionArray[1] = new int[2][]; MyInt16ThreeDimensionArray[0][0] = new int[] { 11, 12 }; MyInt16ThreeDimensionArray[0][1] = new int[] { 13, 14 }; MyInt16ThreeDimensionArray[1][0] = new int[] { 21, 22 }; MyInt16ThreeDimensionArray[1][1] = new int[] { 23, 24 }; MyInt16ThreeDimensionList = new List <List <List <int> > >(); var list1 = new List <List <int> >(); MyInt16ThreeDimensionList.Add(list1); list1.Add(new List <int> { 11, 12 }); list1.Add(new List <int> { 13, 14 }); var list2 = new List <List <int> >(); MyInt16ThreeDimensionList.Add(list2); list2.Add(new List <int> { 21, 22 }); list2.Add(new List <int> { 23, 24 }); MyStringList = new List <string>() { "Hello" }; MyStringIEnumerable = new string[] { "Hello" }; MyStringIList = new string[] { "Hello" }; MyStringICollection = new string[] { "Hello" }; MyStringIEnumerableT = new string[] { "Hello" }; MyStringIListT = new string[] { "Hello" }; MyStringICollectionT = new string[] { "Hello" }; MyStringIReadOnlyCollectionT = new string[] { "Hello" }; MyStringIReadOnlyListT = new string[] { "Hello" }; MyStringISetT = new HashSet <string> { "Hello" }; MyStringToStringKeyValuePair = new KeyValuePair <string, string>("myKey", "myValue"); MyStringToStringIDict = new Dictionary <string, string> { { "key", "value" } }; MyStringToStringGenericDict = new Dictionary <string, string> { { "key", "value" } }; MyStringToStringGenericIDict = new Dictionary <string, string> { { "key", "value" } }; MyStringToStringGenericIReadOnlyDict = new Dictionary <string, string> { { "key", "value" } }; MyStringToStringImmutableDict = ImmutableDictionary.CreateRange(MyStringToStringGenericDict); MyStringToStringIImmutableDict = ImmutableDictionary.CreateRange(MyStringToStringGenericDict); MyStringToStringImmutableSortedDict = ImmutableSortedDictionary.CreateRange(MyStringToStringGenericDict); MyStringStackT = new Stack <string>(new List <string>() { "Hello", "World" }); MyStringQueueT = new Queue <string>(new List <string>() { "Hello", "World" }); MyStringHashSetT = new HashSet <string>(new List <string>() { "Hello" }); MyStringLinkedListT = new LinkedList <string>(new List <string>() { "Hello" }); MyStringSortedSetT = new SortedSet <string>(new List <string>() { "Hello" }); MyStringIImmutableListT = ImmutableList.CreateRange(new List <string> { "Hello" }); MyStringIImmutableStackT = ImmutableStack.CreateRange(new List <string> { "Hello" }); MyStringIImmutableQueueT = ImmutableQueue.CreateRange(new List <string> { "Hello" }); MyStringIImmutableSetT = ImmutableHashSet.CreateRange(new List <string> { "Hello" }); MyStringImmutableHashSetT = ImmutableHashSet.CreateRange(new List <string> { "Hello" }); MyStringImmutableListT = ImmutableList.CreateRange(new List <string> { "Hello" }); MyStringImmutableStackT = ImmutableStack.CreateRange(new List <string> { "Hello" }); MyStringImmutablQueueT = ImmutableQueue.CreateRange(new List <string> { "Hello" }); MyStringImmutableSortedSetT = ImmutableSortedSet.CreateRange(new List <string> { "Hello" }); MyListOfNullString = new List <string> { null }; }