public void ShouldRememberCpuNames() { var names = new [] { "Xavier", "Alice", "Bob" }; var machine = new Machine(); foreach(var name in names) { var cpu = new MockCPU(machine) { Placeholder = name }; machine.SystemBus.Register(cpu, new CPURegistrationPoint()); machine.SetLocalName(cpu, name); } machine = Serializer.DeepClone(machine); var cpus = machine.SystemBus.GetCPUs(); CollectionAssert.AreEquivalent(names, cpus.Select(x => machine.GetLocalName(x))); foreach(var cpu in cpus.Cast<MockCPU>()) { Assert.AreEqual(cpu.Placeholder, machine.GetLocalName(cpu)); } }