public void Setup() { var cryptoProvider = new CryptographyProviderFactory().CreateAeadCryptographyProvider( BlockCipherEngines.AES, BlockCipherModes.GCM); _connectionNodeSerializer = new XmlConnectionNodeSerializer(cryptoProvider, "myPassword1".ConvertToSecureString()); }
public void InheritanceNotSerialiedWhenFiltered(string attributeName, ConnectionInfo connectionInfo) { var saveFilter = new SaveFilter(true); _connectionNodeSerializer = new XmlConnectionNodeSerializer(_cryptographyProvider, "myPassword1".ConvertToSecureString(), saveFilter); var returnVal = _connectionNodeSerializer.SerializeConnectionInfo(connectionInfo); var targetAttribute = returnVal.Attribute(XName.Get(attributeName)); Assert.That(targetAttribute?.Value, Is.EqualTo(false.ToString())); }
public void AttributesNotSerializedWhenFiltered(string attributeName, ConnectionInfo connectionInfo) { var saveFilter = new SaveFilter(true); var cryptoProvider = new CryptographyProviderFactory().CreateAeadCryptographyProvider(BlockCipherEngines.AES, BlockCipherModes.GCM); _connectionNodeSerializer = new XmlConnectionNodeSerializer(cryptoProvider, "myPassword1".ConvertToSecureString(), saveFilter); var returnVal = _connectionNodeSerializer.SerializeConnectionInfo(connectionInfo); var targetAttribute = returnVal.Attribute(XName.Get(attributeName)); Assert.That(targetAttribute?.Value, Is.EqualTo(string.Empty)); }