public void CurrentCharacter_ReturnsNullCharacterOfData_FaterMoveToEndIsCalled()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            const char expectedCharacter = CharacterBuffer.NullCharacter;

            // ACT
            var characterBuffer = new CharacterBuffer(data);
            characterBuffer.MoveToEnd();
            var actualCharacter = characterBuffer.CurrentCharacter;

            // ASSERT
            Assert.AreEqual(expectedCharacter, actualCharacter);
        }
        public void CurrentIndexPosition_ReturnsLastPosition_WhenClassConstructedWithDataAndMoveToEndCalled()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            int expectedIndexPosition = data.Length;

            // ACT
            var characterBuffer = new CharacterBuffer(data);
            characterBuffer.MoveToEnd();
            var actualIndexPosition = characterBuffer.CurrentIndex;

            // ASSERT
            Assert.AreEqual(expectedIndexPosition, actualIndexPosition);
        }
        public void CurrentIndexPosition_ReturnsZero_WhenClassConstructedWithDataAndMoveToStartCalledAfterMoveToEnd()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            const int expectedCurrentPosition = 0;

            // ACT
            var characterBuffer = new CharacterBuffer(data);
            characterBuffer.MoveToEnd();
            characterBuffer.MoveToStart();
            var actualCurrentPosition = characterBuffer.CurrentIndex;

            // ASSERT
            Assert.AreEqual(expectedCurrentPosition, actualCurrentPosition);
        }
        public void PreviousCharacter_ReturnslastCharacter_AfterMoveToEnd()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            char expectedCharacter = data.ToCharArray(data.Length - 1, 1)[0];

            // ACT
            var characterBuffer = new CharacterBuffer(data);
            characterBuffer.MoveToEnd();
            var actualCharacter = characterBuffer.PreviousCharacter;

            // ASSERT
            Assert.AreEqual(expectedCharacter, actualCharacter);
        }
        public void NextCharacter_ReturnsNullCharacter_AfterMoveToEndIsCalled()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            var characterBuffer = new CharacterBuffer(data);
            const char expectedCharacter = CharacterBuffer.NullCharacter;

            // ACT
            characterBuffer.MoveToEnd();
            var actualCharacter = characterBuffer.NextCharacter;

            // ASSERT
            Assert.AreEqual(actualCharacter, expectedCharacter);
        }
        public void MovePrevious_ReturnsTrue_WhenIndexIsNotAtStart()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            var characterBuffer = new CharacterBuffer(data);
            characterBuffer.MoveToEnd();

            // ACT
            var result = characterBuffer.MovePrevious();

            // ASSERT
            Assert.IsTrue(result);
        }
        public void MoveNext_ReturnsFalse_WhenIndexIsAtEnd()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            var characterBuffer = new CharacterBuffer(data);
            characterBuffer.MoveToEnd();

            // ACT
            var result = characterBuffer.MoveNext();

            // ASSERT
            Assert.IsFalse(result);
        }
        public void GetToEnd_ReturnsEmptyString_AfterMoveToEndIsCalled()
        {
            // ARRANGE
            const string data = Fakes.Literal.BasicLiteral;
            var characterBuffer = new CharacterBuffer(data);
            string expectedCharachter = string.Empty;

            // ACT
            characterBuffer.MoveToEnd();
            string actualData = characterBuffer.GetToEnd();

            // ASSERT
            Assert.AreEqual(actualData, expectedCharachter);
        }