public void Should_set_FilterDescriptor_MemberType_from_anonymous_dynamic() { dynamic aDynamicObject = new { StringValue = "Foo" }; var filterDescriptor = new FilterDescriptor { Member = "StringValue" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof(string)); }
public void Should_set_FilterDescriptor_MemberType_from_complex_anonymous_dynamic() { dynamic aDynamicObject = new { Complex = new { Foo = "Bar" } }; var filterDescriptor = new FilterDescriptor { Member = "Complex.Foo" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof(string)); }
public void Should_set_FilterDescriptor_MemberType_from_DynamicObject() { dynamic aDynamicObject = new ExpandoObject(); aDynamicObject.IntValue = 42; var filterDescriptor = new FilterDescriptor { Member = "IntValue" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof(int)); }
public void Should_set_FilterDescriptor_MemberType_to_null_from_complex_DynamicObject_returning_null() { dynamic aDynamicObject = new ExpandoObject(); aDynamicObject.Complex = new SimpleFoo { Bar = null }; var filterDescriptor = new FilterDescriptor { Member = "Complex.Bar" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldBeNull(); }
public void Should_set_FilterDescriptor_MemberType_from_complex_anonymous_dynamic_returning_null() { dynamic aDynamicObject = new SimpleFoo { Complex = new SimpleFoo { Bar = null } }; var filterDescriptor = new FilterDescriptor { Member = "Complex.Bar" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof(string)); }
public void Should_set_FilterDescriptor_MemberType_from_anonymous_dynamic() { dynamic aDynamicObject = new {StringValue = "Foo"}; var filterDescriptor = new FilterDescriptor { Member = "StringValue" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof (string)); }
public void Should_set_FilterDescriptor_MemberType_to_null_from_complex_DynamicObject_returning_null() { dynamic aDynamicObject = new ExpandoObject(); aDynamicObject.Complex = new SimpleFoo { Bar = null }; var filterDescriptor = new FilterDescriptor { Member = "Complex.Bar" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldBeNull(); }
public void Should_set_FilterDescriptor_MemberType_from_DynamicObject() { dynamic aDynamicObject = new ExpandoObject(); aDynamicObject.IntValue = 42; var filterDescriptor = new FilterDescriptor { Member = "IntValue" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof(int)); }
public void Should_set_FilterDescriptor_MemberType_from_complex_null_anonymous_dynamic() { dynamic aDynamicObject = new SimpleFoo { Complex = null }; var filterDescriptor = new FilterDescriptor { Member = "Complex.Bar" }; filterDescriptor.SetMemberTypeFrom((object)aDynamicObject); filterDescriptor.MemberType.ShouldEqual(typeof(string)); }