public void FileReverser_validate_input_forwards_validator_result(int validatorResult, int? expected)
        {
            // Given
            var validatorStub = new Mock<IInputValidator>();
            validatorStub.Setup(v => v.Validate(It.IsAny<string>())).Returns(validatorResult);
            var fileReverser = new App.FileReverser(null, null, validatorStub.Object, null, null);

            // When
            var result = fileReverser.ValidateInput(string.Empty);

            // Then
            result.Should().Be(expected);
        }
        public void FileReverser_validates_file_input()
        {
            // Given
            var validatorMock = new Mock<IInputValidator>();
            validatorMock.Setup(v => v.Validate(It.IsAny<string>())).Verifiable();
            var fileReverser = new App.FileReverser(null, null, validatorMock.Object, null, null);

            // When
            fileReverser.ValidateInput(string.Empty);

            // Then
            validatorMock.Verify();
        }
예제 #3
0
        public void FileReverser_validate_input_forwards_validator_result(int validatorResult, int?expected)
        {
            // Given
            var validatorStub = new Mock <IInputValidator>();

            validatorStub.Setup(v => v.Validate(It.IsAny <string>())).Returns(validatorResult);
            var fileReverser = new App.FileReverser(null, null, validatorStub.Object, null, null);

            // When
            var result = fileReverser.ValidateInput(string.Empty);

            // Then
            result.Should().Be(expected);
        }
예제 #4
0
        public void FileReverser_validates_file_input()
        {
            // Given
            var validatorMock = new Mock <IInputValidator>();

            validatorMock.Setup(v => v.Validate(It.IsAny <string>())).Verifiable();
            var fileReverser = new App.FileReverser(null, null, validatorMock.Object, null, null);

            // When
            fileReverser.ValidateInput(string.Empty);

            // Then
            validatorMock.Verify();
        }