Esempio n. 1
0
        public void OptimizedReader_Should_ThrowException_When_StreamEmpty()
        {
            // Arrange
            using (var ms = new MemoryStream(Encoding.UTF8.GetBytes("")))
            {
                var target = new OptimizedPositiveIntReader(ms);

                // Act
                target.NextInt();
            }
        }
Esempio n. 2
0
        public void OptimizedReader_Should_Return12_When_12AndSomeOtherText()
        {
            // Arrange
            using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(" \n 12 ")))
            {
                var target = new OptimizedPositiveIntReader(ms);

                // Act
                var result = target.NextInt();

                // Assert
                Assert.That(result, Is.EqualTo(12));
            }
        }