public void Should_map_complex_parameter() { mapping.Map(x => x.GetCustomersByName( FunctionMapping <object> .Parameter <string>( param => param.Named("Foo").DbType("Bar") ) )); mapping.ToXml().Single() .ShouldHaveElement("Parameter") .ShouldHaveAttribute("Parameter", "name") .ShouldHaveAttribute("Name", "Foo") .ShouldHaveAttribute("DbType", "Bar"); }
public void Should_obtain_parameter_for_complex_method() { Expression <Func <FunctionMappingParserTester, object> > expr = x => x.GetCustomersByName( FunctionMapping <FunctionParameterMappingTester> .Parameter <string>(param => param.DbType("foo") ) ); var visitor = new FunctionMappingExpressionParser(expr); var results = visitor.Process(); results.Parameters.Length.ShouldEqual(1); var parameter = results.Parameters[0]; parameter.Attributes["Parameter"].ShouldEqual("name"); parameter.Attributes["DbType"].ShouldEqual("foo"); }