public void ConvertProcessorElementToEndpointWithEmptyProcessorConfigurator()
        {
            var element = new FileProcessorElement
            {
                Name             = "a",
                DropPath         = "b",
                Filter           = "*",
                SuccessPath      = "c",
                FailurePath      = "d",
                InProgressPath   = "e",
                ScavengeInterval = 100,
                RecoveryInterval = 100,
            };

            var expected = new FileProcessorEndpoint
            {
                Name                   = "a",
                DropPath               = "b",
                Filter                 = "*",
                SuccessPath            = "c",
                FailurePath            = "d",
                InProgressPath         = "e",
                NumberOfConsumers      = 1,
                ScavengeInterval       = new TimeSpan(0, 0, 100),
                RecoveryInterval       = new TimeSpan(0, 0, 100),
                ProcessorConfigurator  = "EnergyTrading.FileProcessing.Registrars.EventBasedProcessorDefaultRegistrar, EnergyTrading.Unity",
                AdditionalFilter       = typeof(DefaultFileFilter),
                PollingRestartInterval = new TimeSpan(0, 0, 60)
            };

            var candidate = element.ToEndpoint();

            this.Check(expected, candidate);
        }
        public void ConvertProcessorElementToEndpointWithSambaBasedProcessor()
        {
            var element = new FileProcessorElement
            {
                Name                      = "a",
                DropPath                  = "b",
                Filter                    = "*",
                SuccessPath               = "c",
                FailurePath               = "d",
                InProgressPath            = "e",
                ScavengeInterval          = 100,
                RecoveryInterval          = 100,
                ProcessorConfiguratorType = "PollingBased"
            };

            var expected = new FileProcessorEndpoint
            {
                Name                   = "a",
                DropPath               = "b",
                Filter                 = "*",
                SuccessPath            = "c",
                FailurePath            = "d",
                InProgressPath         = "e",
                NumberOfConsumers      = 1,
                ScavengeInterval       = new TimeSpan(0, 0, 100),
                RecoveryInterval       = new TimeSpan(0, 0, 100),
                ProcessorConfigurator  = FileProcessorEndpoint.PollingBasedConfiguratorType,
                AdditionalFilter       = typeof(DefaultFileFilter),
                PollingRestartInterval = new TimeSpan(0, 0, 60)
            };

            var candidate = element.ToEndpoint();

            this.Check(expected, candidate);
        }
        public void ConvertProcessorElementWithCustomFileFilter()
        {
            var element = new FileProcessorElement
            {
                Name             = "a",
                DropPath         = "b",
                Filter           = "*",
                SuccessPath      = "c",
                FailurePath      = "d",
                InProgressPath   = "e",
                Consumers        = 2,
                ScavengeInterval = 100,
                RecoveryInterval = 100,
                PollingInactivityRestartInterval = 100,
                Handler          = "EnergyTrading.UnitTest.FileProcessing.FileHandler, EnergyTrading.UnitTest",
                PostProcessor    = "EnergyTrading.UnitTest.FileProcessing.Configuration.ConfigurationExtensionsFixture+CustomPostProcessor, EnergyTrading.UnitTest",
                AdditionalFilter = "EnergyTrading.UnitTest.FileProcessing.Configuration.ConfigurationExtensionsFixture+CustomFileFilter, EnergyTrading.UnitTest"
            };

            var expected = new FileProcessorEndpoint
            {
                Name                   = "a",
                DropPath               = "b",
                Filter                 = "*",
                SuccessPath            = "c",
                FailurePath            = "d",
                InProgressPath         = "e",
                NumberOfConsumers      = 2,
                ScavengeInterval       = new TimeSpan(0, 0, 100),
                RecoveryInterval       = new TimeSpan(0, 0, 100),
                ProcessorConfigurator  = FileProcessorEndpoint.EventBasedConfiguratorType,
                Handler                = typeof(FileHandler),
                PollingRestartInterval = new TimeSpan(0, 0, 100),
                AdditionalFilter       = typeof(CustomFileFilter),
                PostProcessor          = typeof(CustomPostProcessor),
                PollingInterval        = 60000
            };

            var candidate = element.ToEndpoint();

            Check(expected, candidate);
        }