public void PollingQueues() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("PollingQueues"); Assert.AreEqual(3, configuration.PollingQueues.Count()); ITaskProcessorPollingQueueConfiguration config = configuration.PollingQueues.First(); Assert.AreEqual("A", config.Key); Assert.AreEqual(TimeSpan.FromMinutes(1), config.PollInterval); Assert.IsTrue(config.IsMaster); Assert.IsFalse(config.IsActive); Assert.IsFalse(config.IsConcurrent); Assert.AreEqual(0, config.MaxWorkers); config = configuration.PollingQueues.Skip(1).First(); Assert.AreEqual("B", config.Key); Assert.AreEqual(TimeSpan.FromMinutes(2), config.PollInterval); Assert.IsFalse(config.IsMaster); Assert.IsTrue(config.IsActive); Assert.IsFalse(config.IsConcurrent); Assert.AreEqual(5, config.MaxWorkers); config = configuration.PollingQueues.Skip(2).First(); Assert.AreEqual("C", config.Key); Assert.AreEqual(TimeSpan.FromMinutes(3), config.PollInterval); Assert.IsFalse(config.IsMaster); Assert.IsTrue(config.IsActive); Assert.IsTrue(config.IsConcurrent); Assert.AreEqual(10, config.MaxWorkers); }
public void PollingJobs() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("PollingJobs"); Assert.AreEqual(3, configuration.PollingJobs.Count()); IPollingJobConfiguration config = configuration.PollingJobs.First(); Assert.AreEqual(typeof(FakePollingJob), config.ImplementationType); Assert.AreEqual(TimeSpan.FromMinutes(1), config.PollInterval); Assert.IsTrue(config.IsMaster); Assert.IsFalse(config.IsActive); Assert.IsFalse(config.IsConcurrent); config = configuration.PollingJobs.Skip(1).First(); Assert.AreEqual(typeof(FakePollingJob2), config.ImplementationType); Assert.AreEqual(TimeSpan.FromMinutes(2), config.PollInterval); Assert.IsFalse(config.IsMaster); Assert.IsTrue(config.IsActive); Assert.IsFalse(config.IsConcurrent); config = configuration.PollingJobs.Skip(2).First(); Assert.AreEqual(typeof(FakePollingJob3), config.ImplementationType); Assert.AreEqual(TimeSpan.FromMinutes(3), config.PollInterval); Assert.IsFalse(config.IsMaster); Assert.IsTrue(config.IsActive); Assert.IsTrue(config.IsConcurrent); }
public void ClientConfiguration() { ITaskProcessorClientConfiguration configuration = AppConfigConfigurationUnitTests.GetClientConfiguration("Client"); Assert.IsNull(configuration.GetPollingQueueKey(typeof(FakeTask))); Assert.AreEqual("Demo", configuration.GetPollingQueueKey(typeof(FakePollingQueueTask))); }
public void EmptyTaskWorkerConfiguration2() { ITaskWorkersConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskWorkerConfiguration("Empty2"); Assert.IsNotNull(configuration); Assert.IsNull(configuration[typeof(FakeTask)]); }
public void NegativePollingQueueMaxWorkers() { var configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("NegativePollingQueueMaxWorkers"); if (configuration.PollingQueues.First().MaxWorkers > 0) { } }
public void GetPollingJobImplementationTypeNotDescendant2() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("Empty"); if (configuration.PollingJobs[typeof(ICloneable)] == null) { } }
public void GetPollingJobNullImplementationType() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("Empty"); if (configuration.PollingJobs[null] == null) { } }
public void NegativeMaxTasks1() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("NegativeMaxTasks1"); if (configuration.Tasks.MaxWorkers > 0) { } }
public void GetTaskJobNullTaskType() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("Empty"); if (configuration.Tasks[null] == null) { } }
public void NegativeMaxTasks2() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("NegativeMaxTasks2"); if (configuration.Tasks[typeof(FakeTask)].MaxWorkers > 0) { } }
public void GetScheduledTaskInvalid() { ITaskSchedulerConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskSchedulerConfiguration("TaskScheduler"); if (configuration.ScheduledTasks[typeof(object)] == null) { } }
public void GetScheduledTaskNull() { ITaskSchedulerConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskSchedulerConfiguration("TaskScheduler"); if (configuration.ScheduledTasks[null] == null) { } }
public void SerializationConfiguration() { ITaskProcessorSerializationConfiguration configuration = AppConfigConfigurationUnitTests.GetSerializationtConfiguration("Serialization"); Assert.AreEqual(typeof(EntityBinarySerializer), configuration.GetSerializerType(typeof(FakeTask))); Assert.AreEqual(typeof(EntityXmlSerializer), configuration.GetSerializerType(typeof(ITask))); Assert.AreEqual(typeof(EntityBinaryXmlSerializer), configuration.GetSerializerType(typeof(object))); Assert.IsNull(configuration.GetSerializerType(typeof(FakePollingQueueTask))); }
public void TaskWorker() { ITaskWorkersConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskWorkerConfiguration("TaskWorker"); Assert.AreEqual(typeof(FakeTaskWorker), configuration[typeof(FakeTask)].WorkerType); Assert.AreEqual(typeof(FakeTaskWorker), configuration[typeof(FakePollingQueueTask)].WorkerType); Assert.IsTrue(configuration[typeof(FakeTask)].HasTaskJobSettings); Assert.IsFalse(configuration[typeof(FakePollingQueueTask)].HasTaskJobSettings); }
public void NoMaxTasks() { ITaskProcessorConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("NoMaxTasks"); Assert.IsNull(configuration.Tasks.MaxWorkers); ITaskJobConfiguration jobConfig = configuration.Tasks[typeof(IFakeTask)]; Assert.IsNotNull(jobConfig); Assert.AreEqual(typeof(IFakeTask), jobConfig.TaskType); Assert.IsNull(jobConfig.MaxWorkers); }
public void ClientConfigurationGetPollingQueueKeyTaskTypeNotFound() { ITaskProcessorClientConfiguration config = AppConfigConfigurationUnitTests.GetClientConfiguration("Empty"); config.GetPollingQueueKey(typeof(FakeTask)); }
public void InvalidScheduledTaskType() { AppConfigConfigurationUnitTests.GetTaskSchedulerConfiguration("InvalidScheduledTaskType"); }
public void TaskSchedulerEmptyScheduledTaskType() { AppConfigConfigurationUnitTests.GetTaskSchedulerConfiguration("EmptyScheduledTaskType"); }
public void TaskSchedulerWaitTrue() { ITaskSchedulerConfiguration configuration = AppConfigConfigurationUnitTests.GetTaskSchedulerConfiguration("WaitTrue"); Assert.IsTrue(configuration.ScheduledTasks[typeof(FakeScheduledTask)].WaitForPreviousSubmittedTaskToComplete); }
public void SerializationConfigurationGetSerializerTypeNull() { ITaskProcessorSerializationConfiguration configuration = AppConfigConfigurationUnitTests.GetSerializationtConfiguration("Serialization"); configuration.GetSerializerType(null); }
public void SerializationConfigurationDuplicateTask() { AppConfigConfigurationUnitTests.GetSerializationtConfiguration("DuplicateTask"); }
public void TaskWorkerDuplicateTask() { AppConfigConfigurationUnitTests.GetTaskWorkerConfiguration("DuplicateTask"); }
public void TaskWorkerInvalidWorkerType() { AppConfigConfigurationUnitTests.GetTaskWorkerConfiguration("InvalidWorkerType"); }
public void ClientConfigurationGetPollingQueueKeyInvalidTaskType() { ITaskProcessorClientConfiguration config = AppConfigConfigurationUnitTests.GetClientConfiguration("Client"); config.GetPollingQueueKey(typeof(ITimer)); }
public void ClientConfigurationDuplicatePollingQueue() { AppConfigConfigurationUnitTests.GetClientConfiguration("DuplicatePollingQueue"); }
public void ClientConfigurationAmbiguousTask() { AppConfigConfigurationUnitTests.GetClientConfiguration("AmbigousTask"); }
public void ClientConfigurationAmbiguousTaskPollingQueue() { AppConfigConfigurationUnitTests.GetClientConfiguration("AmbigousTaskPollingQueue"); }
public void TaskWorkerWorkerTypeNoParameterlessConstructor() { AppConfigConfigurationUnitTests.GetTaskWorkerConfiguration("WorkerTypeNoParameterlessConstructor"); }
public void EmptyTaskType() { AppConfigConfigurationUnitTests.GetTaskProcessorConfiguration("EmptyTaskType"); }
public void ClientConfigurationGetPollingQueueKeyNullTaskType() { ITaskProcessorClientConfiguration config = AppConfigConfigurationUnitTests.GetClientConfiguration("Client"); config.GetPollingQueueKey(null); }