public void with_the_normal_casing() { var projection = new Projection <SomeTarget>(); //projection.CamelCaseAttributeNames(); projection.Value(x => x.Name); projection.Value(x => x.Age); projection.Child(x => x.Child).Configure(_ => { _.Value(x => x.Name); }); var node = new DictionaryMediaNode(); var someTarget = new SomeTarget { Active = true, Age = 40, Name = "Jeremy", Child = new SomeChild { Name = "Max" } }; projection.As <IProjection <SomeTarget> >().Write(new ProjectionContext <SomeTarget>(new InMemoryServiceLocator(), someTarget), node); node.Values["Name"].ShouldEqual("Jeremy"); node.Values["Age"].ShouldEqual(40); node.Values["Child"].As <IDictionary <string, object> >()["Name"].ShouldEqual("Max"); }
public void with_the_normal_casing() { var projection = new Projection<SomeTarget>(); //projection.CamelCaseAttributeNames(); projection.Value(x => x.Name); projection.Value(x => x.Age); projection.Child(x => x.Child).Configure(_ => { _.Value(x => x.Name); }); var node = new DictionaryMediaNode(); var someTarget = new SomeTarget { Active = true, Age = 40, Name = "Jeremy", Child = new SomeChild { Name = "Max" } }; projection.As<IProjection<SomeTarget>>().Write(new ProjectionContext<SomeTarget>(new InMemoryServiceLocator(), someTarget), node); node.Values["Name"].ShouldEqual("Jeremy"); node.Values["Age"].ShouldEqual(40); node.Values["Child"].As<IDictionary<string, object>>()["Name"].ShouldEqual("Max"); }