public void Should_set_element_type() { mapping.ElementType <Customer>(); MappingXml .ShouldHaveElement("ElementType") .ShouldHaveAttribute("Name", typeof(Customer).FullName); }
public void Should_have_multiple_element_types() { mapping.ElementType <Customer>().ElementType <Order>(); //Two ElementType elements and one parameter MappingXml.Elements().Count().ShouldEqual(3); }
public void Should_set_elementtype_with_nested_type_mapping() { mapping.ElementType <Customer>(returnType => { returnType.Map(x => x.Surname); }); MappingXml.ShouldHaveElement("ElementType") .ShouldHaveElement("Column").ShouldHaveAttribute("Name", "Surname"); }
public void Should_specify_OtherKey_with_lambda() { mapping.OtherKey(x => x.Id); MappingXml.ShouldHaveAttribute("OtherKey", "Id"); }
public void Should_generate_member_attribute() { MappingXml.ShouldHaveAttribute("Member", "Orders"); }
public void NotNull_Should_set_canbenull_to_false() { mapping.NotNull(); MappingXml.ShouldHaveAttribute("CanBeNull", "false"); }
public void Should_generate_member_attribute() { mapping.Named("foo"); MappingXml.ShouldHaveAttribute("Member", "Surname"); }
public void Should_generate_multiple_ThisKeys() { mapping.ThisKey("Foo").ThisKey("Bar"); MappingXml.ShouldHaveAttribute("ThisKey", "Foo,Bar"); }
public void Should_generate_otherkey() { mapping.OtherKey("Foo"); MappingXml.ShouldHaveAttribute("OtherKey", "Foo"); }
public void Composable_should_set_IsComposable_attribute() { mapping.Composable(); MappingXml.ShouldHaveAttribute("IsComposable", "true"); }
public void Should_generate_DeleteRule() { mapping.DeleteRule("Bar"); MappingXml.ShouldHaveAttribute("DeleteRule", "Bar"); }
public void Should_have_name_attribute_in_xml_with_custom_name() { mapping.Named("Foo"); MappingXml.ShouldHaveAttribute("Name", "Foo"); }
public void Should_have_method_attribute_in_xml() { MappingXml.ShouldHaveAttribute("Method", "GetCustomersByName"); }
public void Should_have_name_attribute_in_xml() { MappingXml.ShouldHaveAttribute("Name", "GetCustomersByName"); }
public void Should_have_expression_attribute() { mapping.Expression("Foo"); MappingXml.ShouldHaveAttribute("Expression", "Foo"); }
public void Should_have_dbtype_attribute() { mapping.DbType("foo"); MappingXml.ShouldHaveAttribute("DbType", "foo"); }
public void Should_generate_foreign_key_name() { mapping.ForeignKeyName("Foo"); MappingXml.ShouldHaveAttribute("Name", "Foo"); }
public void Should_include_parameters_in_mapping() { MappingXml .ShouldHaveElement("Parameter") .ShouldHaveAttribute("Parameter", "name"); }
public void Should_generate_storage() { mapping.Storage("_orders"); MappingXml.ShouldHaveAttribute("Storage", "_orders"); }
public void Should_have_storage_attribute() { mapping.Storage("_surname"); MappingXml.ShouldHaveAttribute("Storage", "_surname"); }
public void Should_generate_thiskey() { mapping.ThisKey("Foo"); MappingXml.ShouldHaveAttribute("ThisKey", "Foo"); }
public void Should_create_parameter_element() { MappingXml.ShouldBeNamed("Parameter"); }
public void Should_specify_ThisKey_with_lambda() { mapping.ThisKey(x => x.Surname); MappingXml.ShouldHaveAttribute("ThisKey", "Surname"); }
public void Should_have_DbType_attribute() { mapping.DbType("nvarchar(250)"); MappingXml.ShouldHaveAttribute("DbType", "nvarchar(250)"); }
public void Should_generate_multiple_otherkeys() { mapping.OtherKey("Foo").OtherKey("Bar"); MappingXml.ShouldHaveAttribute("OtherKey", "Foo,Bar"); }
public void Should_have_autosync_attribute() { mapping.AutoSync(AutoSync.OnInsert); MappingXml.ShouldHaveAttribute("AutoSync", "OnInsert"); }
public void Should_have_parameter_attribute() { MappingXml.ShouldHaveAttribute("Parameter", "country"); }
public void Should_automatically_set_IsForeignKey() { MappingXml.ShouldHaveAttribute("IsForeignKey", "true"); }
public void Should_have_name_attribute() { mapping.Named("foo"); MappingXml.ShouldHaveAttribute("Name", "foo"); }
public void Should_generate_correct_element_name() { MappingXml.ShouldBeNamed("Column"); }