public void PropertiesWithIgnoreAttributeArentSerialized() { var config = new ConfigClasses.ConfigurationWithEncryption { IgnoredVariable = "super_secret_variable" }; var s = new MiqoConfig() .Save(config) .ApplicationSettings() .ToString(); var deserializedConfig = new MiqoConfig() .Load() .ApplicationSettings() .FromString <ConfigClasses.ConfigurationWithEncryption>(s); Assert.Null(deserializedConfig.IgnoredVariable); }
public void SerializedConfigurationCanBeDeserialized() { var config = new ConfigClasses.ConfigurationWithEncryption { ServerName = "127.0.0.0" }; var s = new MiqoConfig() .Save(config) .ApplicationSettings() .ToString(); var deserializedConfig = new MiqoConfig() .Load() .ApplicationSettings() .FromString <ConfigClasses.ConfigurationWithEncryption>(s); Assert.Equal(config.ServerName, deserializedConfig.ServerName); }
public void PropertiesCanBeEncryptedAndDecrypted() { var config = new ConfigClasses.ConfigurationWithEncryption { ConnectionString = "super_secret_connection_string" }; var s = new MiqoConfig() .Save(config) .ApplicationSettings() .ToString(); Assert.DoesNotContain("super_secret_connection_string", s); var deserializedConfig = new MiqoConfig() .Load() .ApplicationSettings() .FromString <ConfigClasses.ConfigurationWithEncryption>(s); Assert.Equal("super_secret_connection_string", deserializedConfig.ConnectionString); }