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

            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.EventBasedConfiguratorType,
                AdditionalFilter = typeof(DefaultFileFilter),
                PollingRestartInterval = new TimeSpan(0, 0, 60)
            };

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

            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),
                PollingInterval = 130000
            };

            var candidate = element.ToEndpoint();
            Check(expected, candidate);
        }
        public void ConvertProcessorElementWithCustomProcessor()
        {
            var element = new FileProcessorElement
            {
                Name = "a",
                DropPath = "b",
                Filter = "*",
                SuccessPath = "c",
                FailurePath = "d",
                InProgressPath = "e",
                ScavengeInterval = 100,
                RecoveryInterval = 100,
                ProcessorConfiguratorType = "EnergyTrading.UnitTest.FileProcessing.Configuration.ConfigurationExtensionsFixture+CustomFileProcessor, EnergyTrading.UnitTest",
                Handler = "EnergyTrading.UnitTest.FileProcessing.FileHandler, EnergyTrading.UnitTest"
            };

            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.UnitTest.FileProcessing.Configuration.ConfigurationExtensionsFixture+CustomFileProcessor, EnergyTrading.UnitTest",
                Handler = typeof(FileHandler),
                AdditionalFilter = typeof(DefaultFileFilter),
                PollingRestartInterval = new TimeSpan(0, 0, 60)
            };

            var candidate = element.ToEndpoint();
            this.Check(expected, candidate);
        }