Inheritance: ISagaMessage
		public void ShouldSerializeValueTypeArrays()
		{
			var message = new SampleMessage {Bytes = new byte[] {1, 2, 3}};
			var bytesEncoded = Convert.ToBase64String(message.Bytes);

			var serialized = _serializer.Serialize(message);
			serialized.InnerText.Should(Is.StringContaining(bytesEncoded), "serialized.InnerText.Should(Is.StringContaining(bytesEncoded))");

			var deserialized = (SampleMessage) _deserializer.Deserialize(serialized);
			deserialized.Bytes.Should(Is.EquivalentTo(message.Bytes), "deserialized.Bytes.Should(Is.EquivalentTo(message.Bytes))");
		}
		public void MessageReceived()
		{
			_sampleMessage = new SampleMessage();
			_profileGateway.Send(_sampleMessage);
		}
		public void ShouldSerializeSpecialSymbols()
		{
			var memoryStrem = new MemoryStream();
			//Special character with hexadecimal value 0x15 is inserted in Name. It is not empty.
			var sampleMessage = new SampleMessage {Name = ""};
			new AdvancedXmlSerializer().Serialize(new IMessage[] {sampleMessage}, memoryStrem);
			memoryStrem.Seek(0, SeekOrigin.Begin);
			var res = new AdvancedXmlSerializer().Deserialize(memoryStrem)[0] as SampleMessage;
			res.Name.Should(Be.Not.Empty, "res.Name.Should(Be.Not.Empty)");
		}
		public void CreateSampleMessageName(string sampleMessageName)
		{
			_message = new SampleMessage {Name = sampleMessageName, SagaId = Guid.NewGuid()};
		}
Beispiel #5
0
 public void MessageReceived()
 {
     _sampleMessage = new SampleMessage();
     _profileGateway.Send(_sampleMessage);
 }