Esempio n. 1
0
        public void WriteVersion()
        {
            // Arrange
            string result = null;

            m_mockBinaryWriter.Setup(writer => writer.Write(It.IsAny <byte[]>(), 0, It.IsAny <int>()))
            .Callback <byte[], int, int>((b, i, c) =>
                                         result = Encoding.ASCII.GetString(b, i, c - 2)).Returns(0);

            // Act
            m_builder.WriteVersion(1234567890);

            // Assert
            m_builder.WriteTo(m_mockBinaryWriter.Object);
            Assert.Equal(" 1234567890", result);
        }
Esempio n. 2
0
        public void WriteVersion()
        {
            // Arrange
            long result = -1;

            m_mockBinaryWriter.Setup(writer => writer.Write(It.IsAny <byte[]>(), 0, It.IsAny <int>()))
            .Callback <byte[], int, int>((b, i, c) =>
                                         result = BigEndianConverter.GetInt64(b, 16)).Returns(0);

            // Act
            m_builder.WriteVersion(1234567890123456L);

            // Assert
            m_builder.WriteTo(m_mockBinaryWriter.Object);
            Assert.Equal(1234567890123456L, result);
        }