public void SerializeAndDeserialize2() { // arange GRYLogConfiguration logConfiguration = new() { Name = "MyLog" }; // act string serializedLogConfiguration = Generic.GenericSerialize(logConfiguration); GRYLogConfiguration logConfigurationReloaded = Generic.GenericDeserialize <GRYLogConfiguration>(serializedLogConfiguration); // assert Assert.AreEqual(logConfiguration, logConfigurationReloaded); Assert.AreEqual(logConfiguration.GetHashCode(), logConfigurationReloaded.GetHashCode()); Assert.IsTrue(Generic.GenericEquals(logConfiguration, logConfigurationReloaded)); Assert.AreEqual(Generic.GenericGetHashCode(logConfiguration), Generic.GenericGetHashCode(logConfigurationReloaded)); } }
public void SerializeAndDeserialize1() { // arange GRYLogConfiguration logConfiguration = new() { Name = "MyLog", ConvertTimeForLogentriesToUTCFormat = true }; // act SimpleGenericXMLSerializer <GRYLogConfiguration> serializer = new(); string serializedLogConfiguration = serializer.Serialize(logConfiguration); SimpleGenericXMLSerializer <GRYLogConfiguration> deserializer = new(); GRYLogConfiguration logConfigurationReloaded = deserializer.Deserialize(serializedLogConfiguration); // assert Assert.AreEqual(logConfiguration, logConfigurationReloaded); Assert.AreEqual(logConfiguration.GetHashCode(), logConfigurationReloaded.GetHashCode()); Assert.IsTrue(Generic.GenericEquals(logConfiguration, logConfigurationReloaded)); Assert.AreEqual(Generic.GenericGetHashCode(logConfiguration), Generic.GenericGetHashCode(logConfigurationReloaded)); }