public void Can_Save_and_Load_MismatchedAlias_References_using_code_conventions() { var customer = new MismatchAliasCustomer { Name = "Customer 1", PrimaryAddress = new MismatchAliasAddress { AddressLine1 = "1 Humpty Street", City = "Humpty Doo", State = "Northern Territory", Country = "Australia" }, }; db.Save(customer); Assert.That(customer.Id, Is.GreaterThan(0)); Assert.That(customer.PrimaryAddress.MismatchAliasCustomerId, Is.EqualTo(0)); db.SaveReferences(customer, customer.PrimaryAddress); Assert.That(customer.PrimaryAddress.MismatchAliasCustomerId, Is.EqualTo(customer.Id)); var dbCustomer = db.LoadSingleById <MismatchAliasCustomer>(customer.Id); dbCustomer.PrintDump(); Assert.That(dbCustomer.PrimaryAddress, Is.Not.Null); }
public void Can_Save_and_Load_MismatchedAlias_References_using_code_conventions() { var customer = new MismatchAliasCustomer { Name = "Customer 1", PrimaryAddress = new MismatchAliasAddress { AddressLine1 = "1 Humpty Street", City = "Humpty Doo", State = "Northern Territory", Country = "Australia" }, }; db.Save(customer); Assert.That(customer.Id, Is.GreaterThan(0)); Assert.That(customer.PrimaryAddress.MismatchAliasCustomerId, Is.EqualTo(0)); db.SaveReferences(customer, customer.PrimaryAddress); Assert.That(customer.PrimaryAddress.MismatchAliasCustomerId, Is.EqualTo(customer.Id)); var dbCustomer = db.LoadSingleById<MismatchAliasCustomer>(customer.Id); dbCustomer.PrintDump(); Assert.That(dbCustomer.PrimaryAddress, Is.Not.Null); }