public void ShouldUnpackNullSuccessfully() { var mockInput = new Mock <IInputStream>(); mockInput.Setup(x => x.ReadByte()).Returns(PackStream.NULL); var u = new PackStream.Unpacker(mockInput.Object, null); u.UnpackNull().Should().BeNull(); mockInput.Verify(x => x.ReadByte(), Times.Once); }
public void ShouldThrowExceptionIfMarkerByteNotNull() { var mockInput = new Mock <IInputStream>(); mockInput.Setup(x => x.ReadByte()).Returns(PackStream.BYTES_16); var unpacker = new PackStream.Unpacker(mockInput.Object, null); var ex = Xunit.Record.Exception(() => unpacker.UnpackNull()); ex.Should().BeOfType <ArgumentOutOfRangeException>(); }