public void Options_SingleFunctionNoProcessing_ReturnsSingleFunction()
        {
            // arrange
            _processor.Options.RefillInputmanipulationsQueue = true;
            _processor.SetInputManipulation(new TrimInputManipulation());

            // assert
            Assert.IsNotNull(_processor.InputManipulationQueue);
            Assert.AreEqual(1, _processor.InputManipulationQueue.Count);
            Assert.IsInstanceOf <TrimInputManipulation>(_processor.InputManipulationQueue.Peek());
        }
        public void TrimManipulation_ReturnCorrectValues(string input, string streetName, short?houseNumber, string houseNumberAffix)
        {
            // arrange
            _processor.SetInputManipulation(new TrimInputManipulation());

            // act
            OutputResult <GermanSimpleOutputFormat> result = _processor.Process(input);
            GermanSimpleOutputFormat address = result.ResolvedAddress;

            // assert
            Assert.AreEqual(streetName, address.StreetName);
            Assert.AreEqual(houseNumber, address.HouseNumber);
            Assert.AreEqual(houseNumberAffix, address.HouseNumberAffix);
        }
        public void EmptyConstructor_ProcessingNoOptions_ReturnsDefaultProcessingOptions()
        {
            // arrange
            var input     = "    Teststraße 123     ";
            var processor = new AddressSeparationProcessor <InputSameAsOutputOutputFormat>(null, null);

            // act
            processor.SetInputManipulation(new TrimInputManipulation());
            var result = processor.Process(input);

            // assert
            Assert.IsInstanceOf(typeof(DefaultProcessingOptions), processor.Options,
                                "Options should always be set at the beginning of Process().");
        }
        public void EmptyConstructor_SetInputManipulation_WillProcessFunction()
        {
            // arrange
            var input     = "    Teststraße 123     ";
            var processor = new AddressSeparationProcessor <InputSameAsOutputOutputFormat>(null, null);

            // act
            processor.SetInputManipulation(new TrimInputManipulation());
            var result = processor.Process(input);

            // assert
            string expectedOutput = input.Trim();

            Assert.IsTrue(result.AddressHasBeenResolved);
            Assert.AreEqual(input, result.RawAddress);
            Assert.AreEqual(expectedOutput, result.ResolvedAddress.WholeAddress);
        }