public void testSetContent_byteArr() { byte[] rgbData = new byte[] { 1, 2, 3, 4, 5, 6, 7 }; Message instance = new EncryptMessage(); instance.SetContent(rgbData); byte[] result = instance.GetContent(); Assert.AreEqual(result, (rgbData)); }
public void testSetContent_String() { String strData = "12345678"; byte[] rgbData = new byte[] { 49, 50, 51, 52, 53, 54, 55, 56 }; Message instance = new EncryptMessage(); instance.SetContent(strData); byte[] result = instance.GetContent(); Assert.AreEqual(result, (rgbData)); }
static void Main(string[] args) { CustomerMessage customerMessage = new CustomerMessage( "Oscar Blancarte", "*****@*****.**", "554433445566"); Console.WriteLine("Original Message ==> " + customerMessage); IMessage message1 = new EncryptMessage("user", "HG58YZ3CR9123456", new SOAPEnvelopMessage( new XMLFormatterDecorate(customerMessage))).ProcessMessage(); Console.WriteLine("message1 =====================================>\n" + message1.GetContent() + "\n\n"); IMessage message2 = new SOAPEnvelopMessage( new EncryptMessage("user", "HG58YZ3CR9123456", new XMLFormatterDecorate(customerMessage))).ProcessMessage(); Console.WriteLine("message2 =====================================>\n" + message2.GetContent()); }