public void Can_merge_optional_self_references() { var timesheet = new TimeSheet { Id = 1, EmployeeId = 2, ApprovedById = 3 }; var employees = 4.Times(i => new UseCase.Employee { Id = i, Name = "Employee " + i }); timesheet.Merge(employees); timesheet.PrintDump(); Assert.That(timesheet.Employee.Id, Is.EqualTo(2)); Assert.That(timesheet.ApprovedBy.Id, Is.EqualTo(3)); }
public void Can_merge_optional_self_references() { var timesheet = new TimeSheet { Id = 1, EmployeeId = 2, ApprovedById = 3 }; var employees = 4.Times(i => new Employee { Id = i, Name = "Employee " + i }); timesheet.Merge(employees); timesheet.PrintDump(); Assert.That(timesheet.Employee.Id, Is.EqualTo(2)); Assert.That(timesheet.ApprovedBy.Id, Is.EqualTo(3)); }