static MessageBase CreateMessage(bool encryption) { if (encryption) { // need a new instance of a message each time var message = new EncryptionTestMessage { Secret = MySecretMessage, CreditCard = new ClassForNesting { EncryptedProperty = MySecretMessage }, LargeByteArray = new byte[1], // the length of the array is not the issue now ListOfCreditCards = new List <ClassForNesting> { new ClassForNesting { EncryptedProperty = MySecretMessage }, new ClassForNesting { EncryptedProperty = MySecretMessage } } }; message.ListOfSecrets = new ArrayList(message.ListOfCreditCards); return(message); } return(new TestMessage()); }
static MessageBase CreateMessage(bool encryption) { if (encryption) { // need a new instance of a message each time var message = new EncryptionTestMessage { Secret = MySecretMessage, SecretField = MySecretMessage, CreditCard = new ClassForNesting { EncryptedProperty = MySecretMessage }, LargeByteArray = new byte[1], // the length of the array is not the issue now ListOfCreditCards = new List<ClassForNesting> { new ClassForNesting {EncryptedProperty = MySecretMessage}, new ClassForNesting {EncryptedProperty = MySecretMessage} } }; message.ListOfSecrets = new ArrayList(message.ListOfCreditCards); return message; } return new TestMessage(); }