public static void NotAnObjectInitializer() { Data data = new Data(); data.a = MyEnum.a; InitializerTests.X(InitializerTests.Y(), data); }
public static void CollectionInitializerList() { InitializerTests.X(InitializerTests.Y(), new List <int> { 1, 2, 3 }); }
public static void NotAnObjectInitializerWithEvent() { Data data = new Data(); data.TestEvent += delegate { Console.WriteLine(); }; InitializerTests.X(InitializerTests.Y(), data); }
public static void NotACollectionInitializer() { List <int> list = new List <int>(); list.Add(1); list.Add(2); list.Add(3); InitializerTests.X(InitializerTests.Y(), list); }
public static void SimpleDictInitializer() { InitializerTests.X(InitializerTests.Y(), new Data { MoreData = { a = MyEnum.a, [2] = null } }); }
public static void ObjectInitializerAssignCollectionToProperty() { InitializerTests.X(InitializerTests.Y(), new Data { a = MyEnum.a, PropertyList = new List <MyEnum2> { MyEnum2.c, MyEnum2.d } }); }
public static void ObjectInitializerAddToCollectionInProperty() { InitializerTests.X(InitializerTests.Y(), new Data { a = MyEnum.a, PropertyList = { MyEnum2.c, MyEnum2.d } }); }
public static void ObjectInitializerWithInitializationOfNestedObjects() { InitializerTests.X(InitializerTests.Y(), new Data { MoreData = { a = MyEnum.a, MoreData = { a = MyEnum.b } } }); }
public static void CollectionInitializerDictionaryWithEnumTypes() { InitializerTests.X(InitializerTests.Y(), new Dictionary <MyEnum, MyEnum2> { { MyEnum.a, MyEnum2.c }, { MyEnum.b, MyEnum2.d } }); }
public static void CollectionInitializerDictionary() { InitializerTests.X(InitializerTests.Y(), new Dictionary <string, int> { { "First", 1 }, { "Second", 2 }, { "Third", 3 } }); }
public static void MixedObjectAndDictInitializer() { InitializerTests.X(InitializerTests.Y(), new Data { MoreData = { a = MyEnum.a,
public static void ObjectInitializer() { InitializerTests.X(InitializerTests.Y(), new Data { a = MyEnum.a }); }