public void Flattening() { var unflat = new Foo { Name = "foo", Foo1 = new Foo { Name = "abc", Foo2 = new Foo { Foo1 = new Foo { Name = "inner" } } }, Foo2 = new Foo { Name = "123", NameZype = "aaa" }, }; var flat = new FlatFoo(); flat.InjectFrom <FlatLoopInjection>(unflat); flat.Foo2NameZype.IsEqualTo("aaa"); }
public void GenericFlatTest() { var foo = new Foo { Foo1 = new Foo { Age = 18 } }; var flat = new FlatFoo(); flat.InjectFrom<IntToStringFlat>(foo); flat.Foo1Age.IsEqualTo("18"); }
public void GenericFlatTest() { var foo = new Foo { Foo1 = new Foo { Age = 18 } }; var flat = new FlatFoo(); flat.InjectFrom <IntToStringFlat>(foo); flat.Foo1Age.IsEqualTo("18"); }
public void ObjectFlatTest() { var unflat = (object)new { Parent = (object)new Foo { b = true, Name = "v" } }; var flat = new FlatFoo(); flat.InjectFrom <FlatBoolToString>(unflat); flat.Parentb.IsEqualTo("True"); flat.Bool.IsEqualTo(null); }
public void Flattening() { var unflat = new Foo { Name = "foo", Foo1 = new Foo { Name = "abc", Foo2 = new Foo { Foo1 = new Foo { Name = "inner" } } }, Foo2 = new Foo { Name = "123", NameZype = "aaa" }, }; var flat = new FlatFoo(); flat.InjectFrom<FlatLoopInjection>(unflat); flat.Foo2NameZype.IsEqualTo("aaa"); }
public void GenericFlatTest() { var unflat = new Foo { Parent = new Foo { _a = "aaa", a = 23, b = true, Name = "v" } }; var flat = new FlatFoo(); flat.InjectFrom <FlatBoolToString>(unflat); flat.Parentb.IsEqualTo("True"); flat.Bool.IsEqualTo(null); }
public void FlatteningTest() { var unflat = new Foo { Parent = new Foo { _a = "aaa", a = 23, b = true, Name = "v" } }; var flat = new FlatFoo(); flat.InjectFrom <FlatLoopInjection>(unflat); flat.Parent_a.IsEqualTo(unflat.Parent._a); flat.Parenta.IsEqualTo(unflat.Parent.a); flat.Parentb.IsEqualTo(null); flat.ParentName.IsEqualTo(unflat.Parent.Name); flat.ParentParentName.IsEqualTo(null); flat.oO.IsEqualTo(null); flat.d.IsEqualTo(null); }