public void ShouldReproduceOwnedInstanceBug() { new DatabaseTester().Clean(); var employee = new Employee("jpalermo", "Jeffrey", "Palermo", "jeffrey @ clear dash measure.com"); using (var context = new StubbedDataContextFactory().GetContext()) { context.Add(employee); context.SaveChanges(); } var report = new ExpenseReport(); report.Number = "123"; report.Status = ExpenseReportStatus.Draft; report.Submitter = employee; report.Approver = employee; report.Total = 34; using (var context = new StubbedDataContextFactory().GetContext()) { context.Update(report); context.SaveChanges(); } var submitted = ExpenseReportStatus.Submitted; report.AddAuditEntry( new AuditEntry(employee, DateTime.Now, ExpenseReportStatus.Draft, submitted, report)); report.Status = submitted.Clone(); using (var context = new StubbedDataContextFactory().GetContext()) { context.Update(report); context.SaveChanges(); } using (var context = new StubbedDataContextFactory().GetContext()) { var statuses = new Dictionary <string, int>(); new SqlExecuter().ExecuteSql( "select count(1), status from ExpenseReport group by status" , reader => statuses.Add(reader.GetString(1), reader.GetInt32(0))); Assert.That(statuses["SBM"], Is.EqualTo(1)); } }