public void TestSaveLoad()
{
Config config1, config2;
using (var tempFile = new TemporaryFile("0install-unit-tests"))
{
// Write and read file
config1 = CreateTestConfig();
config1.Save(tempFile);
config2 = Config.Load(tempFile);
}
// Ensure data stayed the same
config2.Should().Be(config1, because: "Serialized objects should be equal.");
config2.GetHashCode().Should().Be(config1.GetHashCode(), because: "Serialized objects' hashes should be equal.");
config2.Should().NotBeSameAs(config1, because: "Serialized objects should not return the same reference.");
}