public void TestWriteReadLong() { NmsStreamMessage streamMessage = factory.CreateStreamMessage(); long value = long.MaxValue; streamMessage.WriteInt64(value); streamMessage.Reset(); Assert.AreEqual(value, streamMessage.ReadInt64(), "Value not as expected"); }
public void TestWriteLongReadLegal() { NmsStreamMessage streamMessage = factory.CreateStreamMessage(); long value = long.MaxValue; streamMessage.WriteInt64(value); streamMessage.Reset(); AssertGetStreamEntryEquals <long>(streamMessage, true, value); AssertGetStreamEntryEquals <string>(streamMessage, true, value.ToString()); }
public void TestResetAppliesCorrectState() { NmsStreamMessage streamMessage = factory.CreateStreamMessage(); streamMessage.WriteDouble(24.5); streamMessage.WriteInt64(311); streamMessage.Reset(); Assert.True(streamMessage.IsReadOnlyBody); Assert.AreEqual(streamMessage.ReadDouble(), 24.5); Assert.AreEqual(streamMessage.ReadInt64(), 311); Assert.Throws <MessageNotWriteableException>(() => streamMessage.WriteInt32(33)); }
public void TestWriteLongReadIllegal() { NmsStreamMessage streamMessage = factory.CreateStreamMessage(); long value = long.MaxValue; streamMessage.WriteInt64(value); streamMessage.Reset(); AssertGetStreamEntryThrowsMessageFormatException <bool>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <byte>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <short>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <char>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <int>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <float>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <double>(streamMessage); AssertGetStreamEntryThrowsMessageFormatException <byte[]>(streamMessage); }
public void WriteInt64(long value) { message.WriteInt64(value); }