Beispiel #1
0
        public void Serialize_DoesNot_Handle()
        {
            // Arrange
            var formatter = new NullObjectFormatter(m_mockInner.Object);
            var flags     = -1;

            m_mockInner.Setup(inner => inner.Serialize <string>("test", out flags)).Returns(new ArraySegment <byte>());

            // Act
            var result = formatter.Serialize <string>("test", out flags);

            // Assert
            Assert.Equal(-1, flags);
            Assert.Equal(0, result.Count);
        }
Beispiel #2
0
        public void Serialize()
        {
            // Arrange
            var formatter = new NullObjectFormatter(m_mockInner.Object);
            var flags     = -1;

            // Act
            var result = formatter.Serialize <string>(null, out flags);

            // Assert
            Assert.Equal(0, flags);
            Assert.NotNull(result.Array);
            Assert.Equal(0, result.Offset);
            Assert.Equal(0, result.Count);
        }