├── .gitignore ├── CHANGELOG.md ├── Lib ├── Aq.ExpressionJsonSerializer │ ├── README.md │ ├── net461 │ │ ├── Aq.ExpressionJsonSerializer.dll │ │ └── Aq.ExpressionJsonSerializer.pdb │ ├── net472 │ │ ├── Aq.ExpressionJsonSerializer.dll │ │ └── Aq.ExpressionJsonSerializer.pdb │ ├── net48 │ │ ├── Aq.ExpressionJsonSerializer.dll │ │ └── Aq.ExpressionJsonSerializer.pdb │ ├── net6.0 │ │ ├── Aq.ExpressionJsonSerializer.deps.json │ │ ├── Aq.ExpressionJsonSerializer.dll │ │ └── Aq.ExpressionJsonSerializer.pdb │ └── netstandard2.0 │ │ ├── Aq.ExpressionJsonSerializer.deps.json │ │ ├── Aq.ExpressionJsonSerializer.dll │ │ └── Aq.ExpressionJsonSerializer.pdb ├── GuerrillaNtp │ ├── README.md │ ├── net461 │ │ ├── GuerrillaNtp.dll │ │ └── GuerrillaNtp.pdb │ ├── net472 │ │ ├── GuerrillaNtp.dll │ │ └── GuerrillaNtp.pdb │ ├── net48 │ │ ├── GuerrillaNtp.dll │ │ └── GuerrillaNtp.pdb │ ├── net6.0 │ │ ├── GuerrillaNtp.deps.json │ │ ├── GuerrillaNtp.dll │ │ └── GuerrillaNtp.pdb │ └── netstandard2.0 │ │ ├── GuerrillaNtp.deps.json │ │ ├── GuerrillaNtp.dll │ │ └── GuerrillaNtp.pdb ├── JpLabs.DynamicCode │ ├── JpLabs.DynamicCode.dll │ ├── JpLabs.DynamicCode.pdb │ └── README.md └── Schyntax │ ├── README.md │ ├── net461 │ ├── Schyntax.dll │ └── Schyntax.pdb │ ├── net472 │ ├── Schyntax.dll │ └── Schyntax.pdb │ ├── net48 │ ├── Schyntax.dll │ └── Schyntax.pdb │ ├── net6.0 │ ├── Schyntax.deps.json │ ├── Schyntax.dll │ └── Schyntax.pdb │ └── netstandard2.0 │ ├── Schyntax.deps.json │ ├── Schyntax.dll │ └── Schyntax.pdb ├── License.md ├── README.md ├── SharedAssemblyInfo.cs ├── Source ├── DotNetWorkQueue.AppMetrics.Tests │ ├── Counter.cs │ ├── DotNetWorkQueue.AppMetrics.Tests.csproj │ ├── ExtensionMethods.cs │ ├── ExtensionMethodsTests.cs │ ├── Histogram.cs │ ├── Meter.cs │ ├── Metrics.cs │ ├── MetricsContext.cs │ └── Timer.cs ├── DotNetWorkQueue.AppMetrics │ ├── Counter.cs │ ├── DotNetWorkQueue.AppMetrics.csproj │ ├── ExtensionMethods.cs │ ├── Histogram.cs │ ├── InternalsVisibleForTests.cs │ ├── Meter.cs │ ├── Metrics.cs │ ├── MetricsContext.cs │ ├── MetricsStatic.cs │ ├── Timer.cs │ └── TimerContext.cs ├── DotNetWorkQueue.IntegrationTests.Metrics │ ├── Counter.cs │ ├── DotNetWorkQueue.IntegrationTests.Metrics.csproj │ ├── Histogram.cs │ ├── Meter.cs │ ├── Metrics.cs │ ├── MetricsContext.cs │ ├── MetricsData.cs │ ├── Timer.cs │ └── TimerContext.cs ├── DotNetWorkQueue.IntegrationTests.Shared │ ├── Admin │ │ ├── AdminSharedConsumer.cs │ │ └── Implementation │ │ │ └── SimpleConsumerAdmin.cs │ ├── Consumer │ │ ├── ConsumerCancelWorkShared.cs │ │ ├── ConsumerErrorShared.cs │ │ ├── ConsumerExpiredMessageShared.cs │ │ ├── ConsumerHeartbeatShared.cs │ │ ├── ConsumerPoisonMessageShared.cs │ │ ├── ConsumerRollBackShared.cs │ │ ├── ConsumerShared.cs │ │ └── Implementation │ │ │ ├── ConsumerCancelWork.cs │ │ │ ├── ConsumerErrorTable.cs │ │ │ ├── ConsumerExpiredMessage.cs │ │ │ ├── ConsumerHeartbeat.cs │ │ │ ├── ConsumerPoisonMessage.cs │ │ │ ├── ConsumerRollBack.cs │ │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorShared.cs │ │ ├── ConsumerAsyncPoisonMessageShared.cs │ │ ├── ConsumerAsyncRollBackShared.cs │ │ ├── ConsumerAsyncShared.cs │ │ └── Implementation │ │ │ ├── ConsumerAsyncErrorTable.cs │ │ │ ├── ConsumerAsyncPoisonMessage.cs │ │ │ ├── ConsumerAsyncRollBack.cs │ │ │ ├── MultiConsumerAsync.cs │ │ │ └── SimpleConsumerAsync.cs │ ├── ConsumerMethod │ │ ├── ConsumerMethodCancelWorkShared.cs │ │ ├── ConsumerMethodErrorShared.cs │ │ ├── ConsumerMethodExpiredMessageShared.cs │ │ ├── ConsumerMethodHeartbeatShared.cs │ │ ├── ConsumerMethodPoisonMessageShared.cs │ │ ├── ConsumerMethodRollBackShared.cs │ │ ├── ConsumerMethodShared.cs │ │ └── Implementation │ │ │ ├── ConsumerMethodCancelWork.cs │ │ │ ├── ConsumerMethodErrorTable.cs │ │ │ ├── ConsumerMethodExpiredMessage.cs │ │ │ ├── ConsumerMethodHeartbeat.cs │ │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ │ ├── ConsumerMethodPoisonMessage.cs │ │ │ ├── ConsumerMethodRollBack.cs │ │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ ├── ConsumerMethodAsyncErrorShared.cs │ │ ├── ConsumerMethodAsyncPoisonMessageShared.cs │ │ ├── ConsumerMethodAsyncRollBackShared.cs │ │ ├── ConsumerMethodAsyncShared.cs │ │ └── Implementation │ │ │ ├── ConsumerMethodAsyncErrorTable.cs │ │ │ ├── ConsumerMethodAsyncPoisonMessage.cs │ │ │ ├── ConsumerMethodAsyncRollBack.cs │ │ │ └── SimpleMethodConsumerAsync.cs │ ├── CreateNotifications.cs │ ├── DotNetWorkQueue.IntegrationTests.Shared.csproj │ ├── ExtensionMethods.cs │ ├── Helpers.cs │ ├── JobScheduler │ │ ├── Implementation │ │ │ ├── JobSchedulerMultipleTests.cs │ │ │ └── JobSchedulerTests.cs │ │ └── JobSchedulerTestsShared.cs │ ├── LoggerShared.cs │ ├── MessageHandlingShared.cs │ ├── Messages.cs │ ├── Producer │ │ ├── Implementation │ │ │ ├── MultiProducer.cs │ │ │ ├── SimpleProducer.cs │ │ │ └── SimpleProducerAsync.cs │ │ ├── ProducerAsyncShared.cs │ │ └── ProducerShared.cs │ ├── ProducerMethod │ │ ├── Implementation │ │ │ ├── MultiMethodProducer.cs │ │ │ ├── SimpleMethodProducer.cs │ │ │ └── SimpleMethodProducerAsync.cs │ │ ├── ProducerMethodAsyncShared.cs │ │ ├── ProducerMethodMultipleDynamicShared.cs │ │ └── ProducerMethodShared.cs │ ├── Route │ │ ├── Implementation │ │ │ ├── RouteMultiTests.cs │ │ │ └── RouteTests.cs │ │ ├── RouteMultiTestsShared.cs │ │ └── RouteTestsShared.cs │ ├── SharedSetup.cs │ ├── TraceSettings.cs │ ├── UserDequeue │ │ ├── Implementation │ │ │ └── UserDeQueueTests.cs │ │ └── UserDequeueTestsShared.cs │ └── VerifyMetrics.cs ├── DotNetWorkQueue.Tests │ ├── Configuration │ │ ├── BaseConnectionInformationTests.cs │ │ ├── HeartBeatConfigurationTests.cs │ │ ├── HeartBeatThreadPoolConfigurationTests.cs │ │ ├── MessageErrorConfigurationTests.cs │ │ ├── MessageExpirationConfigurationTests.cs │ │ ├── QueueConfigurationReceiveTests.cs │ │ ├── QueueConfigurationSendTests.cs │ │ ├── QueueConsumerConfigurationTests.cs │ │ ├── QueueDelayTests.cs │ │ ├── QueueProducerConfigurationTests.cs │ │ ├── RetryDelayTests.cs │ │ ├── TaskSchedulerConfigurationTests.cs │ │ ├── TransportConfigurationReceiveTests.cs │ │ ├── TransportConfigurationSendTests.cs │ │ └── WorkerConfigurationTests.cs │ ├── DotNetWorkQueue.Tests.csproj │ ├── Exceptions │ │ ├── CommitExceptionTests.cs │ │ ├── CompileExceptionTests.cs │ │ ├── DotNetWorkQueueExceptionTests.cs │ │ ├── InterceptorExceptionTests.cs │ │ ├── JobSchedulerExceptionTests.cs │ │ ├── MessageExceptionTests.cs │ │ ├── PoisonMessageExceptionTests.cs │ │ ├── ReceiveMessageExceptionTests.cs │ │ └── SerializationExceptionTests.cs │ ├── Factory │ │ ├── GetTimeFactoryNoOpTests.cs │ │ ├── HeartBeatWorkerFactoryTests.cs │ │ ├── MessageContextDataFactoryTests.cs │ │ ├── MessageContextFactoryTests.cs │ │ ├── MessageFactoryTests.cs │ │ ├── MessageProcessingFactoryTests.cs │ │ ├── QueueDelayFactoryTests.cs │ │ ├── QueueWaitFactoryTests.cs │ │ ├── ReceivedMessageFactoryTests.cs │ │ ├── RetryDelayFactoryTests.cs │ │ ├── RetryInformationFactoryTests.cs │ │ ├── SentMessageFactoryTests.cs │ │ ├── WaitForEventOrCancelFactoryTests.cs │ │ ├── WorkerFactoryTests.cs │ │ ├── WorkerHeartBeatNotificationFactoryTests.cs │ │ ├── WorkerNameFactoryTests.cs │ │ ├── WorkerNotificationFactoryNoOpTests.cs │ │ └── WorkerNotificationFactoryTests.cs │ ├── Helpers.cs │ ├── Interceptors │ │ ├── GzipInterceptorTest.cs │ │ ├── InterceptionTest.cs │ │ └── TripleDESInterceptorTest.cs │ ├── IoC │ │ └── CreateContainerTest.cs │ ├── Messages │ │ ├── AdditionalMessageDataTests.cs │ │ ├── AdditionalMetaDataTests.cs │ │ ├── CustomHeadersTests.cs │ │ ├── GenerateReceivedMessageTests.cs │ │ ├── GetPreviousErrorsNoOp.cs │ │ ├── HeadersTests.cs │ │ ├── MessageContextDataTests.cs │ │ ├── MessageContextTests.cs │ │ ├── MessageHandlerAsyncTests.cs │ │ ├── MessageHandlerRegistrationAsyncTests.cs │ │ ├── MessageHandlerRegistrationTests.cs │ │ ├── MessageHandlerTests.cs │ │ ├── MessageMethodHandlingTests.cs │ │ ├── MessageTests.cs │ │ ├── ReceivedMessageInternalTests.cs │ │ ├── ReceivedMessageTests.cs │ │ ├── RegisterMessagesAsyncTests.cs │ │ ├── RegisterMessagesTests.cs │ │ ├── SentMessageTests.cs │ │ ├── SettingTests.cs │ │ └── StandardHeadersTests.cs │ ├── Metrics │ │ └── NoOp │ │ │ └── MetricsNoOpTests.cs │ ├── Notifications │ │ ├── ErrorNotificationTests.cs │ │ ├── ErrorReceiveNotificationTests.cs │ │ ├── MessageCompleteNotificationTests.cs │ │ ├── PoisonMessageNotificationTests.cs │ │ └── RollBackNotificationTests.cs │ ├── Queue │ │ ├── AbortWorkerThreadTests.cs │ │ ├── BaseMonitorTests.cs │ │ ├── BaseQueueTests.cs │ │ ├── ClearErrorMessagesNoOp.cs │ │ ├── ClearExpiredMessagesMonitorNoOpTests.cs │ │ ├── ClearExpiredMessagesMonitorTests.cs │ │ ├── CommitMessageTests.cs │ │ ├── ConsumerMethodQueueTests.cs │ │ ├── ConsumerQueueAsyncTests.cs │ │ ├── ConsumerQueueTests.cs │ │ ├── GetHeaderDefaultTests.cs │ │ ├── HeartBeatMonitorNoOpTests.cs │ │ ├── HeartBeatMonitorTests.cs │ │ ├── HeartBeatStatusTests.cs │ │ ├── HeartBeatWorkerNoOpTests.cs │ │ ├── HeartBeatWorkerTests.cs │ │ ├── MessageExceptionHandlerTests.cs │ │ ├── MessageProcessingAsyncTests.cs │ │ ├── MessageProcessingTests.cs │ │ ├── ProducerMethodQueueTests.cs │ │ ├── ProducerQueueTests.cs │ │ ├── QueueCancelWorkTests.cs │ │ ├── QueueMonitorTests.cs │ │ ├── QueueScriptTests.cs │ │ ├── QueueWaitNoOpTests.cs │ │ ├── QueueWaitTests.cs │ │ ├── StopWorkerTests.cs │ │ ├── WaitForDelegateTests.cs │ │ ├── WaitForEventOrCancelTests.cs │ │ ├── WaitForThreadToFinishTests.cs │ │ ├── WaitOnAsyncTaskTests.cs │ │ ├── WorkerCollectionTests.cs │ │ ├── WorkerErrorEventArgsTests.cs │ │ ├── WorkerHeartBeatNotificationNoOpTests.cs │ │ ├── WorkerHeartBeatNotificationTests.cs │ │ ├── WorkerNotificationNoOpTests.cs │ │ ├── WorkerNotificationTests.cs │ │ ├── WorkerTests.cs │ │ └── WorkerWaitForEventOrCancelTests.cs │ ├── QueueCreationResultTests.cs │ ├── QueueCreatorTests.cs │ ├── QueueRemoveResultTests.cs │ ├── SchedulerCreatorTests.cs │ ├── Serialization │ │ ├── JsonExpressionSerializerTests.cs │ │ ├── JsonSerializerInternalTests.cs │ │ └── JsonSerializerTests.cs │ ├── TaskScheduling │ │ ├── MessageHandlerTests.cs │ │ ├── SchedulerInitTests.cs │ │ ├── SchedulerMethodTests.cs │ │ ├── SchedulerTaskFactoryTests.cs │ │ ├── SchedulerTests.cs │ │ ├── SmartThreadPoolTaskSchedulerTests.cs │ │ ├── StateInformationTests.cs │ │ ├── ThreadPoolConfigurationTests.cs │ │ ├── WaitForEventOrCancelThreadPoolTests.cs │ │ ├── WorkGroupTests.cs │ │ └── WorkGroupWithItemTests.cs │ ├── Time │ │ └── LocalMachineTimeTests.cs │ ├── Transport │ │ ├── CreateScheduleProducerAndConsumer.cs │ │ └── Memory │ │ │ ├── Basic │ │ │ ├── ClearExpiredMessagesTests.cs │ │ │ ├── CreationScopeTests.cs │ │ │ ├── JobTableCreationTests.cs │ │ │ ├── Message │ │ │ │ └── RollbackMessageTests.cs │ │ │ ├── MessageQueueCreationTests.cs │ │ │ ├── ResetHeartBeatTests.cs │ │ │ └── SendHeartBeatTests.cs │ │ │ ├── ConfigurationExtensionsForIAdditionalMessageDataTests.cs │ │ │ ├── ConfigurationExtensionsForQueueConfigurationReceiveTests.cs │ │ │ ├── ConfigurationExtensionsForQueueConfigurationSendTests.cs │ │ │ ├── ConnectionInformationTests.cs │ │ │ └── TransportOptionsTests.cs │ └── app.config ├── DotNetWorkQueue.Transport.LiteDB.IntegrationTests │ ├── Admin │ │ └── SimpleConsumer.cs │ ├── ConnectionString.cs │ ├── Consumer │ │ ├── ConsumerCancelWork.cs │ │ ├── ConsumerErrorTable.cs │ │ ├── ConsumerExpiredMessage.cs │ │ ├── ConsumerHeartbeat.cs │ │ ├── ConsumerPoisonMessage.cs │ │ ├── ConsumerRollBack.cs │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorTable.cs │ │ ├── ConsumerAsyncPoisonMessage.cs │ │ ├── ConsumerAsyncRollBack.cs │ │ ├── MultiConsumerAsync.cs │ │ └── SimpleConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.LiteDb.IntegrationTests.csproj │ ├── GenerateQueueName.cs │ ├── Producer │ │ ├── MultiProducer.cs │ │ ├── SimpleProducer.cs │ │ ├── SimpleProducerAsync.cs │ │ ├── SimpleProducerAsyncBatch.cs │ │ └── SimpleProducerBatch.cs │ ├── Route │ │ ├── RouteMultiTests.cs │ │ └── RouteTests.cs │ ├── SharedClasses.cs │ └── VerifyQueueData.cs ├── DotNetWorkQueue.Transport.LiteDB.Linq.Integration.Tests │ ├── ConsumerMethod │ │ ├── ConsumerMethodCancelWork.cs │ │ ├── ConsumerMethodErrorTable.cs │ │ ├── ConsumerMethodExpiredMessage.cs │ │ ├── ConsumerMethodHeartbeat.cs │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ ├── ConsumerMethodPoisonMessage.cs │ │ ├── ConsumerMethodRollBack.cs │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ ├── ConsumerMethodAsyncErrorTable.cs │ │ ├── ConsumerMethodAsyncPoisonMessage.cs │ │ ├── ConsumerMethodAsyncRollBack.cs │ │ └── SimpleMethodConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.LiteDb.Linq.Integration.Tests.csproj │ ├── JobScheduler │ │ ├── JobSchedulerMultipleTests.cs │ │ └── JobSchedulerTests.cs │ └── ProducerMethod │ │ ├── MultiMethodProducer.cs │ │ ├── SimpleMethodProducer.cs │ │ ├── SimpleMethodProducerAsync.cs │ │ ├── SimpleMethodProducerAsyncBatch.cs │ │ └── SimpleMethodProducerBatch.cs ├── DotNetWorkQueue.Transport.LiteDB │ ├── Basic │ │ ├── Admin │ │ │ └── AdminFunctions.cs │ │ ├── Command │ │ │ ├── CreateJobTablesCommand.cs │ │ │ ├── CreateQueueTablesAndSaveConfigurationCommand.cs │ │ │ ├── DeleteQueueTablesCommand.cs │ │ │ └── SetJobLastKnownEventCommand.cs │ │ ├── CommandHandler │ │ │ ├── CreateJobTablesCommandHandler.cs │ │ │ ├── CreateQueueTablesAndSaveConfigurationCommandHandler.cs │ │ │ ├── DeleteMessageCommandHandler.cs │ │ │ ├── DeleteQueueTablesCommandHandler.cs │ │ │ ├── MoveRecordToErrorQueueCommandHandler.cs │ │ │ ├── ResetHeartBeatCommandHandler.cs │ │ │ ├── RollbackMessageCommandHandler.cs │ │ │ ├── SendHeartBeatCommandHandler.cs │ │ │ ├── SendMessageCommandHandler.cs │ │ │ ├── SendMessageCommandHandlerAsync.cs │ │ │ ├── SetErrorCountCommandHandler.cs │ │ │ └── SetJobLastKnownEventCommandHandler.cs │ │ ├── ConnectionStringInfo.cs │ │ ├── CreationScope.cs │ │ ├── DatabaseExists.cs │ │ ├── Factory │ │ │ ├── LiteDbCorrelationIdFactory.cs │ │ │ ├── LiteDbMessageQueueTransportOptionsFactory.cs │ │ │ └── LiteDbReceiveMessagesFactory.cs │ │ ├── ITable.cs │ │ ├── LiteDbConnection.cs │ │ ├── LiteDbConnectionManager.cs │ │ ├── LiteDbGetFileNameFromConnectionString.cs │ │ ├── LiteDbGetFirstMessageDeliveryTime.cs │ │ ├── LiteDbGetPreviousMessageErrors.cs │ │ ├── LiteDbJobQueueCreation.cs │ │ ├── LiteDbJobSchedulerLastKnownEvent.cs │ │ ├── LiteDbJobSchema.cs │ │ ├── LiteDbJobTableCreation.cs │ │ ├── LiteDbMessageQueueCreation.cs │ │ ├── LiteDbMessageQueueInit.cs │ │ ├── LiteDbMessageQueueSchema.cs │ │ ├── LiteDbMessageQueueTransportOptions.cs │ │ ├── LiteDbQueueReceiveMessages.cs │ │ ├── LiteDbRollbackMessage.cs │ │ ├── LiteDbSendJobToQueue.cs │ │ ├── Message │ │ │ ├── ReceiveMessage.cs │ │ │ └── RollbackMessage.cs │ │ ├── MessageExpiration.cs │ │ ├── Query │ │ │ ├── DoesJobExistQuery.cs │ │ │ ├── GetQueueCountQuery.cs │ │ │ ├── GetQueueOptionsQuery.cs │ │ │ ├── GetTableExistsQuery.cs │ │ │ └── ReceiveMessageQuery.cs │ │ ├── QueryHandler │ │ │ ├── DoesJobExistQueryHandler.cs │ │ │ ├── FindErrorRecordsToDeleteQueryHandler.cs │ │ │ ├── FindExpiredRecordsToDeleteQueryHandler.cs │ │ │ ├── FindRecordsToResetByHeartBeatQueryHandler.cs │ │ │ ├── GetErrorRetryCountQueryHandler.cs │ │ │ ├── GetHeaderQueryHandler.cs │ │ │ ├── GetJobIdQueryHandler.cs │ │ │ ├── GetJobLastKnownEventQueryHandler.cs │ │ │ ├── GetMessageErrorsQueryHandler.cs │ │ │ ├── GetQueueCountQueryHandler.cs │ │ │ ├── GetQueueOptionsQueryHandler.cs │ │ │ ├── GetTableExistsQueryHandler.cs │ │ │ ├── MessageDeQueue.cs │ │ │ └── ReceiveMessageQueryHandler.cs │ │ └── TableNameHelper.cs │ ├── ConfigurationExtensions.cs │ ├── DotNetWorkQueue.Transport.LiteDB.xml │ ├── DotNetWorkQueue.Transport.LiteDb.csproj │ ├── IGetFileNameFromConnectionString.cs │ ├── IJobSchema.cs │ ├── ILiteDbMessageQueueTransportOptionsFactory.cs │ ├── InternalsVisibleForTests.cs │ ├── LiteDbConnectionInformation.cs │ ├── Schema │ │ ├── ConfigurationTable.cs │ │ ├── ErrorTrackingTable.cs │ │ ├── JobsTable.cs │ │ ├── MetaDataErrorsTable.cs │ │ ├── MetaDataTable.cs │ │ ├── QueueTable.cs │ │ └── StatusTable.cs │ └── Trace │ │ ├── Decorator │ │ ├── RollbackMessageCommandHandlerDecorator.cs │ │ ├── SendMessageCommandHandlerAsyncDecorator.cs │ │ └── SendMessageCommandHandlerDecorator.cs │ │ └── TraceExtensions.cs ├── DotNetWorkQueue.Transport.LiteDb.Tests │ ├── ConfigurationExtensionsForIAdditionalMessageDataTests.cs │ ├── DotNetWorkQueue.Transport.LiteDb.Tests.csproj │ └── LiteDbConnectionInformationTests.cs ├── DotNetWorkQueue.Transport.Memory.Integration.Tests │ ├── Admin │ │ └── SimpleConsumer.cs │ ├── AssemblyInfo.cs │ ├── Consumer │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorTable.cs │ │ ├── MultiConsumerAsync.cs │ │ └── SimpleConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.Memory.Integration.Tests.csproj │ ├── GenerateQueueName.cs │ ├── IntegrationConnectionInfo.cs │ ├── Producer │ │ ├── MultiProducer.cs │ │ ├── SimpleProducer.cs │ │ ├── SimpleProducerAsync.cs │ │ ├── SimpleProducerAsyncBatch.cs │ │ └── SimpleProducerBatch.cs │ ├── SharedClasses.cs │ └── VerifyQueueData.cs ├── DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests │ ├── AssemblyInfo.cs │ ├── ConsumerMethod │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ └── SimpleMethodConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests.csproj │ ├── GenerateQueueName.cs │ ├── IntegrationConnectionInfo.cs │ ├── JobScheduler │ │ └── JobSchedulerTests.cs │ ├── ProducerMethod │ │ ├── MultiMethodProducer.cs │ │ ├── SimpleMethodProducer.cs │ │ ├── SimpleMethodProducerAsync.cs │ │ ├── SimpleMethodProducerAsyncBatch.cs │ │ └── SimpleMethodProducerBatch.cs │ ├── SharedClasses.cs │ └── VerifyQueueData.cs ├── DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests │ ├── Admin │ │ └── SimpleConsumer.cs │ ├── AssemblyInfo.cs │ ├── ConnectionString.cs │ ├── Consumer │ │ ├── ConsumerCancelWork.cs │ │ ├── ConsumerErrorTable.cs │ │ ├── ConsumerExpiredMessage.cs │ │ ├── ConsumerHeartbeat.cs │ │ ├── ConsumerPoisonMessage.cs │ │ ├── ConsumerRollBack.cs │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorTable.cs │ │ ├── ConsumerAsyncPoisonMessage.cs │ │ ├── ConsumerAsyncRollBack.cs │ │ ├── MultiConsumerAsync.cs │ │ └── SimpleConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests.csproj │ ├── GenerateQueueName.cs │ ├── Producer │ │ ├── MultiProducer.cs │ │ ├── SimpleProducer.cs │ │ ├── SimpleProducerAsync.cs │ │ ├── SimpleProducerAsyncBatch.cs │ │ └── SimpleProducerBatch.cs │ ├── Route │ │ ├── RouteMultiTests.cs │ │ └── RouteTests.cs │ ├── SharedClasses.cs │ ├── UserDequeue │ │ └── UserDequeue.cs │ └── VerifyQueueData.cs ├── DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests │ ├── AssemblyInfo.cs │ ├── ConsumerMethod │ │ ├── ConsumerMethodCancelWork.cs │ │ ├── ConsumerMethodErrorTable.cs │ │ ├── ConsumerMethodExpiredMessage.cs │ │ ├── ConsumerMethodHeartbeat.cs │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ ├── ConsumerMethodPoisonMessage.cs │ │ ├── ConsumerMethodRollBack.cs │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ ├── ConsumerMethodAsyncErrorTable.cs │ │ ├── ConsumerMethodAsyncPoisonMessage.cs │ │ ├── ConsumerMethodAsyncRollBack.cs │ │ └── SimpleConsumerMethodAsync.cs │ ├── DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests.csproj │ ├── JobScheduler │ │ ├── JobSchedulerMultipleTests.cs │ │ └── JobSchedulerTests.cs │ └── ProducerMethod │ │ ├── MultiProducerMethod.cs │ │ ├── SimpleProducerMethod.cs │ │ ├── SimpleProducerMethodAsync.cs │ │ ├── SimpleProducerMethodAsyncBatch.cs │ │ └── SimpleProducerMethodBatch.cs ├── DotNetWorkQueue.Transport.PostgreSQL.Tests │ ├── Basic │ │ ├── Command │ │ │ └── CreateQueueTablesAndSaveConfigurationCommandTests.cs │ │ ├── Factory │ │ │ └── SqlServerMessageQueueTransportOptionsFactoryTests.cs │ │ ├── SqlServerCommandStringCacheTests.cs │ │ ├── SqlServerMessageQueueSchemaTests.cs │ │ └── SqlServerMessageQueueTransportOptionsTests.cs │ ├── DotNetWorkQueue.Transport.PostgreSQL.Tests.csproj │ ├── Helpers.cs │ ├── Schema │ │ ├── ColumnTests.cs │ │ ├── ColumnsTests.cs │ │ ├── ConstraintTests.cs │ │ └── TableTests.cs │ └── SqlConnectionInformationTests.cs ├── DotNetWorkQueue.Transport.PostgreSQL │ ├── Basic │ │ ├── BuildMoveToErrorQueueSql.cs │ │ ├── CommandHandler │ │ │ ├── RollbackMessageCommandHandler.cs │ │ │ ├── SendMessage.cs │ │ │ ├── SendMessageCommandHandler.cs │ │ │ ├── SendMessageCommandHandlerAsync.cs │ │ │ └── SetJobLastKnownEventCommandHandler.cs │ │ ├── CommandPrepareHandler │ │ │ ├── DeleteTableCommandPrepareHandler.cs │ │ │ └── ResetHeartBeatCommandPrepareHandler.cs │ │ ├── ConnectionHolder.cs │ │ ├── DbConnectionFactory.cs │ │ ├── Factory │ │ │ ├── ConnectionHolderFactory.cs │ │ │ └── PostgreSqlMessageQueueTransportOptionsFactory.cs │ │ ├── GetFirstMessageDeliveryTime.cs │ │ ├── Message │ │ │ ├── ReceiveMessage.cs │ │ │ └── RollbackMessage.cs │ │ ├── OptionsSerialization.cs │ │ ├── PostgreSQLCommandStringCache.cs │ │ ├── PostgreSQLJobQueueCreation.cs │ │ ├── PostgreSQLJobSchedulerLastKnownEvent.cs │ │ ├── PostgreSQLJobSchema.cs │ │ ├── PostgreSQLMessageQueueCreation.cs │ │ ├── PostgreSQLMessageQueueInit.cs │ │ ├── PostgreSQLMessageQueueReceive.cs │ │ ├── PostgreSQLMessageQueueSchema.cs │ │ ├── PostgreSQLMessageQueueTransportOptions.cs │ │ ├── PostgreSQLSendJobToQueue.cs │ │ ├── QueryHandler │ │ │ ├── ReceiveMessage.cs │ │ │ └── ReceiveMessageQueryHandler.cs │ │ ├── QueryPrepareHandler │ │ │ ├── FindErrorRecordsToDeleteQueryPrepareHandler.cs │ │ │ ├── FindExpiredRecordsToDeleteQueryPrepareHandler.cs │ │ │ └── FindRecordsToResetByHeartBeatQueryPrepareHandler.cs │ │ ├── ReadColumn.cs │ │ ├── RemoveMessage.cs │ │ ├── RetrySQLPolicyCreation.cs │ │ ├── Time │ │ │ └── PostgreSQLTime.cs │ │ ├── TransportOptionsFactory.cs │ │ └── TransportPolicyDefinitions.cs │ ├── ConfigurationExtensions.cs │ ├── Decorator │ │ ├── CreateJobTablesCommandDecorator.cs │ │ ├── CreateQueueTablesAndSaveConfigurationDecorator.cs │ │ ├── GetColumnNamesFromTableQueryPrepareDecorator.cs │ │ ├── GetTableExistsQueryPrepareDecorator.cs │ │ ├── GetTableExistsTransactionQueryPrepareDecorator.cs │ │ ├── RetryCommandHandlerDecorator.cs │ │ ├── RetryCommandHandlerOutputDecorator.cs │ │ ├── RetryCommandHandlerOutputDecoratorAsync.cs │ │ ├── RetryConstants.cs │ │ ├── RetryQueryHandlerDecorator.cs │ │ └── RetryableSqlErrors.cs │ ├── DotNetWorkQueue.Transport.PostgreSQL.csproj │ ├── IPostgreSQLMessageQueueTransportOptionsFactory.cs │ ├── InternalsVisibleForTests.cs │ ├── SQLConnectionInformation.cs │ ├── Schema │ │ ├── Column.cs │ │ ├── ColumnList.cs │ │ ├── Columns.cs │ │ ├── Constraint.cs │ │ ├── ConstraintList.cs │ │ ├── Table.cs │ │ └── TableInfo.cs │ └── Trace │ │ ├── Decorator │ │ ├── RollbackMessageCommandHandlerDecorator.cs │ │ ├── SendMessageCommandHandlerAsyncDecorator.cs │ │ └── SendMessageCommandHandlerDecorator.cs │ │ └── TraceExtensions.cs ├── DotNetWorkQueue.Transport.Redis.IntegrationTests │ ├── Admin │ │ └── SimpleConsumer.cs │ ├── AssemblyInfo.cs │ ├── ConnectionString.cs │ ├── Consumer │ │ ├── ConsumerCancelWork.cs │ │ ├── ConsumerErrorTable.cs │ │ ├── ConsumerExpiredMessage.cs │ │ ├── ConsumerHeartbeat.cs │ │ ├── ConsumerPoisonMessage.cs │ │ ├── ConsumerRollBack.cs │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorTable.cs │ │ ├── ConsumerAsyncPoisonMessage.cs │ │ ├── ConsumerAsyncRollBack.cs │ │ ├── MultiConsumerAsync.cs │ │ └── SimpleConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.Redis.Integration.Tests.csproj │ ├── GenerateQueueName.cs │ ├── Producer │ │ ├── SimpleProducer.cs │ │ └── SimpleProducerAsync.cs │ ├── Route │ │ ├── RouteMultiTests.cs │ │ └── RouteTests.cs │ ├── SharedClasses.cs │ └── VerifyQueueData.cs ├── DotNetWorkQueue.Transport.Redis.Linq.Integration.Tests │ ├── AssemblyInfo.cs │ ├── ConsumerMethod │ │ ├── ConsumerMethodCancelWork.cs │ │ ├── ConsumerMethodErrorTable.cs │ │ ├── ConsumerMethodExpiredMessage.cs │ │ ├── ConsumerMethodHeartbeat.cs │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ ├── ConsumerMethodPoisonMessage.cs │ │ ├── ConsumerMethodRollBack.cs │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ ├── ConsumerMethodAsyncErrorTable.cs │ │ ├── ConsumerMethodAsyncPoisonMessage.cs │ │ ├── ConsumerMethodAsyncRollBack.cs │ │ └── SimpleConsumerMethodAsync.cs │ ├── DotNetWorkQueue.Transport.Redis.Linq.Integration.Tests.csproj │ ├── JobScheduler │ │ └── JobSchedulerTests.cs │ └── ProducerMethod │ │ ├── SimpleMethodProducer.cs │ │ └── SimpleMethodProducerAsync.cs ├── DotNetWorkQueue.Transport.Redis.Tests │ ├── Basic │ │ ├── Command │ │ │ ├── DeleteMessageCommandTests.cs │ │ │ ├── MoveDelayedRecordsCommandTests.cs │ │ │ ├── MoveRecordToErrorQueueCommandTests.cs │ │ │ ├── ResetHeartBeatCommandTests.cs │ │ │ ├── RollbackMessageCommandTests.cs │ │ │ ├── SaveMetaDataCommandTests.cs │ │ │ ├── SendHeartBeatCommandTests.cs │ │ │ ├── SendMessageCommandBatchTests.cs │ │ │ └── SendMessageCommandTests.cs │ │ ├── Factory │ │ │ ├── GetMessageIdFactorytests.cs │ │ │ ├── ReceiveMessagesFactoryTests.cs │ │ │ ├── RedisQueueCorrelationIdFactoryTest.cs │ │ │ ├── RedisQueueWorkSubFactoryTests.cs │ │ │ └── UnixTimeFactoryTests.cs │ │ ├── MessageID │ │ │ └── GetUuidMessageIdTests.cs │ │ ├── Query │ │ │ ├── GetMetaDataQueryTests.cs │ │ │ └── ReceiveMessageQueryTests.cs │ │ ├── RedisBaseTransportOptionsTests.cs │ │ ├── RedisErrorTrackingTests.cs │ │ ├── RedisHeadersTests.cs │ │ ├── RedisMessageTests.cs │ │ ├── RedisMetaDataTests.cs │ │ ├── RedisNamesTests.cs │ │ ├── RedisQueueCorrelationIdTests.cs │ │ ├── RedisQueueDelayTests.cs │ │ ├── RedisQueueIdTests.cs │ │ ├── RedisQueueTransportOptionsTests.cs │ │ ├── RedisSimpleBatchSizeTests.cs │ │ └── Time │ │ │ ├── BaseTimeConfigurationTests.cs │ │ │ └── SntpTimeConfigurationTests.cs │ ├── ConfigurationExtensionsTests.cs │ ├── DotNetWorkQueue.Transport.Redis.Tests.csproj │ ├── Helpers.cs │ ├── HelpersTests.cs │ └── RedisConnectionInfoTests.cs ├── DotNetWorkQueue.Transport.Redis │ ├── Basic │ │ ├── Admin │ │ │ └── AdminFunctions.cs │ │ ├── Command │ │ │ ├── MoveDelayedRecordsCommand.cs │ │ │ ├── SaveMetaDataCommand.cs │ │ │ └── SendMessageCommandBatch.cs │ │ ├── CommandHandler │ │ │ ├── BatchMessageShared.cs │ │ │ ├── DeleteMessageCommandHandler.cs │ │ │ ├── MoveDelayedRecordsCommandHandler.cs │ │ │ ├── MoveRecordToErrorQueueCommandHandler.cs │ │ │ ├── ResetHeartBeatCommandHandler.cs │ │ │ ├── RollbackMessageCommandHandler.cs │ │ │ ├── SaveMetaDataCommandHandler.cs │ │ │ ├── SendHeartBeatCommandHandler.cs │ │ │ ├── SendMessageCommandBatchHandler.cs │ │ │ ├── SendMessageCommandBatchHandlerAsync.cs │ │ │ ├── SendMessageCommandHandler.cs │ │ │ └── SendMessageCommandHandlerAsync.cs │ │ ├── Factory │ │ │ ├── GetMessageIdFactory.cs │ │ │ ├── GetTimeFactory.cs │ │ │ ├── ReceiveMessagesFactory.cs │ │ │ ├── RedisQueueCorrelationIdFactory.cs │ │ │ ├── RedisQueueWorkSubFactory.cs │ │ │ └── UnixTimeFactory.cs │ │ ├── GetFirstMessageDeliveryTime.cs │ │ ├── GetHeader.cs │ │ ├── Logging │ │ │ └── Decorator │ │ │ │ ├── DelayedProcessingActionDecorator.cs │ │ │ │ └── ReceiveMessageQueryDecorator.cs │ │ ├── Lua │ │ │ ├── BaseLua.cs │ │ │ ├── DeleteLua.cs │ │ │ ├── DequeueLua.cs │ │ │ ├── DoesJobExistLua.cs │ │ │ ├── EnqueueBatchLua.cs │ │ │ ├── EnqueueDelayedAndExpirationLua.cs │ │ │ ├── EnqueueDelayedLua.cs │ │ │ ├── EnqueueExpirationLua.cs │ │ │ ├── EnqueueLua.cs │ │ │ ├── ErrorLua.cs │ │ │ ├── GetHeaderLua.cs │ │ │ ├── LuaScripts.cs │ │ │ ├── MoveDelayedToPendingLua.cs │ │ │ ├── ResetHeartbeatLua.cs │ │ │ ├── RollbackDelayLua.cs │ │ │ ├── RollbackLua.cs │ │ │ └── TimeLua.cs │ │ ├── Message │ │ │ └── RollbackMessage.cs │ │ ├── MessageID │ │ │ ├── GetRedisIncrId.cs │ │ │ └── GetUUIDMessageID.cs │ │ ├── Metrics │ │ │ └── Decorator │ │ │ │ ├── IDelayedProcessingActionDecorator.cs │ │ │ │ └── ReceiveMessageQueryDecorator.cs │ │ ├── Query │ │ │ ├── DoesJobExistQuery.cs │ │ │ ├── GetErrorRecordsToDeleteQuery.cs │ │ │ ├── GetMetaDataQuery.cs │ │ │ └── ReceiveMessageQuery.cs │ │ ├── QueryHandler │ │ │ ├── DoesJobExistQueryHandler.cs │ │ │ ├── GetErrorRecordsToDeleteQueryHandler.cs │ │ │ ├── GetHeaderQueryHandler.cs │ │ │ ├── GetJobIdQueryHandler.cs │ │ │ ├── GetMetaDataQueryHandler.cs │ │ │ └── ReceiveMessageQueryHandler.cs │ │ ├── RedisBaseTransportOptions.cs │ │ ├── RedisDelayedProcessingMonitor.cs │ │ ├── RedisErrorTracking.cs │ │ ├── RedisHeaders.cs │ │ ├── RedisJobQueueCreation.cs │ │ ├── RedisJobSchedulerLastKnownEvent.cs │ │ ├── RedisJobTableCreationNoOp.cs │ │ ├── RedisMessage.cs │ │ ├── RedisMetaData.cs │ │ ├── RedisNames.cs │ │ ├── RedisQueueClearErrorMessages.cs │ │ ├── RedisQueueClearExpiredMessages.cs │ │ ├── RedisQueueCorrelationId.cs │ │ ├── RedisQueueCreation.cs │ │ ├── RedisQueueDelay.cs │ │ ├── RedisQueueID.cs │ │ ├── RedisQueueInit.cs │ │ ├── RedisQueueMonitor.cs │ │ ├── RedisQueueReceiveMessages.cs │ │ ├── RedisQueueReceiveMessagesError.cs │ │ ├── RedisQueueReceivePoisonMessage.cs │ │ ├── RedisQueueResetHeartBeat.cs │ │ ├── RedisQueueSend.cs │ │ ├── RedisQueueSendHeartBeat.cs │ │ ├── RedisQueueTransportOptions.cs │ │ ├── RedisQueueWorkSub.cs │ │ ├── RedisSendJobToQueue.cs │ │ ├── RedisSimpleBatchSize.cs │ │ ├── RemoveMessage.cs │ │ └── Time │ │ │ ├── BaseUnixTime.cs │ │ │ ├── LocalMachineUnixTime.cs │ │ │ ├── RedisServerUnixTime.cs │ │ │ ├── SntpTimeConfiguration.cs │ │ │ └── SntpUnixTime.cs │ ├── ConfigurationExtensions.cs │ ├── DotNetWorkQueue.Transport.Redis.csproj │ ├── Helpers.cs │ ├── IDelayedProcessingAction.cs │ ├── IDelayedProcessingMonitor.cs │ ├── IGetMessageID.cs │ ├── IGetMessageIdFactory.cs │ ├── IRedisConnection.cs │ ├── IRedisQueueWorkSub.cs │ ├── IRedisQueueWorkSubFactory.cs │ ├── ISendBatchSize.cs │ ├── IUnixTime.cs │ ├── IUnixTimeFactory.cs │ ├── InternalsVisibleForTests.cs │ ├── RedisConnection.cs │ ├── RedisConnectionInfo.cs │ ├── RedisGetPreviousMessageErrors.cs │ └── Trace │ │ ├── Decorator │ │ ├── RollbackMessageCommandHandlerDecorator.cs │ │ └── SendMessagesDecorator.cs │ │ └── TraceExtensions.cs ├── DotNetWorkQueue.Transport.RelationalDatabase.Tests │ ├── Basic │ │ ├── Command │ │ │ ├── DeleteMessageCommandTests.cs │ │ │ ├── DeleteStatusTableStatusCommandTests.cs │ │ │ ├── MoveRecordToErrorQueueCommandTests.cs │ │ │ ├── ResetHeartBeatCommandTests.cs │ │ │ ├── RollbackMessageCommandTests.cs │ │ │ ├── SendHeartBeatCommandTests.cs │ │ │ ├── SendMessageCommandTests.cs │ │ │ ├── SetErrorCountCommandTests.cs │ │ │ └── SetStatusTableStatusCommandTests.cs │ │ ├── CorrelationIdTests.cs │ │ ├── Factory │ │ │ └── ReceiveMessagesFactoryTests.cs │ │ ├── MessageQueueIdTests.cs │ │ ├── Query │ │ │ ├── FindExpiredMessagesToDeleteQueryTests.cs │ │ │ ├── FindMessagesToResetByHeartBeatQueryTests.cs │ │ │ ├── GetColumnNamesFromTableQueryTests.cs │ │ │ ├── GetErrorRecordExistsQueryTests.cs │ │ │ ├── GetErrorRetryCountQueryTests.cs │ │ │ ├── GetTableExistsQueryTests.cs │ │ │ ├── GetUtcDateQueryTests.cs │ │ │ └── MessageToResetTests.cs │ │ ├── SqlQueueDelayTests.cs │ │ └── TableNameHelperTests.cs │ └── DotNetWorkQueue.Transport.RelationalDatabase.Tests.csproj ├── DotNetWorkQueue.Transport.RelationalDatabase │ ├── Basic │ │ ├── Admin │ │ │ └── AdminFunctions.cs │ │ ├── Command │ │ │ ├── CreateJobTablesCommand.cs │ │ │ ├── CreateQueueTablesAndSaveConfigurationCommand.cs │ │ │ ├── DeleteMetaDataCommand.cs │ │ │ ├── DeleteTransactionalMessageCommand.cs │ │ │ ├── SaveQueueConfigurationCommand.cs │ │ │ ├── SetJobLastKnownEventCommand.cs │ │ │ └── SetStatusTableStatusTransactionCommand.cs │ │ ├── CommandHandler │ │ │ ├── CreateJobTablesCommandHandler.cs │ │ │ ├── CreateQueueTablesAndSaveConfigurationCommandHandler.cs │ │ │ ├── DeleteMessageCommandHandler.cs │ │ │ ├── DeleteMetaDataCommandHandler.cs │ │ │ ├── DeleteQueueTablesCommandHandler.cs │ │ │ ├── DeleteStatusTableStatusCommandHandler.cs │ │ │ ├── DeleteTransactionalMessageCommandHandler.cs │ │ │ ├── MoveRecordToErrorQueueCommandHandler.cs │ │ │ ├── ResetHeartBeatCommandHandler.cs │ │ │ ├── SendHeartBeatCommandHandler.cs │ │ │ ├── SetErrorCountCommandHandler.cs │ │ │ ├── SetStatusTableStatusCommandHandler.cs │ │ │ └── SetStatusTableStatusTransactionCommandHandler.cs │ │ ├── CommandPrepareHandler │ │ │ ├── CreateJobTablesCommandPrepareHandler.cs │ │ │ ├── CreateQueueTablesAndSaveConfigurationCommandPrepareHandler.cs │ │ │ ├── DeleteMessageCommandPrepareHandler.cs │ │ │ ├── DeleteMetaDataCommandPrepareHandler.cs │ │ │ ├── DeleteStatusTableStatusCommandPrepareHandler.cs │ │ │ ├── DeleteTableCommandPrepareHandler.cs │ │ │ ├── MoveRecordToErrorQueueCommandPrepareHandler.cs │ │ │ ├── ResetHeartBeatCommandPrepareHandler.cs │ │ │ ├── SaveQueueConfigurationCommandPrepareHandler.cs │ │ │ ├── SendHeartBeatCommandPrepareHandler.cs │ │ │ ├── SetErrorCountCommandPrepareHandler.cs │ │ │ ├── SetStatusTableStatusCommandPrepareHandler.cs │ │ │ └── SetStatusTableStatusTransactionCommandPrepareHandler.cs │ │ ├── CommandStringCache.cs │ │ ├── ConnectionHeader.cs │ │ ├── GetColumnsFromTable.cs │ │ ├── ITableNameHelper.cs │ │ ├── JobTableCreation.cs │ │ ├── Query │ │ │ ├── DoesJobExistQuery.cs │ │ │ ├── GetColumnNamesFromTableQuery.cs │ │ │ ├── GetQueueCountQuery.cs │ │ │ ├── GetQueueOptionsQuery.cs │ │ │ ├── GetTableExistsQuery.cs │ │ │ ├── GetTableExistsTransactionQuery.cs │ │ │ └── ReceiveMessageQuery.cs │ │ ├── QueryHandler │ │ │ ├── DoesJobExistQueryHandler.cs │ │ │ ├── FindErrorRecordsToDeleteQueryHandler.cs │ │ │ ├── FindExpiredRecordsToDeleteQueryHandler.cs │ │ │ ├── FindRecordsToResetByHeartBeatQueryHandler.cs │ │ │ ├── GetColumnNamesFromTableQueryHandler.cs │ │ │ ├── GetErrorRecordExistsQueryHandler.cs │ │ │ ├── GetErrorRetryCountQueryHandler.cs │ │ │ ├── GetHeaderQueryHandler.cs │ │ │ ├── GetJobIdQueryHandler.cs │ │ │ ├── GetJobLastKnownEventQueryHandler.cs │ │ │ ├── GetMessageErrorsQueryHandler.cs │ │ │ ├── GetMessageErrorsQueryPrepareHandler.cs │ │ │ ├── GetQueueCountQueryHandler.cs │ │ │ ├── GetQueueOptionsQueryHandler.cs │ │ │ ├── GetTableExistsQueryHandler.cs │ │ │ ├── GetTableExistsTransactionQueryHandler.cs │ │ │ └── GetUTCDateQueryHandler.cs │ │ ├── QueryPrepareHandler │ │ │ ├── DoesJobExistQueryPrepareHandler.cs │ │ │ ├── FindErrorRecordsToDeleteQueryPrepareHandler.cs │ │ │ ├── FindExpiredRecordsToDeleteQueryPrepareHandler.cs │ │ │ ├── FindRecordsToResetByHeartBeatQueryPrepareHandler.cs │ │ │ ├── GetColumnNamesFromTableQueryPrepareHandler.cs │ │ │ ├── GetErrorRecordExistsQueryPrepareHandler.cs │ │ │ ├── GetErrorRetryCountQueryPrepareHandler.cs │ │ │ ├── GetHeaderQueryPrepareHandler.cs │ │ │ ├── GetJobIdQueryPrepareHandler.cs │ │ │ ├── GetJobLastKnownEventQueryPrepareHandler.cs │ │ │ ├── GetQueueCountQueryPrepareHandler.cs │ │ │ ├── GetQueueOptionsQueryPrepareHandler.cs │ │ │ ├── GetTableExistsQueryPrepareHandler.cs │ │ │ ├── GetTableExistsTransactionQueryPrepareHandler.cs │ │ │ └── GetUtcDateQueryPrepareHandler.cs │ │ ├── ReadColumn.cs │ │ ├── RelationalDatabaseMessageQueueInit.cs │ │ ├── TableNameHelper.cs │ │ ├── TransactionFactory.cs │ │ └── TransactionWrapper.cs │ ├── DotNetWorkQueue.Transport.RelationalDatabase.csproj │ ├── GetPreviousMessageErrors.cs │ ├── IBuildMoveToErrorQueueSql.cs │ ├── IConnectionHeader.cs │ ├── IConnectionHolder.cs │ ├── IConnectionHolderFactory.cs │ ├── IDbConnectionFactory.cs │ ├── IGetColumnsFromTable.cs │ ├── IJobSchema.cs │ ├── IOptionsSerialization.cs │ ├── IPrepareCommandHandler.cs │ ├── IPrepareCommandHandlerWithOutput.cs │ ├── IPrepareQueryHandler.cs │ ├── IReadColumn.cs │ ├── ITable.cs │ ├── ITransactionFactory.cs │ ├── ITransactionWrapper.cs │ ├── ITransportOptions.cs │ └── ITransportOptionsFactory.cs ├── DotNetWorkQueue.Transport.SQLite.Integration.Tests │ ├── Admin │ │ └── SimpleConsumer.cs │ ├── AssemblyInfo.cs │ ├── ConnectionString.cs │ ├── Consumer │ │ ├── ConsumerCancelWork.cs │ │ ├── ConsumerErrorTable.cs │ │ ├── ConsumerExpiredMessage.cs │ │ ├── ConsumerHeartbeat.cs │ │ ├── ConsumerPoisonMessage.cs │ │ ├── ConsumerRollBack.cs │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorTable.cs │ │ ├── ConsumerAsyncPoisonMessage.cs │ │ ├── ConsumerAsyncRollBack.cs │ │ ├── MultiConsumerAsync.cs │ │ └── SimpleConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.SQLite.Integration.Tests.csproj │ ├── GenerateQueueName.cs │ ├── Producer │ │ ├── MultiProducer.cs │ │ ├── SimpleProducer.cs │ │ ├── SimpleProducerAsync.cs │ │ ├── SimpleProducerAsyncBatch.cs │ │ └── SimpleProducerBatch.cs │ ├── Route │ │ ├── RouteMultiTests.cs │ │ └── RouteTests.cs │ ├── SharedClasses.cs │ ├── UserDequeue │ │ └── UserDequeue.cs │ └── VerifyQueueData.cs ├── DotNetWorkQueue.Transport.SQLite.Linq.Integration.Tests │ ├── AssemblyInfo.cs │ ├── ConsumerMethod │ │ ├── ConsumerMethodCancelWork.cs │ │ ├── ConsumerMethodErrorTable.cs │ │ ├── ConsumerMethodExpiredMessage.cs │ │ ├── ConsumerMethodHeartbeat.cs │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ ├── ConsumerMethodPoisonMessage.cs │ │ ├── ConsumerMethodRollBack.cs │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ ├── ConsumerMethodAsyncErrorTable.cs │ │ ├── ConsumerMethodAsyncPoisonMessage.cs │ │ ├── ConsumerMethodAsyncRollBack.cs │ │ └── SimpleMethodConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.SQLite.Linq.Integration.Tests.csproj │ ├── JobScheduler │ │ ├── JobSchedulerMultipleTests.cs │ │ └── JobSchedulerTests.cs │ └── ProducerMethod │ │ ├── MultiMethodProducer.cs │ │ ├── SimpleMethodProducer.cs │ │ ├── SimpleMethodProducerAsync.cs │ │ ├── SimpleMethodProducerAsyncBatch.cs │ │ └── SimpleMethodProducerBatch.cs ├── DotNetWorkQueue.Transport.SQLite.Tests │ ├── Basic │ │ ├── Command │ │ │ └── CreateQueueTablesAndSaveConfigurationCommandTests.cs │ │ ├── CommandStringTests.cs │ │ ├── ConnectionStringInfoTests.cs │ │ ├── CreationScopeTests.cs │ │ ├── DatabaseExistsTests.cs │ │ ├── Factory │ │ │ └── SQLiteMessageQueueTransportOptionsFactoryTests.cs │ │ ├── SQLiteMessageQueueSchemaTests.cs │ │ ├── SQLiteMessageQueueTransportOptionsTests.cs │ │ └── SqlHeadersTests.cs │ ├── DotNetWorkQueue.Transport.SQLite.Tests.csproj │ ├── Helpers.cs │ ├── SQLiteConnectionInformationTests.cs │ └── Schema │ │ ├── ColumnTests.cs │ │ ├── ColumnsTests.cs │ │ ├── ConstraintTests.cs │ │ ├── DefaultTests.cs │ │ ├── IdentityTests.cs │ │ └── TableTests.cs ├── DotNetWorkQueue.Transport.SQLite │ ├── Basic │ │ ├── BuildMoveToErrorQueueSql.cs │ │ ├── CommandHandler │ │ │ ├── RollbackMessageCommandHandler.cs │ │ │ ├── SendMessage.cs │ │ │ ├── SendMessageCommandHandler.cs │ │ │ ├── SendMessageCommandHandlerAsync.cs │ │ │ └── SetJobLastKnownEventCommandHandler.cs │ │ ├── CommandPrepareHandler │ │ │ ├── MoveRecordToErrorQueueCommandPrepareHandler.cs │ │ │ └── ResetHeartBeatCommandPrepareHandler.cs │ │ ├── ConnectionStringInfo.cs │ │ ├── CreationScope.cs │ │ ├── DatabaseExists.cs │ │ ├── DbConnectionFactory.cs │ │ ├── DbDataSource.cs │ │ ├── DbFactory.cs │ │ ├── Factory │ │ │ └── SqLiteMessageQueueTransportOptionsFactory.cs │ │ ├── GetFileNameFromConnectionString.cs │ │ ├── GetFirstMessageDeliveryTime.cs │ │ ├── Message │ │ │ ├── ReceiveMessage.cs │ │ │ └── RollbackMessage.cs │ │ ├── OptionsSerialization.cs │ │ ├── QueryHandler │ │ │ ├── BuildDequeueCommand.cs │ │ │ ├── MessageDeQueue.cs │ │ │ ├── ReceiveMessage.cs │ │ │ └── ReceiveMessageQueryHandler.cs │ │ ├── QueryPrepareHandler │ │ │ ├── FindErrorRecordsToDeleteQueryPrepareHandler.cs │ │ │ ├── FindExpiredRecordsToDeleteQueryPrepareHandler.cs │ │ │ └── FindRecordsToResetByHeartBeatQueryPrepareHandler.cs │ │ ├── ReadColumn.cs │ │ ├── ReaderAsync.cs │ │ ├── RetryTransactionPolicyCreation.cs │ │ ├── SQLiteMessageQueueTransportOptions.cs │ │ ├── SQLiteTransaction.cs │ │ ├── SqLiteCommandStringCache.cs │ │ ├── SqLiteHoldConnection.cs │ │ ├── SqLiteMessageQueueCreation.cs │ │ ├── SqLiteMessageQueueInit.cs │ │ ├── SqLiteMessageQueueReceive.cs │ │ ├── SqLiteMessageQueueSchema.cs │ │ ├── SqLiteMessageQueueSharedInit.cs │ │ ├── SqliteJobQueueCreation.cs │ │ ├── SqliteJobSchedulerLastKnownEvent.cs │ │ ├── SqliteJobSchema.cs │ │ ├── SqliteSendToJobQueue.cs │ │ ├── TransactionFactory.cs │ │ ├── TransportOptionsFactory.cs │ │ └── TransportPolicyDefinitions.cs │ ├── ConfigurationExtensions.cs │ ├── Decorator │ │ ├── BeginTransactionRetryDecorator.cs │ │ ├── CreateJobTablesCommandDecorator.cs │ │ ├── CreateQueueTablesAndSaveConfigurationDecorator.cs │ │ ├── DeleteMessageCommandDecorator.cs │ │ ├── DeleteQueueTablesDecorator.cs │ │ ├── DoesJobExistDecorator.cs │ │ ├── FindExpiredRecordsToDeleteDecorator.cs │ │ ├── FindExpiredRecordsToDeleteQueryHandlerErrorDecorator.cs │ │ ├── FindRecordsToResetByHeartBeatDecoration.cs │ │ ├── FindRecordsToResetByHeartBeatDecorator.cs │ │ ├── GetColumnNamesFromTableDecorator.cs │ │ ├── GetErrorRecordExistsQueryDecorator.cs │ │ ├── GetTableExistsDecorator.cs │ │ ├── MoveRecordToErrorQueueCommandDecorator.cs │ │ ├── ResetHeartBeatCommandDecorator.cs │ │ ├── RetryCommandHandlerDecorator.cs │ │ ├── RetryCommandHandlerOutputDecorator.cs │ │ ├── RetryCommandHandlerOutputDecoratorAsync.cs │ │ ├── RetryConstants.cs │ │ ├── RetryQueryHandlerDecorator.cs │ │ ├── RetryableSqlErrors.cs │ │ ├── SetErrorCountCommandDecorator.cs │ │ └── SetStatusTableStatusCommandDecorator.cs │ ├── DotNetWorkQueue.Transport.SQLite.csproj │ ├── IDbDataSource.cs │ ├── IDbFactory.cs │ ├── IGetFileNameFromConnectionString.cs │ ├── IReaderAsync.cs │ ├── ISQLiteTransaction.cs │ ├── ISqLiteMessageQueueTransportOptionsFactory.cs │ ├── InternalsVisibleForTests.cs │ ├── Schema │ │ ├── Column.cs │ │ ├── ColumnList.cs │ │ ├── Columns.cs │ │ ├── Constraint.cs │ │ ├── ConstraintList.cs │ │ ├── Default.cs │ │ ├── Identity.cs │ │ ├── Table.cs │ │ └── TableInfo.cs │ ├── SqliteConnectionInformation.cs │ └── Trace │ │ ├── Decorator │ │ ├── RollbackMessageCommandHandlerDecorator.cs │ │ ├── SendMessageCommandHandlerAsyncDecorator.cs │ │ └── SendMessageCommandHandlerDecorator.cs │ │ └── TraceExtensions.cs ├── DotNetWorkQueue.Transport.Shared │ ├── Basic │ │ ├── Chaos │ │ │ └── ChaosPolicyShared.cs │ │ ├── ClearErrorMessages.cs │ │ ├── ClearExpiredMessages.cs │ │ ├── Command │ │ │ ├── DeleteMessageCommand.cs │ │ │ ├── DeleteQueueTablesCommand.cs │ │ │ ├── DeleteStatusTableStatusCommand.cs │ │ │ ├── DeleteTableCommand.cs │ │ │ ├── MoveRecordToErrorQueueCommand.cs │ │ │ ├── ResetHeartBeatCommand.cs │ │ │ ├── RollbackMessageCommand.cs │ │ │ ├── SendHeartBeatCommand.cs │ │ │ ├── SendMessageCommand.cs │ │ │ ├── SetErrorCountCommand.cs │ │ │ └── SetStatusTableStatusCommand.cs │ │ ├── CreateJobMetaData.cs │ │ ├── DefaultQueueDelay.cs │ │ ├── ExceptionDelay.cs │ │ ├── Factory │ │ │ ├── CorrelationIdFactory.cs │ │ │ └── ReceiveMessagesFactory.cs │ │ ├── GetHeader.cs │ │ ├── IncreaseQueueDelay.cs │ │ ├── MessageCorrelationId.cs │ │ ├── MessageExpiration.cs │ │ ├── MessageQueueID.cs │ │ ├── Query │ │ │ ├── FindErrorMessagesToDeleteQuery.cs │ │ │ ├── FindExpiredMessagesToDeleteQuery.cs │ │ │ ├── FindMessagesToResetByHeartBeatQuery.cs │ │ │ ├── GetErrorRecordExistsQuery.cs │ │ │ ├── GetErrorRetryCountQuery.cs │ │ │ ├── GetHeaderQuery.cs │ │ │ ├── GetJobIDQuery.cs │ │ │ ├── GetJobLastKnownEventQuery.cs │ │ │ ├── GetMessageErrorsQuery.cs │ │ │ ├── GetUTCDateQuery.cs │ │ │ └── MessageToReset.cs │ │ ├── ReceiveErrorMessage.cs │ │ ├── ReceivePoisonMessage.cs │ │ ├── RemoveMessage.cs │ │ ├── ResetHeartBeat.cs │ │ ├── SendHeartBeat.cs │ │ ├── SendMessages.cs │ │ └── ThreadSafeRandom.cs │ ├── DotNetWorkQueue.Transport.Shared.csproj │ ├── ICommandHandler.cs │ ├── ICommandHandlerWithOutput.cs │ ├── ICommandHandlerWithOutputAsync.cs │ ├── IQuery.cs │ ├── IQueryHandler.cs │ ├── ITransportCommitMessage.cs │ ├── ITransportHandleMessage.cs │ ├── ITransportRollbackMessage.cs │ ├── Message │ │ ├── TransportCommitMessage.cs │ │ └── TransportHandleMessage.cs │ ├── Trace │ │ └── TraceExtensions.cs │ └── TransportMessageQueueSharedIinit.cs ├── DotNetWorkQueue.Transport.SqlServer.IntegrationTests │ ├── Admin │ │ └── SimpleConsumer.cs │ ├── AssemblyInfo.cs │ ├── ConnectionString.cs │ ├── Consumer │ │ ├── ConsumerCancelWork.cs │ │ ├── ConsumerErrorTable.cs │ │ ├── ConsumerExpiredMessage.cs │ │ ├── ConsumerHeartbeat.cs │ │ ├── ConsumerPoisonMessage.cs │ │ ├── ConsumerRollBack.cs │ │ └── SimpleConsumer.cs │ ├── ConsumerAsync │ │ ├── ConsumerAsyncErrorTable.cs │ │ ├── ConsumerAsyncPoisonMessage.cs │ │ ├── ConsumerAsyncRollBack.cs │ │ ├── MultiConsumerAsync.cs │ │ ├── MultiConsumerSchemaAsync.cs │ │ └── SimpleConsumerAsync.cs │ ├── DotNetWorkQueue.Transport.SqlServer.Integration.Tests.csproj │ ├── GenerateQueueName.cs │ ├── Producer │ │ ├── MultiProducer.cs │ │ ├── SimpleProducer.cs │ │ ├── SimpleProducerAsync.cs │ │ ├── SimpleProducerAsyncBatch.cs │ │ └── SimpleProducerBatch.cs │ ├── Route │ │ ├── RouteMultiTests.cs │ │ └── RouteTests.cs │ ├── SharedClasses.cs │ ├── UserDequeue │ │ └── UserDequeue.cs │ ├── VerifyQueueData.cs │ └── connectionstring.txt ├── DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests │ ├── AssemblyInfo.cs │ ├── ConsumerMethod │ │ ├── ConsumerMethodCancelWork.cs │ │ ├── ConsumerMethodErrorTable.cs │ │ ├── ConsumerMethodExpiredMessage.cs │ │ ├── ConsumerMethodHeartbeat.cs │ │ ├── ConsumerMethodMultipleDynamic.cs │ │ ├── ConsumerMethodPoisonMessage.cs │ │ ├── ConsumerMethodRollBack.cs │ │ └── SimpleMethodConsumer.cs │ ├── ConsumerMethodAsync │ │ ├── ConsumerMethodAsyncErrorTable.cs │ │ ├── ConsumerMethodAsyncPoisonMessage.cs │ │ ├── ConsumerMethodAsyncRollBack.cs │ │ └── SimpleConsumerMethodAsync.cs │ ├── DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests.csproj │ ├── JobScheduler │ │ ├── JobSchedulerMultipleTests.cs │ │ └── JobSchedulerTests.cs │ └── ProducerMethod │ │ ├── MultiProducerMethod.cs │ │ ├── SimpleProducerMethod.cs │ │ ├── SimpleProducerMethodAsync.cs │ │ ├── SimpleProducerMethodAsyncBatch.cs │ │ └── SimpleProducerMethodBatch.cs ├── DotNetWorkQueue.Transport.SqlServer.Tests │ ├── Basic │ │ ├── Command │ │ │ └── CreateQueueTablesAndSaveConfigurationCommandTests.cs │ │ ├── Factory │ │ │ └── SqlServerMessageQueueTransportOptionsFactoryTests.cs │ │ ├── SqlQueueDelayTests.cs │ │ ├── SqlServerCommandStringCacheTests.cs │ │ ├── SqlServerMessageQueueSchemaTests.cs │ │ └── SqlServerMessageQueueTransportOptionsTests.cs │ ├── DotNetWorkQueue.Transport.SqlServer.Tests.csproj │ ├── Helpers.cs │ ├── Schema │ │ ├── ColumnTests.cs │ │ ├── ColumnsTests.cs │ │ ├── ConstraintTests.cs │ │ ├── DefaultTests.cs │ │ ├── IdentityTests.cs │ │ └── TableTests.cs │ ├── SqlConnectionInformationTests.cs │ └── packages.config ├── DotNetWorkQueue.Transport.SqlServer │ ├── Basic │ │ ├── BuildMoveToErrorQueueSql.cs │ │ ├── CommandHandler │ │ │ ├── RollbackMessageCommandHandler.cs │ │ │ ├── SendHeartBeatCommandHandler.cs │ │ │ ├── SendMessage.cs │ │ │ ├── SendMessageCommandHandler.cs │ │ │ ├── SendMessageCommandHandlerAsync.cs │ │ │ └── SetJobLastKnownEventCommandHandler.cs │ │ ├── ConnectionHolder.cs │ │ ├── DbConnectionFactory.cs │ │ ├── Factory │ │ │ ├── ConnectionHolderFactory.cs │ │ │ └── SQLServerMessageQueueTransportOptionsFactory.cs │ │ ├── GetFirstMessageDeliveryTime.cs │ │ ├── Message │ │ │ ├── ReceiveMessage.cs │ │ │ └── RollbackMessage.cs │ │ ├── OptionsSerialization.cs │ │ ├── QueryHandler │ │ │ ├── BuildDequeueCommand.cs │ │ │ ├── CreateDequeueStatement.cs │ │ │ ├── ReadMessage.cs │ │ │ └── ReceiveMessageQueryHandler.cs │ │ ├── QueryPrepareHandler │ │ │ ├── GetTableExistsQueryPrepareHandler.cs │ │ │ └── GetTableExistsTransactionQueryPrepareHandler.cs │ │ ├── RemoveMessage.cs │ │ ├── RetrySqlPolicyCreation.cs │ │ ├── SQLSchema.cs │ │ ├── SQLServerMessageQueueCreation.cs │ │ ├── SQLServerMessageQueueInit.cs │ │ ├── SQLServerMessageQueueReceive.cs │ │ ├── SQLServerMessageQueueSchema.cs │ │ ├── SQLServerMessageQueueTransportOptions.cs │ │ ├── SqlServerCommandStringCache.cs │ │ ├── SqlServerJobQueueCreation.cs │ │ ├── SqlServerJobSchedulerLastKnownEvent.cs │ │ ├── SqlServerJobSchema.cs │ │ ├── SqlServerSendJobToQueue.cs │ │ ├── SqlServerTableNameHelper.cs │ │ ├── Time │ │ │ └── SqlServerTime.cs │ │ ├── TransportOptionsFactory.cs │ │ └── TransportPolicyDefinitions.cs │ ├── ConfigurationExtensions.cs │ ├── Decorator │ │ ├── CreateJobTablesCommandDecorator.cs │ │ ├── CreateQueueTablesAndSaveConfigurationDecorator.cs │ │ ├── RetryCommandHandlerDecorator.cs │ │ ├── RetryCommandHandlerOutputDecorator.cs │ │ ├── RetryCommandHandlerOutputDecoratorAsync.cs │ │ ├── RetryConstants.cs │ │ ├── RetryQueryHandlerDecorator.cs │ │ └── RetryableSqlErrors.cs │ ├── DotNetWorkQueue.Transport.SqlServer.csproj │ ├── GlobalSuppressions.cs │ ├── ISQLSchema.cs │ ├── ISQLServerMessageQueueTransportOptionsFactory.cs │ ├── InternalsVisibleForTests.cs │ ├── SQLConnectionInformation.cs │ ├── Schema │ │ ├── Column.cs │ │ ├── ColumnList.cs │ │ ├── Columns.cs │ │ ├── Constraint.cs │ │ ├── ConstraintList.cs │ │ ├── Default.cs │ │ ├── Identity.cs │ │ ├── Table.cs │ │ └── TableInfo.cs │ ├── Trace │ │ ├── Decorator │ │ │ ├── RollbackMessageCommandHandlerDecorator.cs │ │ │ ├── SendMessageCommandHandlerAsyncDecorator.cs │ │ │ └── SendMessageCommandHandlerDecorator.cs │ │ └── TraceExtensions.cs │ └── packages.config ├── DotNetWorkQueue.sln ├── DotNetWorkQueue │ ├── ASendJobToQueue.cs │ ├── ASerializer.cs │ ├── ATaskScheduler.cs │ ├── Admin │ │ └── AdminApi.cs │ ├── BaseContainer.cs │ ├── Cache │ │ ├── CachePolicy.cs │ │ └── ObjectPool.cs │ ├── Configuration │ │ ├── AdditionalConfiguration.cs │ │ ├── AdminApiConfiguration.cs │ │ ├── BaseConnectionInformation.cs │ │ ├── BaseTimeConfiguration.cs │ │ ├── ConnectionTypes.cs │ │ ├── HeartBeatConfiguration.cs │ │ ├── HeartBeatThreadPoolConfiguration.cs │ │ ├── MessageErrorConfiguration.cs │ │ ├── MessageExpirationConfiguration.cs │ │ ├── QueueConfigurationReceive.cs │ │ ├── QueueConfigurationSend.cs │ │ ├── QueueConnection.cs │ │ ├── QueueConsumerConfiguration.cs │ │ ├── QueueDelay.cs │ │ ├── QueueProducerConfiguration.cs │ │ ├── RetryDelay.cs │ │ ├── RetryInformation.cs │ │ ├── TaskSchedulerConfiguration.cs │ │ ├── TransportConfigurationReceive.cs │ │ ├── TransportConfigurationSend.cs │ │ ├── TransportInitDuplex.cs │ │ ├── TransportInitReceive.cs │ │ ├── TransportInitSend.cs │ │ └── WorkerConfiguration.cs │ ├── DotNetWorkQueue.csproj │ ├── DotNetWorkQueue.licenseheader │ ├── Exceptions │ │ ├── CommitException.cs │ │ ├── CompileException.cs │ │ ├── DotNetWorkQueueException.cs │ │ ├── InterceptorException.cs │ │ ├── JobSchedulerException.cs │ │ ├── MessageException.cs │ │ ├── PoisonMessageException.cs │ │ ├── ReceiveMessageException.cs │ │ └── SerializationException.cs │ ├── Factory │ │ ├── ContainerFactory.cs │ │ ├── GetTimeFactory.cs │ │ ├── GetTimeFactoryNoOp.cs │ │ ├── HeartBeatWorkerFactory.cs │ │ ├── InterceptorFactory.cs │ │ ├── MessageContextDataFactory.cs │ │ ├── MessageContextFactory.cs │ │ ├── MessageFactory.cs │ │ ├── MessageProcessingFactory.cs │ │ ├── PrimaryWorkerFactory.cs │ │ ├── QueueDelayFactory.cs │ │ ├── QueueWaitFactory.cs │ │ ├── ReceivedMessageFactory.cs │ │ ├── RetryDelayFactory.cs │ │ ├── RetryInformationFactory.cs │ │ ├── SentMessageFactory.cs │ │ ├── TaskFactoryFactory.cs │ │ ├── TaskSchedulerFactory.cs │ │ ├── WaitForEventOrCancelFactory.cs │ │ ├── WorkerFactory.cs │ │ ├── WorkerHeartBeatNotificationFactory.cs │ │ ├── WorkerNameFactory.cs │ │ ├── WorkerNotificationFactory.cs │ │ └── WorkerNotificationFactoryNoOp.cs │ ├── GlobalSuppressions.cs │ ├── IAbortWorkerThread.cs │ ├── IAdditionalMessageData.cs │ ├── IAdditionalMetaData.cs │ ├── IAdminApi.cs │ ├── IAdminFunctions.cs │ ├── IBaseTransportOptions.cs │ ├── ICachePolicy.cs │ ├── ICancelWork.cs │ ├── IClear.cs │ ├── IClearErrorMessages.cs │ ├── IClearErrorMessagesMonitor.cs │ ├── IClearExpiredMessages.cs │ ├── ICommitMessage.cs │ ├── ICompositeSerialization.cs │ ├── IConfiguration.cs │ ├── IConnectionInformation.cs │ ├── IConsumerBaseQueue.cs │ ├── IConsumerMethodQueue.cs │ ├── IConsumerMethodQueueScheduler.cs │ ├── IConsumerQueue.cs │ ├── IConsumerQueueAsync.cs │ ├── IConsumerQueueErrorNotification.cs │ ├── IConsumerQueueNotification.cs │ ├── IConsumerQueueScheduler.cs │ ├── IContainer.cs │ ├── IContainerFactory.cs │ ├── ICorrelationID.cs │ ├── ICorrelationIDFactory.cs │ ├── ICreateContainer.cs │ ├── ICreationScope.cs │ ├── ICustomHeaders.cs │ ├── IExpressionSerializer.cs │ ├── IGenerateReceivedMessage.cs │ ├── IGetFirstMessageDeliveryTime.cs │ ├── IGetHeader.cs │ ├── IGetPreviousMessageErrors.cs │ ├── IGetTime.cs │ ├── IGetTimeFactory.cs │ ├── IHandleMessage.cs │ ├── IHeaders.cs │ ├── IHeartBeatConfiguration.cs │ ├── IHeartBeatMonitor.cs │ ├── IHeartBeatScheduler.cs │ ├── IHeartBeatStatus.cs │ ├── IHeartBeatThreadPoolConfiguration.cs │ ├── IHeartBeatWorker.cs │ ├── IHeartBeatWorkerFactory.cs │ ├── IIncreaseQueueDelay.cs │ ├── IInterceptorFactory.cs │ ├── IInternalSerializer.cs │ ├── IIsDisposed.cs │ ├── IJobQueueCreation.cs │ ├── IJobQueueOutputMessage.cs │ ├── IJobQueues.cs │ ├── IJobSchedule.cs │ ├── IJobScheduler.cs │ ├── IJobSchedulerLastKnownEvent.cs │ ├── IJobSchedulerMetaDataCreation.cs │ ├── IJobTableCreation.cs │ ├── ILinqCompiler.cs │ ├── IMessage.cs │ ├── IMessageContext.cs │ ├── IMessageContextData.cs │ ├── IMessageContextDataFactory.cs │ ├── IMessageContextFactory.cs │ ├── IMessageErrorConfiguration.cs │ ├── IMessageExpirationConfiguration.cs │ ├── IMessageFactory.cs │ ├── IMessageHandler.cs │ ├── IMessageHandlerAsync.cs │ ├── IMessageHandlerRegistration.cs │ ├── IMessageHandlerRegistrationAsync.cs │ ├── IMessageID.cs │ ├── IMessageInterceptor.cs │ ├── IMessageInterceptorRegistrar.cs │ ├── IMessageMethodHandling.cs │ ├── IMessageProcessing.cs │ ├── IMessageProcessingFactory.cs │ ├── IMetrics.cs │ ├── IMonitor.cs │ ├── IMonitorTimespan.cs │ ├── INoOperation.cs │ ├── IObjectPool.cs │ ├── IPolicies.cs │ ├── IPooledObject.cs │ ├── IPrimaryWorker.cs │ ├── IPrimaryWorkerFactory.cs │ ├── IProducerBaseQueue.cs │ ├── IProducerMethodJobQueue.cs │ ├── IProducerMethodQueue.cs │ ├── IProducerQueue.cs │ ├── IQueue.cs │ ├── IQueueCancelWork.cs │ ├── IQueueContainer.cs │ ├── IQueueCreation.cs │ ├── IQueueDelay.cs │ ├── IQueueDelayFactory.cs │ ├── IQueueMonitor.cs │ ├── IQueueOutputMessage.cs │ ├── IQueueOutputMessages.cs │ ├── IQueueWait.cs │ ├── IQueueWaitFactory.cs │ ├── IReadonly.cs │ ├── IReceiveMessages.cs │ ├── IReceiveMessagesError.cs │ ├── IReceiveMessagesFactory.cs │ ├── IReceivePoisonMessage.cs │ ├── IReceivedMessage.cs │ ├── IReceivedMessageFactory.cs │ ├── IReceivedMessageInternal.cs │ ├── IRegisterMessages.cs │ ├── IRegisterMessagesAsync.cs │ ├── IRemoveMessage.cs │ ├── IResetHeartBeat.cs │ ├── IRetryDelay.cs │ ├── IRetryDelayFactory.cs │ ├── IRetryInformation.cs │ ├── IRetryInformationFactory.cs │ ├── IRollbackMessage.cs │ ├── IScheduledJob.cs │ ├── ISchedulerMessageHandler.cs │ ├── ISendHeartBeat.cs │ ├── ISendJobToQueue.cs │ ├── ISendMessages.cs │ ├── ISentMessage.cs │ ├── ISentMessageFactory.cs │ ├── ISerializer.cs │ ├── ISetReadonly.cs │ ├── ISetting.cs │ ├── IStandardHeaders.cs │ ├── ITaskFactory.cs │ ├── ITaskFactoryFactory.cs │ ├── ITaskScheduler.cs │ ├── ITaskSchedulerConfiguration.cs │ ├── ITaskSchedulerFactory.cs │ ├── ITransportInit.cs │ ├── ITransportInitDuplex.cs │ ├── ITransportInitReceive.cs │ ├── ITransportInitSend.cs │ ├── IWaitForEventOrCancel.cs │ ├── IWaitForEventOrCancelFactory.cs │ ├── IWaitForEventOrCancelThreadPool.cs │ ├── IWaitForEventOrCancelWorker.cs │ ├── IWorkGroup.cs │ ├── IWorker.cs │ ├── IWorkerBase.cs │ ├── IWorkerCollection.cs │ ├── IWorkerConfiguration.cs │ ├── IWorkerFactory.cs │ ├── IWorkerHeartBeatNotification.cs │ ├── IWorkerHeartBeatNotificationFactory.cs │ ├── IWorkerNameFactory.cs │ ├── IWorkerNotification.cs │ ├── IWorkerNotificationFactory.cs │ ├── IWorkerWaitForEventOrCancel.cs │ ├── Interceptors │ │ ├── GZipMessageInterceptor.cs │ │ ├── Interception.cs │ │ ├── SharedMemoryStream.cs │ │ └── TripleDesMessageInterceptor.cs │ ├── InternalsVisibleForTests.cs │ ├── IoC │ │ ├── ComponentRegistration.cs │ │ ├── ContainerWrapper.cs │ │ └── CreateContainer.cs │ ├── JobScheduler │ │ ├── JobQueue.cs │ │ ├── JobQueueContainerRegistrations.cs │ │ ├── JobSchedule.cs │ │ ├── JobScheduler.cs │ │ ├── JobSchedulerInit.cs │ │ ├── JobSchedulerMetaData.cs │ │ ├── PendingEvent.cs │ │ ├── PendingEventHeap.cs │ │ └── ScheduledJob.cs │ ├── JobSchedulerContainer.cs │ ├── LinqCompile │ │ ├── Decorator │ │ │ └── LinqCompileCacheDecorator.cs │ │ ├── DynamicCodeCompiler.cs │ │ └── LinqCompiler.cs │ ├── Logging │ │ └── Decorator │ │ │ ├── IAbortWorkerThreadDecorator.cs │ │ │ ├── IClearErrorMessagesDecorator.cs │ │ │ ├── IClearExpiredMessagesDecorator.cs │ │ │ ├── IReceivePoisonMessageDecorator.cs │ │ │ ├── IResetHeartBeatDecorator.cs │ │ │ └── IRollbackMessageDecorator.cs │ ├── MessageProcessingModes.cs │ ├── Messages │ │ ├── AdditionalMessageData.cs │ │ ├── AdditionalMetaData.cs │ │ ├── CustomHeaders.cs │ │ ├── GenerateReceivedMessage.cs │ │ ├── HandleMessage.cs │ │ ├── Headers.cs │ │ ├── JobQueueOutputMessage.cs │ │ ├── LinqExpressionToRun.cs │ │ ├── Message.cs │ │ ├── MessageContext.cs │ │ ├── MessageContextData.cs │ │ ├── MessageExpression.cs │ │ ├── MessageHandler.cs │ │ ├── MessageHandlerAsync.cs │ │ ├── MessageHandlerRegistration.cs │ │ ├── MessageHandlerRegistrationAsync.cs │ │ ├── MessageMethodHandling.cs │ │ ├── QueueMessage.cs │ │ ├── QueueOutputMessage.cs │ │ ├── QueueOutputMessages.cs │ │ ├── ReceivedMessage.cs │ │ ├── ReceivedMessageInternal.cs │ │ ├── RegisterMessages.cs │ │ ├── RegisterMessagesAsync.cs │ │ ├── SentMessage.cs │ │ ├── Setting.cs │ │ └── StandardHeaders.cs │ ├── Metrics │ │ ├── Decorator │ │ │ ├── IClearErrorMessagesDecorator.cs │ │ │ ├── IClearExpiredMessagesDecorator.cs │ │ │ ├── ICommitMessageDecorator.cs │ │ │ ├── IExpressionSerializerDecorator.cs │ │ │ ├── IInternalSerializerDecorator.cs │ │ │ ├── ILinqCompilerDecorator.cs │ │ │ ├── IMessageHandlerAsyncDecorator.cs │ │ │ ├── IMessageHandlerDecorator.cs │ │ │ ├── IMessageInterceptorDecorator.cs │ │ │ ├── IMessageMethodHandlingDecorator.cs │ │ │ ├── IQueueCreationDecorator.cs │ │ │ ├── IReceiveMessagesDecorator.cs │ │ │ ├── IReceiveMessagesErrorDecorator.cs │ │ │ ├── IReceivePoisonMessageDecorator.cs │ │ │ ├── IResetHeartBeatDecorator.cs │ │ │ ├── IRollbackMessageDecorator.cs │ │ │ ├── ISendHeartBeatDecorator.cs │ │ │ ├── ISendMessagesDecorator.cs │ │ │ └── ISerializerDecorator.cs │ │ └── NoOp │ │ │ └── MetricsNoOp.cs │ ├── Notifications │ │ ├── BaseNotification.cs │ │ ├── ErrorNotification.cs │ │ ├── ErrorReceiveNotification.cs │ │ ├── MessageCompleteNotification.cs │ │ ├── PoisonMessageNotification.cs │ │ └── RollbackNotification.cs │ ├── Policies │ │ ├── Decorator │ │ │ ├── IReceiveMessagesPolicyDecorator.cs │ │ │ ├── ISendHeartBeatPolicyDecorator.cs │ │ │ └── ISendMessagesPolicyDecorator.cs │ │ ├── Policies.cs │ │ ├── PolicyDefinitions.cs │ │ └── TransportPolicyDefinition.cs │ ├── Queue │ │ ├── AbortWorkerThread.cs │ │ ├── AddStandardMessageHeaders.cs │ │ ├── BaseMonitor.cs │ │ ├── BaseQueue.cs │ │ ├── ClearErrorMessagesMonitor.cs │ │ ├── ClearExpiredMessagesMonitor.cs │ │ ├── ClearExpiredMessagesMonitorNoOp.cs │ │ ├── CommitMessage.cs │ │ ├── ConsumerMethodQueue.cs │ │ ├── ConsumerQueue.cs │ │ ├── ConsumerQueueAsync.cs │ │ ├── ConsumerQueueErrorNotification.cs │ │ ├── ConsumerQueueNotification.cs │ │ ├── ConsumerQueueNotifications.cs │ │ ├── CreationScopeNoOp.cs │ │ ├── GenerateMessageHeaders.cs │ │ ├── GetHeaderDefault.cs │ │ ├── HeartBeatMonitor.cs │ │ ├── HeartBeatMonitorNoOp.cs │ │ ├── HeartBeatScheduler.cs │ │ ├── HeartBeatStatus.cs │ │ ├── HeartBeatWorker.cs │ │ ├── HeartBeatWorkerNoOp.cs │ │ ├── MessageExceptionHandler.cs │ │ ├── MessageProcessing.cs │ │ ├── MessageProcessingAsync.cs │ │ ├── MessageProcessingMode.cs │ │ ├── MultiWorkerBase.cs │ │ ├── PrimaryWorker.cs │ │ ├── ProcessMessage.cs │ │ ├── ProcessMessageAsync.cs │ │ ├── ProducerMethodJobQueue.cs │ │ ├── ProducerMethodQueue.cs │ │ ├── ProducerQueue.cs │ │ ├── QueueCancelWork.cs │ │ ├── QueueContext.cs │ │ ├── QueueDelay.cs │ │ ├── QueueMonitor.cs │ │ ├── QueueScript.cs │ │ ├── QueueWait.cs │ │ ├── QueueWaitNoOp.cs │ │ ├── RollbackMessage.cs │ │ ├── StopThread.cs │ │ ├── StopWorkers.cs │ │ ├── WaitForDelegate.cs │ │ ├── WaitForEventOrCancel.cs │ │ ├── WaitForEventOrCancelWorker.cs │ │ ├── WaitForThreadToFinish.cs │ │ ├── WaitOnAsyncTask.cs │ │ ├── Worker.cs │ │ ├── WorkerBase.cs │ │ ├── WorkerCollection.cs │ │ ├── WorkerErrorEventArgs.cs │ │ ├── WorkerHeartBeatNotification.cs │ │ ├── WorkerHeartBeatNotificationNoOp.cs │ │ ├── WorkerNotificationNoOp.cs │ │ ├── WorkerNotifications.cs │ │ ├── WorkerTerminate.cs │ │ └── WorkerWaitForEventOrCancel.cs │ ├── QueueContainer.cs │ ├── QueueContexts.cs │ ├── QueueCreationContainer.cs │ ├── QueueStatuses.cs │ ├── RegisterConnectionImplementation.cs │ ├── SchedulerContainer.cs │ ├── Serialization │ │ ├── CompositeSerialization.cs │ │ ├── JsonExpressionSerializer.cs │ │ ├── JsonSerializer.cs │ │ ├── JsonSerializerInternal.cs │ │ ├── MessageBody.cs │ │ ├── PrivateSettersContractResolvers.cs │ │ └── RootSerializer.cs │ ├── TaskScheduling │ │ ├── Scheduler.cs │ │ ├── SchedulerInit.cs │ │ ├── SchedulerMessageHandler.cs │ │ ├── SchedulerMethod.cs │ │ ├── SchedulerTaskFactory.cs │ │ ├── StateInformation.cs │ │ ├── TaskScheduler.cs │ │ ├── ThreadPoolConfiguration.cs │ │ ├── WaitForEventOrCancelThreadPool.cs │ │ ├── WorkGroup.cs │ │ ├── WorkGroupNoOp.cs │ │ └── WorkGroupWithItem.cs │ ├── Time │ │ ├── BaseTime.cs │ │ └── LocalMachineTime.cs │ ├── Trace │ │ ├── Decorator │ │ │ ├── CommitMessageDecorator.cs │ │ │ ├── MessageHandlerAsyncDecorator.cs │ │ │ ├── MessageHandlerDecorator.cs │ │ │ ├── MessageInterceptorDecorator.cs │ │ │ ├── MessageMethodHandlingDecorator.cs │ │ │ ├── ProducerMethodJobQueueDecorator.cs │ │ │ ├── ReceiveMessagesDecorator.cs │ │ │ ├── ReceiveMessagesErrorDecorator.cs │ │ │ ├── ReceivePoisonMessageDecorator.cs │ │ │ ├── RemoveMessageDecorator.cs │ │ │ ├── ResetHeartBeatDecorator.cs │ │ │ ├── RollbackMessageDecorator.cs │ │ │ ├── SchedulerMessageHandlerDecorator.cs │ │ │ ├── SendHeartBeatDecorator.cs │ │ │ └── SerializerDecorator.cs │ │ └── InjectHeaders.cs │ ├── Transport │ │ └── Memory │ │ │ ├── Basic │ │ │ ├── Admin │ │ │ │ └── AdminFunctions.cs │ │ │ ├── ClearErrorMessages.cs │ │ │ ├── ClearExpiredMessages.cs │ │ │ ├── CreateJobMetaData.cs │ │ │ ├── CreationScope.cs │ │ │ ├── DataStorage.cs │ │ │ ├── Factory │ │ │ │ ├── CorrelationIdFactory.cs │ │ │ │ ├── ReceiveMessagesFactory.cs │ │ │ │ └── TransportOptionsFactory.cs │ │ │ ├── GetFirstMessageDeliveryTime.cs │ │ │ ├── GetHeader.cs │ │ │ ├── GetPreviousMessageErrorsNoOp.cs │ │ │ ├── JobQueueCreation.cs │ │ │ ├── JobSchedulerLastKnownEvent.cs │ │ │ ├── JobTableCreation.cs │ │ │ ├── MemoryMessageQueueInit.cs │ │ │ ├── Message │ │ │ │ ├── CommitMessage.cs │ │ │ │ ├── HandleMessage.cs │ │ │ │ ├── ReceiveMessage.cs │ │ │ │ └── RollbackMessage.cs │ │ │ ├── MessageCorrelationId.cs │ │ │ ├── MessageQueueCreation.cs │ │ │ ├── MessageQueueID.cs │ │ │ ├── MessageQueueReceive.cs │ │ │ ├── QueueItem.cs │ │ │ ├── ReceiveErrorMessage.cs │ │ │ ├── ReceivePoisonMessage.cs │ │ │ ├── RemoveMessage.cs │ │ │ ├── ResetHeartBeat.cs │ │ │ ├── SendHeartBeat.cs │ │ │ ├── SendMessages.cs │ │ │ └── SendToJobQueue.cs │ │ │ ├── ConfigurationExtensions.cs │ │ │ ├── ConnectionInformation.cs │ │ │ ├── IDataStorage.cs │ │ │ ├── IDataStorageSendMessage.cs │ │ │ ├── ITransportOptionsFactory.cs │ │ │ ├── Trace │ │ │ └── Decorator │ │ │ │ └── DataStorageSendMessageDecorator.cs │ │ │ └── TransportOptions.cs │ ├── app.config │ ├── iClearExpiredMessagesMonitor.cs │ └── netfx │ │ └── System │ │ └── Guard.cs ├── DotNetWorkQueueNoTests.sln └── xunit.runner.json ├── appveyor.yml └── lgpl-2.1.txt /Lib/Aq.ExpressionJsonSerializer/README.md: -------------------------------------------------------------------------------- 1 | Source code can be found here 2 | 3 | https://github.com/blehnen/expression-json-serializer -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net461/Aq.ExpressionJsonSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net461/Aq.ExpressionJsonSerializer.dll -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net461/Aq.ExpressionJsonSerializer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net461/Aq.ExpressionJsonSerializer.pdb -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net472/Aq.ExpressionJsonSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net472/Aq.ExpressionJsonSerializer.dll -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net472/Aq.ExpressionJsonSerializer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net472/Aq.ExpressionJsonSerializer.pdb -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net48/Aq.ExpressionJsonSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net48/Aq.ExpressionJsonSerializer.dll -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net48/Aq.ExpressionJsonSerializer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net48/Aq.ExpressionJsonSerializer.pdb -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net6.0/Aq.ExpressionJsonSerializer.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v6.0", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v6.0": { 9 | "Aq.ExpressionJsonSerializer/1.0.0": { 10 | "dependencies": { 11 | "Newtonsoft.Json": "13.0.1" 12 | }, 13 | "runtime": { 14 | "Aq.ExpressionJsonSerializer.dll": {} 15 | } 16 | }, 17 | "Newtonsoft.Json/13.0.1": { 18 | "runtime": { 19 | "lib/netstandard2.0/Newtonsoft.Json.dll": { 20 | "assemblyVersion": "13.0.0.0", 21 | "fileVersion": "13.0.1.25517" 22 | } 23 | } 24 | } 25 | } 26 | }, 27 | "libraries": { 28 | "Aq.ExpressionJsonSerializer/1.0.0": { 29 | "type": "project", 30 | "serviceable": false, 31 | "sha512": "" 32 | }, 33 | "Newtonsoft.Json/13.0.1": { 34 | "type": "package", 35 | "serviceable": true, 36 | "sha512": "sha512-ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==", 37 | "path": "newtonsoft.json/13.0.1", 38 | "hashPath": "newtonsoft.json.13.0.1.nupkg.sha512" 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net6.0/Aq.ExpressionJsonSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net6.0/Aq.ExpressionJsonSerializer.dll -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/net6.0/Aq.ExpressionJsonSerializer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/net6.0/Aq.ExpressionJsonSerializer.pdb -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/netstandard2.0/Aq.ExpressionJsonSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/netstandard2.0/Aq.ExpressionJsonSerializer.dll -------------------------------------------------------------------------------- /Lib/Aq.ExpressionJsonSerializer/netstandard2.0/Aq.ExpressionJsonSerializer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Aq.ExpressionJsonSerializer/netstandard2.0/Aq.ExpressionJsonSerializer.pdb -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/README.md: -------------------------------------------------------------------------------- 1 | Source code can be found here 2 | 3 | https://github.com/blehnen/GuerrillaNtp -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net461/GuerrillaNtp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net461/GuerrillaNtp.dll -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net461/GuerrillaNtp.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net461/GuerrillaNtp.pdb -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net472/GuerrillaNtp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net472/GuerrillaNtp.dll -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net472/GuerrillaNtp.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net472/GuerrillaNtp.pdb -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net48/GuerrillaNtp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net48/GuerrillaNtp.dll -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net48/GuerrillaNtp.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net48/GuerrillaNtp.pdb -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net6.0/GuerrillaNtp.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v6.0", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v6.0": { 9 | "GuerrillaNtp/1.0.0": { 10 | "runtime": { 11 | "GuerrillaNtp.dll": {} 12 | } 13 | } 14 | } 15 | }, 16 | "libraries": { 17 | "GuerrillaNtp/1.0.0": { 18 | "type": "project", 19 | "serviceable": false, 20 | "sha512": "" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net6.0/GuerrillaNtp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net6.0/GuerrillaNtp.dll -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/net6.0/GuerrillaNtp.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/net6.0/GuerrillaNtp.pdb -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/netstandard2.0/GuerrillaNtp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/netstandard2.0/GuerrillaNtp.dll -------------------------------------------------------------------------------- /Lib/GuerrillaNtp/netstandard2.0/GuerrillaNtp.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/GuerrillaNtp/netstandard2.0/GuerrillaNtp.pdb -------------------------------------------------------------------------------- /Lib/JpLabs.DynamicCode/JpLabs.DynamicCode.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/JpLabs.DynamicCode/JpLabs.DynamicCode.dll -------------------------------------------------------------------------------- /Lib/JpLabs.DynamicCode/JpLabs.DynamicCode.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/JpLabs.DynamicCode/JpLabs.DynamicCode.pdb -------------------------------------------------------------------------------- /Lib/JpLabs.DynamicCode/README.md: -------------------------------------------------------------------------------- 1 | Source code can be found here 2 | 3 | http://jp-labs.blogspot.com/2008/11/dynamic-lambda-expressions-using.html -------------------------------------------------------------------------------- /Lib/Schyntax/README.md: -------------------------------------------------------------------------------- 1 | Source code can be found here 2 | 3 | https://github.com/blehnen/cs-schyntax -------------------------------------------------------------------------------- /Lib/Schyntax/net461/Schyntax.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net461/Schyntax.dll -------------------------------------------------------------------------------- /Lib/Schyntax/net461/Schyntax.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net461/Schyntax.pdb -------------------------------------------------------------------------------- /Lib/Schyntax/net472/Schyntax.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net472/Schyntax.dll -------------------------------------------------------------------------------- /Lib/Schyntax/net472/Schyntax.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net472/Schyntax.pdb -------------------------------------------------------------------------------- /Lib/Schyntax/net48/Schyntax.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net48/Schyntax.dll -------------------------------------------------------------------------------- /Lib/Schyntax/net48/Schyntax.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net48/Schyntax.pdb -------------------------------------------------------------------------------- /Lib/Schyntax/net6.0/Schyntax.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v6.0", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v6.0": { 9 | "Schyntax/1.0.0": { 10 | "runtime": { 11 | "Schyntax.dll": {} 12 | } 13 | } 14 | } 15 | }, 16 | "libraries": { 17 | "Schyntax/1.0.0": { 18 | "type": "project", 19 | "serviceable": false, 20 | "sha512": "" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Lib/Schyntax/net6.0/Schyntax.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net6.0/Schyntax.dll -------------------------------------------------------------------------------- /Lib/Schyntax/net6.0/Schyntax.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/net6.0/Schyntax.pdb -------------------------------------------------------------------------------- /Lib/Schyntax/netstandard2.0/Schyntax.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/netstandard2.0/Schyntax.dll -------------------------------------------------------------------------------- /Lib/Schyntax/netstandard2.0/Schyntax.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Lib/Schyntax/netstandard2.0/Schyntax.pdb -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | License 2 | ======== 3 | Copyright © 2015-2024 Brian Lehnen 4 | 5 | DotNetWorkQueue is an Open Source project licensed under the terms of 6 | the LGPLv2.1 license. Please see http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html 7 | for license text or `lgpl-2.1.txt` file distributed with the source code. 8 | -------------------------------------------------------------------------------- /SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyCompany("Brian Lehnen")] 5 | [assembly: AssemblyCopyright("Copyright © Brian Lehnen 2024")] 6 | [assembly: ComVisible(false)] 7 | [assembly: AssemblyVersion("0.7.6")] 8 | [assembly: AssemblyFileVersion("0.7.6")] 9 | [assembly: AssemblyInformationalVersion("0.7.6")] -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.AppMetrics.Tests/ExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using App.Metrics; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.AppMetrics.Tests 5 | { 6 | public class ExtensionMethods 7 | { 8 | [Fact] 9 | public void GetMetrics() 10 | { 11 | var metrics = new DotNetWorkQueue.AppMetrics.Metrics("test"); 12 | var data = metrics.GetCurrentMetrics(); 13 | Assert.NotNull(data); 14 | 15 | var metrics2 = new DotNetWorkQueue.AppMetrics.Metrics("test2"); 16 | var data2 = metrics2.GetCurrentMetrics(); 17 | Assert.NotNull(data2); 18 | } 19 | } 20 | public static class Creator 21 | { 22 | public static App.Metrics.IMetrics Create() 23 | { 24 | var metrics = new MetricsBuilder() 25 | .Configuration.Configure( 26 | options => 27 | { 28 | options.Enabled = true; 29 | options.ReportingEnabled = true; 30 | }) 31 | .Build(); 32 | 33 | return metrics; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.AppMetrics.Tests/Histogram.cs: -------------------------------------------------------------------------------- 1 | using App.Metrics.Histogram; 2 | using AutoFixture; 3 | using AutoFixture.AutoNSubstitute; 4 | using AutoFixture.Xunit2; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.AppMetrics.Tests 8 | { 9 | public class Histogram 10 | { 11 | [Theory, AutoData] 12 | public void Update(string name, long value, long value2) 13 | { 14 | var metrics = Creator.Create(); 15 | var metric = metrics.Provider.Histogram.Instance(new HistogramOptions() { Name = name }); 16 | var test = Create(metric); 17 | dynamic dyn = metric; 18 | test.Update(value); 19 | Assert.Equal(1, dyn.Value.Count); 20 | Assert.Equal(value, dyn.Value.LastValue); 21 | test.Update(value2); 22 | Assert.Equal(2, dyn.Value.Count); 23 | Assert.Equal(value2, dyn.Value.LastValue); 24 | } 25 | 26 | private IHistogram Create(App.Metrics.Histogram.IHistogram histogram) 27 | { 28 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 29 | fixture.Inject(histogram); 30 | return fixture.Create(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.AppMetrics.Tests/MetricsContext.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture.Xunit2; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.AppMetrics.Tests 5 | { 6 | public class MetricsContext 7 | { 8 | [Theory, AutoData] 9 | public void Create(string name, string name2, string name3, string contextName) 10 | { 11 | using (var parent = new DotNetWorkQueue.AppMetrics.Metrics(name)) 12 | { 13 | using (var metric = parent.Context(contextName)) 14 | { 15 | metric.Gauge(name, () => 1, Units.Bytes); 16 | Assert.NotNull(metric.Meter(name, Units.Bytes)); 17 | Assert.NotNull(metric.Meter(name2, name2, TimeUnits.Seconds)); 18 | Assert.NotNull(metric.Counter(name, Units.Bytes)); 19 | Assert.NotNull(metric.Counter(name2, name2)); 20 | Assert.NotNull(metric.Histogram(name, Units.Bytes)); 21 | Assert.NotNull(metric.Timer(name, Units.Bytes, SamplingTypes.FavorRecent, TimeUnits.Seconds, 22 | TimeUnits.Seconds)); 23 | 24 | var context = metric.Context(name3); 25 | Assert.NotNull(context); 26 | metric.ShutdownContext(name3); 27 | } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.AppMetrics/InternalsVisibleForTests.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | using System.Runtime.CompilerServices; 20 | 21 | [assembly: InternalsVisibleTo("DotNetWorkQueue.AppMetrics.Tests")] 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Metrics/DotNetWorkQueue.IntegrationTests.Metrics.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net48; 5 | 6 | 7 | 8 | TRACE;DEBUG;CODE_ANALYSIS;NETFULL 9 | 10 | 11 | 12 | NETFULL 13 | 14 | 15 | 16 | TRACE;DEBUG;NETSTANDARD2_0;CODE_ANALYSIS; 17 | 18 | 19 | 20 | NETSTANDARD2_0; 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Metrics/Histogram.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetWorkQueue.IntegrationTests.Metrics 2 | { 3 | /// 4 | internal class Histogram : IHistogram 5 | { 6 | /// 7 | public void Update(long value, string userValue = null) 8 | { 9 | //noop 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Metrics/Meter.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | 3 | namespace DotNetWorkQueue.IntegrationTests.Metrics 4 | { 5 | /// 6 | public class Meter : IMeter 7 | { 8 | private long _counter; 9 | 10 | public long Value => Interlocked.Read(ref _counter); 11 | 12 | /// 13 | public void Mark() 14 | { 15 | Interlocked.Increment(ref _counter); 16 | } 17 | 18 | /// 19 | public void Mark(string item) 20 | { 21 | Interlocked.Increment(ref _counter); 22 | } 23 | 24 | /// 25 | public void Mark(long count) 26 | { 27 | Interlocked.Add(ref _counter, count); 28 | } 29 | 30 | /// 31 | public void Mark(string item, long count) 32 | { 33 | Interlocked.Add(ref _counter, count); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Metrics/MetricsData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | 3 | namespace DotNetWorkQueue.IntegrationTests.Metrics 4 | { 5 | public class MetricsData 6 | { 7 | /// 8 | /// Initializes a new instance of the class. 9 | /// 10 | /// The meter. 11 | /// The counter. 12 | public MetricsData(ConcurrentDictionary meter, 13 | ConcurrentDictionary counter) 14 | { 15 | Meters = meter; 16 | Counters = counter; 17 | } 18 | public ConcurrentDictionary Meters { get; } 19 | public ConcurrentDictionary Counters { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Metrics/Timer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetWorkQueue.IntegrationTests.Metrics 4 | { 5 | /// 6 | internal class Timer : ITimer 7 | { 8 | /// 9 | public void Record(long time, TimeUnits unit, string userValue = null) 10 | { 11 | //noop 12 | } 13 | 14 | /// 15 | public void Time(Action action, string userValue = null) 16 | { 17 | //noop 18 | } 19 | 20 | /// 21 | public T Time(Func action, string userValue = null) 22 | { 23 | //noop 24 | throw new NotImplementedException(); 25 | } 26 | 27 | /// 28 | public ITimerContext NewContext(string userValue = null) 29 | { 30 | return new TimerContext(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Metrics/TimerContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetWorkQueue.IntegrationTests.Metrics 4 | { 5 | /// 6 | internal class TimerContext : ITimerContext 7 | { 8 | /// 9 | public TimeSpan Elapsed => TimeSpan.MinValue; 10 | 11 | /// 12 | public void Dispose() 13 | { 14 | //noop 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Shared/ExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.IntegrationTests.Metrics; 2 | 3 | namespace DotNetWorkQueue.IntegrationTests.Shared 4 | { 5 | /// 6 | /// Extension methods for obtaining the current metrics 7 | /// 8 | public static class ExtensionMethods 9 | { 10 | /// 11 | /// Gets the current metric values 12 | /// 13 | /// The data. 14 | public static MetricsData GetCurrentMetrics(this IMetrics data) 15 | { 16 | return (MetricsData)data.CollectedMetrics; 17 | } 18 | /// 19 | /// Gets the current metrics. 20 | /// 21 | /// The data. 22 | /// 23 | public static MetricsData GetCurrentMetrics(this Metrics.Metrics data) 24 | { 25 | return (MetricsData)data.CollectedMetrics; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.IntegrationTests.Shared/TraceSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetWorkQueue.IntegrationTests.Shared 2 | { 3 | internal static class TraceSettings 4 | { 5 | public static string TraceName(string testType) 6 | { 7 | return $"dotnetworkqueue-{testType}"; 8 | } 9 | 10 | public static string Host => "192.168.0.2"; 11 | public static int Port => 6831; 12 | public static bool Enabled => true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Configuration/QueueConfigurationReceiveTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Configuration 9 | { 10 | public class QueueConfigurationReceiveTests 11 | { 12 | [Fact] 13 | public void DefaultCreation() 14 | { 15 | var test = Create(); 16 | Assert.NotNull(test.AdditionalConfiguration); 17 | Assert.NotNull(test.HeaderNames); 18 | Assert.NotNull(test.TimeConfiguration); 19 | Assert.NotNull(test.TransportConfiguration); 20 | } 21 | 22 | private QueueConfigurationReceive Create() 23 | { 24 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 25 | return fixture.Create(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Configuration/QueueConfigurationSendTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Configuration 9 | { 10 | public class QueueConfigurationSendTests 11 | { 12 | [Fact] 13 | public void DefaultCreation() 14 | { 15 | var test = Create(); 16 | Assert.NotNull(test.AdditionalConfiguration); 17 | Assert.NotNull(test.HeaderNames); 18 | Assert.NotNull(test.TimeConfiguration); 19 | Assert.NotNull(test.TransportConfiguration); 20 | } 21 | 22 | private QueueConfigurationSend Create() 23 | { 24 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 25 | return fixture.Create(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Configuration/QueueProducerConfigurationTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Configuration 9 | { 10 | public class QueueProducerConfigurationTests 11 | { 12 | [Fact] 13 | public void Test_DefaultNotReadOnly() 14 | { 15 | var configuration = GetConfiguration(); 16 | Assert.False(configuration.IsReadOnly); 17 | } 18 | [Fact] 19 | public void Set_Readonly() 20 | { 21 | var configuration = GetConfiguration(); 22 | configuration.SetReadOnly(); 23 | Assert.True(configuration.IsReadOnly); 24 | } 25 | [Fact] 26 | public void Set_Readonly_SetsTransportConfiguration() 27 | { 28 | var configuration = GetConfiguration(); 29 | configuration.SetReadOnly(); 30 | 31 | Assert.True(configuration.TransportConfiguration.IsReadOnly); 32 | } 33 | private QueueProducerConfiguration GetConfiguration() 34 | { 35 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 36 | return fixture.Create(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Configuration/TransportConfigurationReceiveTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | using NSubstitute; 5 | 6 | 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Configuration 10 | { 11 | public class TransportConfigurationReceiveTests 12 | { 13 | [Fact] 14 | public void Test_DefaultNotReadOnly() 15 | { 16 | var configuration = GetConfiguration(); 17 | Assert.False(configuration.IsReadOnly); 18 | } 19 | [Fact] 20 | public void Set_Readonly() 21 | { 22 | var configuration = GetConfiguration(); 23 | configuration.SetReadOnly(); 24 | 25 | configuration.FatalExceptionDelayBehavior.Received(1).SetReadOnly(); 26 | configuration.QueueDelayBehavior.Received(1).SetReadOnly(); 27 | configuration.RetryDelayBehavior.Received(1).SetReadOnly(); 28 | } 29 | 30 | private TransportConfigurationReceive GetConfiguration() 31 | { 32 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 33 | return fixture.Create(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Configuration/TransportConfigurationSendTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Configuration 9 | { 10 | public class TransportConfigurationSendTests 11 | { 12 | [Fact] 13 | public void Test_DefaultNotReadOnly() 14 | { 15 | var configuration = GetConfiguration(); 16 | Assert.False(configuration.IsReadOnly); 17 | } 18 | [Fact] 19 | public void Set_Readonly() 20 | { 21 | var configuration = GetConfiguration(); 22 | configuration.SetReadOnly(); 23 | } 24 | private TransportConfigurationSend GetConfiguration() 25 | { 26 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 27 | return fixture.Create(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Exceptions/CommitExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Exceptions; 2 | using System; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Exceptions 6 | { 7 | public class CommitExceptionTests 8 | { 9 | [Fact] 10 | public void Create_Empty() 11 | { 12 | var e = new CommitException(); 13 | Assert.Equal("Exception of type 'DotNetWorkQueue.Exceptions.CommitException' was thrown.", e.Message); 14 | } 15 | [Fact] 16 | public void Create() 17 | { 18 | var e = new CommitException("error", null, null, null); 19 | Assert.Equal("error", e.Message); 20 | } 21 | [Fact] 22 | public void Create_Format() 23 | { 24 | var e = new CommitException("error {0}", null, null, null, 1); 25 | Assert.Equal("error 1", e.Message); 26 | } 27 | [Fact] 28 | public void Create_Inner() 29 | { 30 | var e = new CommitException("error", new Exception(), null, null, null); 31 | Assert.Equal("error", e.Message); 32 | Assert.NotNull(e.InnerException); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Exceptions/DotNetWorkQueueExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Exceptions; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Exceptions 6 | { 7 | public class DotNetWorkQueueExceptionTests 8 | { 9 | [Fact] 10 | public void Create_Empty() 11 | { 12 | var e = new DotNetWorkQueueException(); 13 | Assert.Equal("Exception of type 'DotNetWorkQueue.Exceptions.DotNetWorkQueueException' was thrown.", e.Message); 14 | } 15 | [Fact] 16 | public void Create() 17 | { 18 | var e = new DotNetWorkQueueException("error"); 19 | Assert.Equal("error", e.Message); 20 | } 21 | [Fact] 22 | public void Create_Format() 23 | { 24 | var e = new DotNetWorkQueueException("error {0}", 1); 25 | Assert.Equal("error 1", e.Message); 26 | } 27 | [Fact] 28 | public void Create_Inner() 29 | { 30 | var e = new DotNetWorkQueueException("error", new Exception()); 31 | Assert.Equal("error", e.Message); 32 | Assert.NotNull(e.InnerException); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Exceptions/InterceptorExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Exceptions; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Exceptions 6 | { 7 | public class InterceptorExceptionTests 8 | { 9 | [Fact] 10 | public void Create_Empty() 11 | { 12 | var e = new InterceptorException(); 13 | Assert.Equal("Exception of type 'DotNetWorkQueue.Exceptions.InterceptorException' was thrown.", e.Message); 14 | } 15 | [Fact] 16 | public void Create() 17 | { 18 | var e = new InterceptorException("error"); 19 | Assert.Equal("error", e.Message); 20 | } 21 | [Fact] 22 | public void Create_Format() 23 | { 24 | var e = new InterceptorException("error {0}", 1); 25 | Assert.Equal("error 1", e.Message); 26 | } 27 | [Fact] 28 | public void Create_Inner() 29 | { 30 | var e = new InterceptorException("error", new Exception()); 31 | Assert.Equal("error", e.Message); 32 | Assert.NotNull(e.InnerException); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Exceptions/JobSchedulerExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Exceptions; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Exceptions 6 | { 7 | public class JobSchedulerExceptionTests 8 | { 9 | [Fact()] 10 | public void JobSchedulerException_Test() 11 | { 12 | var e = new JobSchedulerException(); 13 | Assert.Equal("Exception of type 'DotNetWorkQueue.Exceptions.JobSchedulerException' was thrown.", e.Message); 14 | } 15 | 16 | [Fact()] 17 | public void JobSchedulerException_Test1() 18 | { 19 | var e = new JobSchedulerException("error"); 20 | Assert.Equal("error", e.Message); 21 | } 22 | 23 | [Fact()] 24 | public void JobSchedulerException_Test2() 25 | { 26 | var e = new JobSchedulerException("error {0}", 1); 27 | Assert.Equal("error 1", e.Message); 28 | } 29 | 30 | [Fact()] 31 | public void JobSchedulerException_Test3() 32 | { 33 | var e = new JobSchedulerException("error", new Exception()); 34 | Assert.Equal("error", e.Message); 35 | Assert.NotNull(e.InnerException); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Exceptions/ReceiveMessageExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Exceptions; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Exceptions 6 | { 7 | public class ReceiveMessageExceptionTests 8 | { 9 | [Fact] 10 | public void Create_Empty() 11 | { 12 | var e = new ReceiveMessageException(); 13 | Assert.Equal("Exception of type 'DotNetWorkQueue.Exceptions.ReceiveMessageException' was thrown.", e.Message); 14 | } 15 | [Fact] 16 | public void Create() 17 | { 18 | var e = new ReceiveMessageException("error"); 19 | Assert.Equal("error", e.Message); 20 | } 21 | [Fact] 22 | public void Create_Format() 23 | { 24 | var e = new ReceiveMessageException("error {0}", 1); 25 | Assert.Equal("error 1", e.Message); 26 | } 27 | [Fact] 28 | public void Create_Inner() 29 | { 30 | var e = new ReceiveMessageException("error", new Exception()); 31 | Assert.Equal("error", e.Message); 32 | Assert.NotNull(e.InnerException); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Exceptions/SerializationExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Exceptions; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Exceptions 6 | { 7 | public class SerializationExceptionTests 8 | { 9 | [Fact] 10 | public void Create_Empty() 11 | { 12 | var e = new SerializationException(); 13 | Assert.Equal("Exception of type 'DotNetWorkQueue.Exceptions.SerializationException' was thrown.", e.Message); 14 | } 15 | [Fact] 16 | public void Create() 17 | { 18 | var e = new SerializationException("error"); 19 | Assert.Equal("error", e.Message); 20 | } 21 | [Fact] 22 | public void Create_Format() 23 | { 24 | var e = new SerializationException("error {0}", 1); 25 | Assert.Equal("error 1", e.Message); 26 | } 27 | [Fact] 28 | public void Create_Inner() 29 | { 30 | var e = new SerializationException("error", new Exception()); 31 | Assert.Equal("error", e.Message); 32 | Assert.NotNull(e.InnerException); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/GetTimeFactoryNoOpTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Factory; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Tests.Factory 5 | { 6 | public class GetTimeFactoryNoOpTests 7 | { 8 | [Fact] 9 | public void Create() 10 | { 11 | var test = new GetTimeFactoryNoOp(); 12 | Assert.Null(test.Create()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/HeartBeatWorkerFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | using NSubstitute; 5 | 6 | 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Factory 10 | { 11 | public class HeartBeatWorkerFactoryTests 12 | { 13 | [Fact] 14 | public void Create_Disabled() 15 | { 16 | var factory = Create(false); 17 | var monitor = factory.Create(Substitute.For()); 18 | Assert.IsAssignableFrom(monitor); 19 | } 20 | 21 | private IHeartBeatWorkerFactory Create(bool enabled) 22 | { 23 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 24 | var configuration = fixture.Create(); 25 | configuration.Enabled.Returns(enabled); 26 | fixture.Inject(configuration); 27 | return fixture.Create(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/MessageContextFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Factory 9 | { 10 | public class MessageContextFactoryTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | var factory = Create(); 16 | var test = factory.Create(); 17 | Assert.NotNull(test); 18 | } 19 | private IMessageContextFactory Create() 20 | { 21 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 22 | return fixture.Create(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/MessageProcessingFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Factory 9 | { 10 | public class MessageProcessingFactoryTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | var factory = Create(); 16 | factory.Create(); 17 | } 18 | 19 | private IMessageProcessingFactory Create() 20 | { 21 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 22 | return fixture.Create(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/QueueDelayFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using AutoFixture; 4 | using AutoFixture.AutoNSubstitute; 5 | using DotNetWorkQueue.Factory; 6 | 7 | 8 | using Xunit; 9 | 10 | namespace DotNetWorkQueue.Tests.Factory 11 | { 12 | public class QueueDelayFactoryTests 13 | { 14 | [Fact] 15 | public void Create_Default() 16 | { 17 | var factory = Create(); 18 | var test = factory.Create(); 19 | Assert.NotNull(test); 20 | } 21 | [Fact] 22 | public void Create_Default_TimeSpans() 23 | { 24 | var factory = Create(); 25 | var list = new List 26 | { 27 | TimeSpan.FromHours(1), 28 | TimeSpan.FromHours(2), 29 | TimeSpan.FromHours(3) 30 | }; 31 | var test = factory.Create(list); 32 | var i = 0; 33 | foreach (var t in test) 34 | { 35 | Assert.Equal(t, TimeSpan.FromHours(i + 1)); 36 | i++; 37 | } 38 | } 39 | private IQueueDelayFactory Create() 40 | { 41 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 42 | return fixture.Create(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/ReceivedMessageFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | using DotNetWorkQueue.Messages; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Tests.Factory 8 | { 9 | public class ReceivedMessageFactoryTests 10 | { 11 | [Fact] 12 | public void Create_Message() 13 | { 14 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 15 | IMessage message = fixture.Create(); 16 | var messageId = fixture.Create(); 17 | var correlationId = fixture.Create(); 18 | 19 | var factory = Create(fixture); 20 | var messageInternal = factory.Create(message, 21 | messageId, 22 | correlationId); 23 | 24 | Assert.Equal(messageInternal.MessageId, messageId); 25 | Assert.Equal(messageInternal.Body, message.Body); 26 | Assert.Equal(messageInternal.Headers, message.Headers); 27 | Assert.Equal(messageInternal.CorrelationId, correlationId); 28 | } 29 | private IReceivedMessageFactory Create(IFixture fixture) 30 | { 31 | return fixture.Create(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/RetryDelayFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Factory 9 | { 10 | public class RetryDelayFactoryTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | var test = Create().Create(); 16 | Assert.NotNull(test); 17 | } 18 | private IRetryDelayFactory Create() 19 | { 20 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 21 | return fixture.Create(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/WaitForEventOrCancelFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Factory 9 | { 10 | public class WaitForEventOrCancelFactoryTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | var test = Create(); 16 | Assert.NotNull(test.Create()); 17 | } 18 | 19 | private IWaitForEventOrCancelFactory Create() 20 | { 21 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 22 | return fixture.Create(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/WorkerFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | using DotNetWorkQueue.Queue; 5 | using NSubstitute; 6 | 7 | 8 | using Xunit; 9 | 10 | namespace DotNetWorkQueue.Tests.Factory 11 | { 12 | public class WorkerFactoryTests 13 | { 14 | [Fact] 15 | public void Create_Default() 16 | { 17 | var factory = Create(); 18 | Assert.NotNull(factory.Create()); 19 | } 20 | private IWorkerFactory Create() 21 | { 22 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 23 | var container = fixture.Create(); 24 | var mode = fixture.Create(); 25 | container.GetInstance().Returns(mode); 26 | fixture.Inject(container); 27 | return fixture.Create(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/WorkerNotificationFactoryNoOpTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Factory; 2 | using DotNetWorkQueue.Queue; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Factory 6 | { 7 | public class WorkerNotificationFactoryNoOpTests 8 | { 9 | [Fact()] 10 | public void Create_Test() 11 | { 12 | var factory = new WorkerNotificationFactoryNoOp(); 13 | var worker = factory.Create(); 14 | Assert.NotNull(worker); 15 | Assert.IsType(worker); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Factory/WorkerNotificationFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Factory 9 | { 10 | public class WorkerNotificationFactoryTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | var factory = Create(); 16 | Assert.NotNull(factory.Create()); 17 | } 18 | private IWorkerNotificationFactory Create() 19 | { 20 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 21 | return fixture.Create(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/CustomHeadersTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using AutoFixture.Xunit2; 4 | using DotNetWorkQueue.Messages; 5 | using NSubstitute; 6 | 7 | 8 | 9 | using Xunit; 10 | 11 | namespace DotNetWorkQueue.Tests.Messages 12 | { 13 | public class CustomHeadersTests 14 | { 15 | [Theory, AutoData] 16 | public void Create_Default_GetSet(string name) 17 | { 18 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 19 | 20 | var testData = new TestData(); 21 | 22 | var factory = fixture.Create(); 23 | factory.Create(name, testData).Returns(new MessageContextData(name, testData)); 24 | fixture.Inject(factory); 25 | var customHeaders = fixture.Create(); 26 | customHeaders.Add(name, testData); 27 | var data = customHeaders.Get(name); 28 | 29 | Assert.Equal(testData, data.Default); 30 | Assert.Equal(name, data.Name); 31 | } 32 | 33 | public class TestData 34 | { 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/GenerateReceivedMessageTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Messages; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Messages 9 | { 10 | public class GenerateReceivedMessageTests 11 | { 12 | [Fact] 13 | public void TestCreation() 14 | { 15 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 16 | 17 | IGenerateReceivedMessage gen = fixture.Create(); 18 | var inputMessage = fixture.Create(); 19 | inputMessage.Body.Returns(new FakeMessage()); 20 | fixture.Inject(inputMessage); 21 | IReceivedMessageInternal rec = fixture.Create(); 22 | 23 | var message = gen.GenerateMessage(typeof(FakeMessage), rec); 24 | 25 | IReceivedMessage translatedMessage = message; 26 | 27 | Assert.Equal(translatedMessage.Body, rec.Body); 28 | Assert.Equal(translatedMessage.CorrelationId, rec.CorrelationId); 29 | Assert.Equal(translatedMessage.Headers, rec.Headers); 30 | Assert.Equal(translatedMessage.MessageId, rec.MessageId); 31 | } 32 | 33 | private class FakeMessage 34 | { 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/GetPreviousErrorsNoOp.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | namespace DotNetWorkQueue.Tests.Messages 3 | { 4 | internal class GetPreviousErrorsNoOp : IGetPreviousMessageErrors 5 | { 6 | public IReadOnlyDictionary Get(IMessageId id) 7 | { 8 | return new Dictionary(); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/HeadersTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Messages; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Messages 9 | { 10 | public class HeadersTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 16 | 17 | var headers = fixture.Create(); 18 | var customHeaders = fixture.Create(); 19 | fixture.Inject(headers); 20 | fixture.Inject(customHeaders); 21 | var test = fixture.Create(); 22 | 23 | Assert.Equal(headers, test.StandardHeaders); 24 | Assert.Equal(customHeaders, test.CustomHeaders); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/MessageContextDataTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture.Xunit2; 3 | using DotNetWorkQueue.Messages; 4 | 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Tests.Messages 8 | { 9 | public class MessageContextDataTests 10 | { 11 | [Fact] 12 | public void Create_Null_Name_Fails() 13 | { 14 | Assert.Throws( 15 | delegate 16 | { 17 | var test = new MessageContextData(null, null); 18 | Assert.Null(test); 19 | }); 20 | } 21 | 22 | [Theory, AutoData] 23 | public void Create_Null_Data_Ok(string name) 24 | { 25 | var test = new MessageContextData(name, null); 26 | Assert.NotNull(test); 27 | } 28 | 29 | [Theory, AutoData] 30 | public void Create_Default(string name, Data d) 31 | { 32 | var test = new MessageContextData(name, d); 33 | Assert.Equal(name, test.Name); 34 | Assert.Equal(d, test.Default); 35 | } 36 | 37 | public class Data 38 | { 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/MessageHandlerAsyncTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture; 3 | using AutoFixture.AutoNSubstitute; 4 | using DotNetWorkQueue.Messages; 5 | 6 | 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Messages 10 | { 11 | public class MessageHandlerAsyncTests 12 | { 13 | [Fact] 14 | public async void Test_Handle_Null_Arguments_Fails() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var test = fixture.Create(); 18 | await Assert.ThrowsAsync(() => test.HandleAsync(null, null)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/MessageHandlerTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture; 3 | using AutoFixture.AutoNSubstitute; 4 | using DotNetWorkQueue.Messages; 5 | 6 | 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Messages 10 | { 11 | public class MessageHandlerTests 12 | { 13 | [Fact] 14 | public void Test_Handle_Null_Arguments_Fails() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var test = fixture.Create(); 18 | Assert.Throws( 19 | delegate 20 | { 21 | test.Handle(null, null); 22 | }); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/RegisterMessagesAsyncTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using AutoFixture; 4 | using AutoFixture.AutoNSubstitute; 5 | using DotNetWorkQueue.Messages; 6 | using NSubstitute; 7 | 8 | 9 | using Xunit; 10 | 11 | namespace DotNetWorkQueue.Tests.Messages 12 | { 13 | public class RegisterMessagesAsyncTests 14 | { 15 | [Fact] 16 | public void Register() 17 | { 18 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 19 | 20 | var messageHandlerRegistration = fixture.Create(); 21 | fixture.Inject(messageHandlerRegistration); 22 | var test = fixture.Create(); 23 | 24 | Task Action(IReceivedMessage message, IWorkerNotification worker) => null; 25 | test.Register((Func, IWorkerNotification, Task>)Action); 26 | 27 | messageHandlerRegistration.Received(1).Set((Func, IWorkerNotification, Task>)Action); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/RegisterMessagesTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture; 3 | using AutoFixture.AutoNSubstitute; 4 | using DotNetWorkQueue.Messages; 5 | using NSubstitute; 6 | 7 | 8 | using Xunit; 9 | 10 | namespace DotNetWorkQueue.Tests.Messages 11 | { 12 | public class RegisterMessagesTests 13 | { 14 | [Fact] 15 | public void Register() 16 | { 17 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 18 | 19 | var messageHandlerRegistration = fixture.Create(); 20 | fixture.Inject(messageHandlerRegistration); 21 | var test = fixture.Create(); 22 | 23 | void Action(IReceivedMessage message, IWorkerNotification worker) 24 | { 25 | } 26 | 27 | test.Register((Action, IWorkerNotification>)Action); 28 | 29 | messageHandlerRegistration.Received(1).Set((Action, IWorkerNotification>)Action); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/SentMessageTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Messages; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Messages 9 | { 10 | public class SentMessageTests 11 | { 12 | [Fact] 13 | public void Get_MessageId() 14 | { 15 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 16 | var messageId = fixture.Create(); 17 | var id = fixture.Create(); 18 | fixture.Inject(messageId); 19 | fixture.Inject(id); 20 | var test = fixture.Create(); 21 | Assert.Equal(test.MessageId, messageId); 22 | } 23 | 24 | [Fact] 25 | public void Get_CorrelationId() 26 | { 27 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 28 | var messageId = fixture.Create(); 29 | var id = fixture.Create(); 30 | fixture.Inject(messageId); 31 | fixture.Inject(id); 32 | var test = fixture.Create(); 33 | Assert.Equal(test.CorrelationId, id); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/SettingTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Messages; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Tests.Messages 5 | { 6 | public class SettingTests 7 | { 8 | [Fact] 9 | public void Get_Value_Equals() 10 | { 11 | var setting = new FakeSetting(); 12 | var test = new Setting(setting); 13 | Assert.Equal(test.Value, setting); 14 | } 15 | 16 | private class FakeSetting 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Messages/StandardHeadersTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Messages; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.Messages 7 | { 8 | public class StandardHeadersTests 9 | { 10 | private IStandardHeaders Create() 11 | { 12 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 13 | return fixture.Create(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Notifications/ErrorNotificationTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Messages; 4 | using DotNetWorkQueue.Notifications; 5 | using System; 6 | using System.Collections.Generic; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Notifications 10 | { 11 | public class ErrorNotificationTests 12 | { 13 | [Fact] 14 | public void Create_Test() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var messageId = fixture.Create(); 18 | var correlationId = fixture.Create(); 19 | var headers = new Dictionary(); 20 | var notify = new ErrorNotification(messageId, correlationId, headers, new Exception()); 21 | 22 | Assert.NotNull(notify.Error); 23 | Assert.NotNull(notify.CorrelationId); 24 | Assert.NotNull(notify.Headers); 25 | Assert.NotNull(notify.MessageId); 26 | Assert.Null(notify.GetHeader(new MessageContextData("none", null))); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Notifications/ErrorReceiveNotificationTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Notifications; 2 | using System; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Notifications 6 | { 7 | public class ErrorReceiveNotificationTests 8 | { 9 | [Fact] 10 | public void Create_Test() 11 | { 12 | var notify = new ErrorReceiveNotification(new Exception()); 13 | Assert.NotNull(notify.Error); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Notifications/PoisonMessageNotificationTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Exceptions; 4 | using DotNetWorkQueue.Messages; 5 | using DotNetWorkQueue.Notifications; 6 | using System.Collections.Generic; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Notifications 10 | { 11 | public class PoisonMessageNotificationTests 12 | { 13 | [Fact] 14 | public void Create_Test() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var messageId = fixture.Create(); 18 | var correlationId = fixture.Create(); 19 | var headers = new Dictionary(); 20 | var notify = 21 | new PoisonMessageNotification(new PoisonMessageException("error", messageId, correlationId, headers, 22 | null, null)); 23 | 24 | Assert.NotNull(notify.Error); 25 | Assert.NotNull(notify.CorrelationId); 26 | Assert.NotNull(notify.Headers); 27 | Assert.NotNull(notify.MessageId); 28 | Assert.Null(notify.GetHeader(new MessageContextData("none", null))); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Notifications/RollBackNotificationTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Messages; 4 | using DotNetWorkQueue.Notifications; 5 | using System; 6 | using System.Collections.Generic; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Notifications 10 | { 11 | public class RollBackNotificationTests 12 | { 13 | [Fact] 14 | public void Create_Test() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var messageId = fixture.Create(); 18 | var correlationId = fixture.Create(); 19 | var headers = new Dictionary(); 20 | var body = new Exception("none"); 21 | var notify = new RollBackNotification(messageId, correlationId, headers, body); 22 | 23 | Assert.NotNull(notify.Error); 24 | Assert.NotNull(notify.CorrelationId); 25 | Assert.NotNull(notify.Headers); 26 | Assert.NotNull(notify.MessageId); 27 | Assert.Null(notify.GetHeader(new MessageContextData("none", null))); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/ClearErrorMessagesNoOp.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | namespace DotNetWorkQueue.Tests.Queue 3 | { 4 | public class ClearErrorMessagesNoOp : IClearErrorMessages 5 | { 6 | public long ClearMessages(CancellationToken cancelToken) 7 | { 8 | return 0; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/CommitMessageTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Queue; 4 | using NSubstitute; 5 | 6 | 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Queue 10 | { 11 | public class CommitMessageTests 12 | { 13 | [Fact] 14 | public void Test_Commit() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var messageContext = fixture.Create(); 18 | var test = fixture.Create(); 19 | test.Commit(messageContext); 20 | messageContext.Received(1).RaiseCommit(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/GetHeaderDefaultTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Exceptions; 2 | using DotNetWorkQueue.Queue; 3 | using Xunit; 4 | namespace DotNetWorkQueue.Tests.Queue 5 | { 6 | public class GetHeaderDefaultTests 7 | { 8 | [Fact()] 9 | public void GetHeaders_Test() 10 | { 11 | var header = new GetHeaderDefault(); 12 | Assert.Throws(() => header.GetHeaders(null)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/QueueScriptTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Queue; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Tests.Queue 5 | { 6 | public class QueueScriptTests 7 | { 8 | [Fact] 9 | public void HasScript() 10 | { 11 | var script = new QueueScript("true", true); 12 | Assert.True(script.HasScript); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/WaitForDelegateTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using DotNetWorkQueue.Queue; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.Queue 7 | { 8 | public class WaitForDelegateTests 9 | { 10 | [Fact] 11 | public void Test_Timeout() 12 | { 13 | var timer = new Stopwatch(); 14 | timer.Start(); 15 | // ReSharper disable once EqualExpressionComparison 16 | WaitForDelegate.Wait(() => 1 == 1, TimeSpan.FromMilliseconds(1000)); 17 | timer.Stop(); 18 | Assert.InRange(timer.ElapsedMilliseconds, 1000, 1575); 19 | } 20 | [Fact] 21 | public void Test_NoTimeout() 22 | { 23 | WaitForDelegate.Wait(() => 1 == 2); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/WaitOnAsyncTaskTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using DotNetWorkQueue.Queue; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.Queue 7 | { 8 | public class WaitOnAsyncTaskTests 9 | { 10 | [Fact] 11 | public void Wait_None() 12 | { 13 | WaitOnAsyncTask.Wait(() => 1 == 2, 14 | () => { }); 15 | } 16 | [Fact] 17 | public void Wait_Short() 18 | { 19 | var wait = new WaitSometime(); 20 | WaitOnAsyncTask.Wait(() => wait.Wait(1000), 21 | () => { }); 22 | } 23 | 24 | [Fact] 25 | public void Wait_Long() 26 | { 27 | var wait = new WaitSometime(); 28 | WaitOnAsyncTask.Wait(() => wait.Wait(7000), 29 | () => { Console.WriteLine(string.Empty); }); 30 | } 31 | 32 | private class WaitSometime 33 | { 34 | private Stopwatch _watch; 35 | public bool Wait(int time) 36 | { 37 | if (_watch != null) return _watch.ElapsedMilliseconds < time; 38 | 39 | _watch = new Stopwatch(); 40 | _watch.Start(); 41 | 42 | return _watch.ElapsedMilliseconds < time; 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/WorkerErrorEventArgsTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Queue; 3 | using NSubstitute; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.Queue 7 | { 8 | public class WorkerErrorEventArgsTests 9 | { 10 | [Fact] 11 | public void Default() 12 | { 13 | var e = new Exception(); 14 | var worker = Substitute.For(); 15 | var test = new WorkerErrorEventArgs(worker, e); 16 | Assert.Equal(worker, test.Worker); 17 | Assert.Equal(e, test.Error); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Queue/WorkerHeartBeatNotificationNoOpTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture; 3 | using AutoFixture.AutoNSubstitute; 4 | using AutoFixture.Xunit2; 5 | using DotNetWorkQueue.Queue; 6 | 7 | 8 | 9 | using Xunit; 10 | 11 | namespace DotNetWorkQueue.Tests.Queue 12 | { 13 | public class WorkerHeartBeatNotificationNoOpTests 14 | { 15 | [Fact] 16 | public void Error_Is_Null() 17 | { 18 | var test = Create(); 19 | Assert.Null(test.Error); 20 | } 21 | [Fact] 22 | public void ErrorCount_Zero() 23 | { 24 | var test = Create(); 25 | Assert.Equal(0, test.ErrorCount); 26 | } 27 | [Theory, AutoData] 28 | public void SetError_NoOp(string value) 29 | { 30 | var test = Create(); 31 | test.SetError(new AccessViolationException(value)); 32 | Assert.Null(test.Error); 33 | Assert.Equal(0, test.ErrorCount); 34 | } 35 | 36 | private IWorkerHeartBeatNotification Create() 37 | { 38 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 39 | return fixture.Create(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/QueueRemoveResultTests.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace DotNetWorkQueue.Tests 4 | { 5 | public class QueueRemoveResultTests 6 | { 7 | [Fact] 8 | public void Create_SetStatus() 9 | { 10 | var test = new QueueRemoveResult(QueueRemoveStatus.DoesNotExist); 11 | Assert.Equal(QueueRemoveStatus.DoesNotExist, test.Status); 12 | } 13 | 14 | [Fact] 15 | public void Create_Success() 16 | { 17 | var test = new QueueRemoveResult(QueueRemoveStatus.DoesNotExist); 18 | Assert.False(test.Success); 19 | 20 | test = new QueueRemoveResult(QueueRemoveStatus.Success); 21 | Assert.True(test.Success); 22 | 23 | test = new QueueRemoveResult(QueueRemoveStatus.None); 24 | Assert.False(test.Success); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/TaskScheduling/SchedulerInitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using AutoFixture; 4 | using AutoFixture.AutoNSubstitute; 5 | using DotNetWorkQueue.IoC; 6 | using DotNetWorkQueue.TaskScheduling; 7 | using SimpleInjector; 8 | using SimpleInjector.Diagnostics; 9 | using Xunit; 10 | 11 | namespace DotNetWorkQueue.Tests.TaskScheduling 12 | { 13 | public class SchedulerInitTests 14 | { 15 | [Fact] 16 | public void CreateContainer_NoWarnings_SchedulerInitTransport() 17 | { 18 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 19 | var creator = new CreateContainer(); 20 | var c = creator.Create(QueueContexts.TaskScheduler, x => { }, fixture.Create(), y => { }); 21 | 22 | // Assert 23 | Container container = c.Container; 24 | var results = Analyzer.Analyze(container); 25 | Assert.False(results.Any(), Environment.NewLine + 26 | string.Join(Environment.NewLine, 27 | from result in results 28 | select result.Description)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/TaskScheduling/StateInformationTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.TaskScheduling; 2 | using NSubstitute; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.TaskScheduling 6 | { 7 | public class StateInformationTests 8 | { 9 | [Fact] 10 | public void Create_Null_Constructor_Ok() 11 | { 12 | var test = new StateInformation(null); 13 | Assert.Null(test.Group); 14 | } 15 | [Fact] 16 | public void Create_With_WorkGroup() 17 | { 18 | var group = Substitute.For(); 19 | var test = new StateInformation(group); 20 | Assert.Equal(group, test.Group); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/TaskScheduling/WorkGroupWithItemTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using NSubstitute; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.TaskScheduling 7 | { 8 | public class WorkGroupWithItemTests 9 | { 10 | [Fact] 11 | public void Test() 12 | { 13 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 14 | var group = fixture.Create(); 15 | var counter = fixture.Create(); 16 | group.ConcurrencyLevel.Returns(5); 17 | fixture.Inject(group); 18 | fixture.Inject(counter); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Time/LocalMachineTimeTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture; 3 | using AutoFixture.AutoNSubstitute; 4 | using DotNetWorkQueue.Configuration; 5 | using DotNetWorkQueue.Time; 6 | using Microsoft.Extensions.Logging; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Time 10 | { 11 | public class LocalMachineTimeTests 12 | { 13 | [Fact] 14 | public void Name() 15 | { 16 | var test = Create(); 17 | Assert.Equal("Local", test.Name); 18 | } 19 | 20 | [Fact] 21 | public void DateTime_Is_Utc() 22 | { 23 | var test = Create(); 24 | var date = test.GetCurrentUtcDate(); 25 | Assert.Equal(DateTimeKind.Utc, date.Kind); 26 | } 27 | 28 | [Fact] 29 | public void Offset_Is_Zero() 30 | { 31 | var test = Create(); 32 | test.GetCurrentUtcDate(); 33 | var offSet = test.GetCurrentOffset; 34 | Assert.Equal(TimeSpan.Zero, offSet); 35 | } 36 | 37 | private static LocalMachineTime Create() 38 | { 39 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 40 | var configuration = new BaseTimeConfiguration(); 41 | return new LocalMachineTime(fixture.Create(), configuration); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/Basic/ClearExpiredMessagesTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using DotNetWorkQueue.Transport.Memory.Basic; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.Transport.Memory.Basic 7 | { 8 | public class ClearExpiredMessagesTests 9 | { 10 | [Fact()] 11 | public void ClearMessages_Test() 12 | { 13 | var clear = new ClearExpiredMessages(); 14 | Assert.Throws(() => clear.ClearMessages(CancellationToken.None)); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/Basic/JobTableCreationTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Memory.Basic; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Tests.Transport.Memory.Basic 5 | { 6 | public class JobTableCreationTests 7 | { 8 | [Fact()] 9 | public void CreateJobTable_Test() 10 | { 11 | var create = new JobTableCreation(); 12 | var result = create.CreateJobTable(); 13 | Assert.True(create.JobTableExists); //returns true even if not called, as the structure is created at startup of the queue 14 | Assert.Equal(QueueCreationStatus.Success, result.Status); //a no-op, but returns success as we already created it 15 | Assert.True(create.JobTableExists); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/Basic/Message/RollbackMessageTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Memory.Basic.Message; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Tests.Transport.Memory.Basic.Message 5 | { 6 | public class RollbackMessageTests 7 | { 8 | [Fact()] 9 | public void Rollback_Test() 10 | { 11 | var message = new RollbackMessage(); 12 | //no-op 13 | message.Rollback(null); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/Basic/ResetHeartBeatTests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using DotNetWorkQueue.Transport.Memory.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Transport.Memory.Basic 6 | { 7 | public class ResetHeartBeatTests 8 | { 9 | [Fact()] 10 | public void Reset_Test() 11 | { 12 | var heart = new ResetHeartBeat(); 13 | Assert.Empty(heart.Reset(CancellationToken.None)); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/Basic/SendHeartBeatTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.Memory.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Transport.Memory.Basic 6 | { 7 | public class SendHeartBeatTests 8 | { 9 | [Fact()] 10 | public void Send_Test() 11 | { 12 | var send = new SendHeartBeat(); 13 | Assert.Throws(() => send.Send(null)); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/ConfigurationExtensionsForIAdditionalMessageDataTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Messages; 3 | using DotNetWorkQueue.Transport.Memory; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Tests.Transport.Memory 7 | { 8 | public class ConfigurationExtensionsForIAdditionalMessageDataTests 9 | { 10 | [Fact()] 11 | public void SetDelay_Test() 12 | { 13 | var time = DateTime.UtcNow; 14 | var data = new AdditionalMessageData(); 15 | data.SetDelay(time.TimeOfDay); 16 | 17 | Assert.Equal(time.TimeOfDay, data.GetDelay()); 18 | } 19 | 20 | [Fact()] 21 | public void GetDelay_Test() 22 | { 23 | var data = new AdditionalMessageData(); 24 | Assert.Null(data.GetDelay()); 25 | 26 | var time = DateTime.UtcNow; 27 | data.SetDelay(time.TimeOfDay); 28 | Assert.Equal(time.TimeOfDay, data.GetDelay()); 29 | 30 | time = DateTime.UtcNow.AddHours(1); 31 | data.SetDelay(time.TimeOfDay); 32 | Assert.Equal(time.TimeOfDay, data.GetDelay()); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/ConfigurationExtensionsForQueueConfigurationReceiveTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | using DotNetWorkQueue.Exceptions; 5 | using DotNetWorkQueue.Transport.Memory; 6 | using NSubstitute; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Tests.Transport.Memory 10 | { 11 | public class ConfigurationExtensionsForQueueConfigurationReceiveTests 12 | { 13 | [Fact()] 14 | public void Options_Test() 15 | { 16 | var config = Create(); 17 | //options will be null 18 | Assert.Throws(() => config.Options()); 19 | config.AdditionalConfiguration.SetSetting("MemoryTransportOptions", new TransportOptions()); 20 | var data = config.Options(); 21 | Assert.NotNull(data); 22 | } 23 | 24 | private QueueConfigurationReceive Create() 25 | { 26 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 27 | fixture.Inject(new AdditionalConfiguration()); 28 | return fixture.Create(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/ConfigurationExtensionsForQueueConfigurationSendTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Configuration; 4 | using DotNetWorkQueue.Exceptions; 5 | using DotNetWorkQueue.Transport.Memory; 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Tests.Transport.Memory 9 | { 10 | public class ConfigurationExtensionsForQueueConfigurationSendTests 11 | { 12 | [Fact()] 13 | public void Options_Test() 14 | { 15 | var config = Create(); 16 | //options will be null 17 | Assert.Throws(() => config.Options()); 18 | 19 | config.AdditionalConfiguration.SetSetting("MemoryTransportOptions", new TransportOptions()); 20 | var data = config.Options(); 21 | Assert.NotNull(data); 22 | } 23 | 24 | private QueueConfigurationSend Create() 25 | { 26 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 27 | fixture.Inject(new AdditionalConfiguration()); 28 | return fixture.Create(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/ConnectionInformationTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.Transport.Memory; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Tests.Transport.Memory 6 | { 7 | public class ConnectionInformationTests 8 | { 9 | [Fact()] 10 | public void ConnectionInformation_Test() 11 | { 12 | var queue = new QueueConnection("test", string.Empty); 13 | var connection = new ConnectionInformation(queue); 14 | Assert.Equal(connection.Container, queue.Queue); 15 | Assert.Empty(connection.Server); 16 | Assert.Equal(connection.QueueName, queue.Queue); 17 | Assert.Equal(connection.ConnectionString, queue.Connection); 18 | } 19 | 20 | [Fact()] 21 | public void Clone_Test() 22 | { 23 | var queue = new QueueConnection("test", string.Empty); 24 | var connection = new ConnectionInformation(queue); 25 | var clone = connection.Clone(); 26 | Assert.Equal(connection.Container, clone.Container); 27 | Assert.Equal(connection.QueueName, clone.QueueName); 28 | Assert.Equal(connection.ConnectionString, clone.ConnectionString); 29 | Assert.Equal(connection.Server, clone.Server); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/Transport/Memory/TransportOptionsTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Memory; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Tests.Transport.Memory 5 | { 6 | public class TransportOptionsTests 7 | { 8 | [Fact()] 9 | public void ValidConfiguration_Test() 10 | { 11 | var options = new TransportOptions(); 12 | var valid = options.ValidConfiguration(); 13 | Assert.True(valid.Valid); 14 | options.SetReadOnly(); 15 | valid = options.ValidConfiguration(); 16 | Assert.True(valid.Valid); 17 | } 18 | 19 | [Fact()] 20 | public void SetReadOnly_Test() 21 | { 22 | var options = new TransportOptions(); 23 | Assert.False(options.IsReadOnly); 24 | options.SetReadOnly(); 25 | Assert.True(options.IsReadOnly); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.LiteDB.IntegrationTests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using System; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | #endregion 8 | 9 | namespace DotNetWorkQueue.Transport.LiteDb.IntegrationTests 10 | { 11 | public static class GenerateQueueName 12 | { 13 | /// 14 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 15 | /// 16 | /// 17 | public static string Create() 18 | { 19 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 20 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 21 | return "I" + BitConverter.ToString(hash) 22 | .Replace("-", string.Empty) 23 | .Replace("_", string.Empty) 24 | .ToLower(); 25 | 26 | } 27 | public static string CreateFileName() 28 | { 29 | return Create() + ".db"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.LiteDB.Linq.Integration.Tests/JobScheduler/JobSchedulerMultipleTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.JobScheduler; 4 | using DotNetWorkQueue.Transport.LiteDb.Basic; 5 | using DotNetWorkQueue.Transport.LiteDb.IntegrationTests; 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.LiteDb.Linq.Integration.Tests.JobScheduler 9 | { 10 | [Collection("Consumer")] 11 | public class JobSchedulerMultipleTests 12 | { 13 | [Theory] 14 | [InlineData(2)] 15 | public void Run( 16 | int producerCount) 17 | { 18 | using (var connectionInfo = new IntegrationConnectionInfo(IntegrationConnectionInfo.ConnectionTypes.Direct)) 19 | { 20 | var queueName = GenerateQueueName.Create(); 21 | var consumer = 22 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerMultipleTests(); 23 | 24 | consumer.Run(new QueueConnection(queueName, 25 | connectionInfo.ConnectionString), producerCount); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.LiteDB.Linq.Integration.Tests/JobScheduler/JobSchedulerTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.Transport.LiteDb.Basic; 3 | using DotNetWorkQueue.Transport.LiteDb.IntegrationTests; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.LiteDb.Linq.Integration.Tests.JobScheduler 7 | { 8 | [Collection("Consumer")] 9 | public class JobSchedulerTests 10 | { 11 | [Theory] 12 | [InlineData(false), 13 | InlineData(true)] 14 | public void Run( 15 | bool dynamic) 16 | { 17 | using (var connectionInfo = new IntegrationConnectionInfo(IntegrationConnectionInfo.ConnectionTypes.Direct)) 18 | { 19 | var queueName = GenerateQueueName.Create(); 20 | var consumer = 21 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerTests(); 22 | 23 | consumer.Run(new QueueConnection(queueName, 24 | connectionInfo.ConnectionString), false, dynamic, Helpers.Verify, Helpers.SetError); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.LiteDB/Basic/Command/DeleteQueueTablesCommand.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue.Transport.LiteDb.Basic.Command 20 | { 21 | /// 22 | /// Deletes the tables for a queue 23 | /// 24 | public class DeleteQueueTablesCommand 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.LiteDB/InternalsVisibleForTests.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | using System.Runtime.CompilerServices; 20 | 21 | [assembly: InternalsVisibleTo("DotNetWorkQueue.Transport.LiteDb.Tests")] -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.LiteDb.Tests/LiteDbConnectionInformationTests.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | using DotNetWorkQueue.Configuration; 3 | 4 | namespace DotNetWorkQueue.Transport.LiteDb.Tests 5 | { 6 | public class LiteDbConnectionInformationTests 7 | { 8 | private const string GoodConnection = 9 | @"FileName=c:\temp\test.db;"; 10 | 11 | [Fact()] 12 | public void LiteDbConnectionInformation_Test() 13 | { 14 | var test = new LiteDbConnectionInformation(new QueueConnection("blah", GoodConnection)); 15 | Assert.Equal("blah", test.QueueName); 16 | Assert.Equal(GoodConnection, test.ConnectionString); 17 | } 18 | 19 | [Fact()] 20 | public void Clone_Test() 21 | { 22 | var test = new LiteDbConnectionInformation(new QueueConnection("blah", GoodConnection)); 23 | var clone = test.Clone(); 24 | 25 | Assert.Equal(test.ConnectionString, clone.ConnectionString); 26 | Assert.Equal(test.QueueName, clone.QueueName); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using System; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | #endregion 8 | 9 | namespace DotNetWorkQueue.Transport.Memory.Integration.Tests 10 | { 11 | public static class GenerateQueueName 12 | { 13 | /// 14 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 15 | /// 16 | /// 17 | public static string Create() 18 | { 19 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 20 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 21 | return "I" + BitConverter.ToString(hash) 22 | .Replace("-", string.Empty) 23 | .Replace("_", string.Empty) 24 | .ToLower(); 25 | 26 | } 27 | public static string CreateFileName() 28 | { 29 | return Create() + ".db3"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/IntegrationConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetWorkQueue.Transport.Memory.Integration.Tests 4 | { 5 | public class IntegrationConnectionInfo : IDisposable //noop for now 6 | { 7 | public string ConnectionString => "none"; 8 | 9 | public void Dispose() 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Producer/SimpleProducer.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.Producer; 4 | using DotNetWorkQueue.Transport.Memory.Basic; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Memory.Integration.Tests.Producer 8 | { 9 | [Collection("producer")] 10 | public class SimpleProducer 11 | { 12 | [Theory] 13 | [InlineData(1000, true), 14 | InlineData(1000, false)] 15 | public void Run( 16 | int messageCount, 17 | bool interceptors) 18 | { 19 | using (var connectionInfo = new IntegrationConnectionInfo()) 20 | { 21 | var queueName = GenerateQueueName.Create(); 22 | var producer = new DotNetWorkQueue.IntegrationTests.Shared.Producer.Implementation.SimpleProducer(); 23 | producer.Run(new QueueConnection(queueName, 24 | connectionInfo.ConnectionString), 25 | messageCount, interceptors, false, false, x => { }, 26 | Helpers.GenerateData, Helpers.Verify); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Producer/SimpleProducerAsync.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.Transport.Memory.Basic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Memory.Integration.Tests.Producer 8 | { 9 | [Collection("producer")] 10 | public class SimpleProducerAsync 11 | { 12 | [Theory] 13 | [InlineData(1000, true), 14 | InlineData(1000, false)] 15 | public async Task Run( 16 | int messageCount, 17 | bool interceptors) 18 | { 19 | using (var connectionInfo = new IntegrationConnectionInfo()) 20 | { 21 | var queueName = GenerateQueueName.Create(); 22 | var producer = new DotNetWorkQueue.IntegrationTests.Shared.Producer.Implementation.SimpleProducerAsync(); 23 | await producer.Run(new QueueConnection(queueName, 24 | connectionInfo.ConnectionString), 25 | messageCount, interceptors, false, false, x => { }, 26 | Helpers.GenerateData, Helpers.Verify); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Producer/SimpleProducerAsyncBatch.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.Transport.Memory.Basic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Memory.Integration.Tests.Producer 8 | { 9 | [Collection("producer")] 10 | public class SimpleProducerAsyncBatch 11 | { 12 | [Theory] 13 | [InlineData(1000, true), 14 | InlineData(1000, false)] 15 | public async Task Run( 16 | int messageCount, 17 | bool interceptors) 18 | { 19 | 20 | using (var connectionInfo = new IntegrationConnectionInfo()) 21 | { 22 | var queueName = GenerateQueueName.Create(); 23 | var producer = new DotNetWorkQueue.IntegrationTests.Shared.Producer.Implementation.SimpleProducerAsync(); 24 | await producer.Run(new QueueConnection(queueName, 25 | connectionInfo.ConnectionString), 26 | messageCount, interceptors, false, true, x => { }, 27 | Helpers.GenerateData, Helpers.Verify); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Integration.Tests/Producer/SimpleProducerBatch.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.Producer; 4 | using DotNetWorkQueue.Transport.Memory.Basic; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Memory.Integration.Tests.Producer 8 | { 9 | [Collection("producer")] 10 | public class SimpleProducerBatch 11 | { 12 | [Theory] 13 | [InlineData(1000, false), 14 | InlineData(1000, true)] 15 | public void Run( 16 | int messageCount, 17 | bool interceptors) 18 | { 19 | using (var connectionInfo = new IntegrationConnectionInfo()) 20 | { 21 | var queueName = GenerateQueueName.Create(); 22 | var producer = new DotNetWorkQueue.IntegrationTests.Shared.Producer.Implementation.SimpleProducer(); 23 | producer.Run(new QueueConnection(queueName, 24 | connectionInfo.ConnectionString), 25 | messageCount, interceptors, false, true, x => { }, 26 | Helpers.GenerateData, Helpers.Verify); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using System; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | #endregion 8 | namespace DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests 9 | { 10 | public static class GenerateQueueName 11 | { 12 | /// 13 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 14 | /// 15 | /// 16 | public static string Create() 17 | { 18 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 19 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 20 | return "I" + BitConverter.ToString(hash) 21 | .Replace("-", string.Empty) 22 | .Replace("_", string.Empty) 23 | .ToLower(); 24 | 25 | } 26 | public static string CreateFileName() 27 | { 28 | return Create() + ".db3"; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests/IntegrationConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests 4 | { 5 | public class IntegrationConnectionInfo : IDisposable //noop for now 6 | { 7 | public string ConnectionString => "none"; 8 | 9 | public void Dispose() 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests/JobScheduler/JobSchedulerTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.JobScheduler; 4 | using DotNetWorkQueue.Transport.Memory.Basic; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Memory.Linq.Integration.Tests.JobScheduler 8 | { 9 | [CollectionDefinition("JobScheduler", DisableParallelization = true)] 10 | public class JobSchedulerTests 11 | { 12 | [Theory] 13 | #if NETFULL 14 | [InlineData(true)] 15 | #else 16 | [InlineData(false)] 17 | #endif 18 | public void Run( 19 | bool dynamic) 20 | { 21 | using (var connectionInfo = new IntegrationConnectionInfo()) 22 | { 23 | var queueName = GenerateQueueName.Create(); 24 | var consumer = 25 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerTests(); 26 | 27 | consumer.Run(new QueueConnection(queueName, 28 | connectionInfo.ConnectionString), false, dynamic, Helpers.Verify, Helpers.SetError); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests/ConnectionString.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests 2 | { 3 | public static class ConnectionInfo 4 | { 5 | /// 6 | /// The connection string to the SQL DB for the integration tests. All tests in this project will use this connection string 7 | /// 8 | public static string ConnectionString = 9 | "Server=192.168.0.2;Port=5432;Database=integrationtesting;Maximum Pool Size=250;userid=brian;Trust Server Certificate=true"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using System; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | #endregion 8 | 9 | namespace DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests 10 | { 11 | public static class GenerateQueueName 12 | { 13 | /// 14 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 15 | /// 16 | /// 17 | public static string Create() 18 | { 19 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 20 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 21 | return "INTTEST" + BitConverter.ToString(hash) 22 | .Replace("-", string.Empty) 23 | .Replace("_", string.Empty) 24 | .ToLower(); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests/Producer/MultiProducer.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.Transport.PostgreSQL.Basic; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests.Producer 7 | { 8 | [Collection("producer")] 9 | public class MultiProducer 10 | { 11 | [Theory] 12 | [InlineData(1000, false), 13 | InlineData(10, true)] 14 | public void Run(int messageCount, bool enableChaos) 15 | { 16 | var queueName = GenerateQueueName.Create(); 17 | var producer = new DotNetWorkQueue.IntegrationTests.Shared.Producer.Implementation.MultiProducer(); 18 | producer.Run(new QueueConnection(queueName, 19 | ConnectionInfo.ConnectionString), 20 | messageCount, enableChaos, 10, x => { }, Helpers.GenerateData, Helpers.Verify, VerifyQueueData); 21 | } 22 | 23 | private void VerifyQueueData(QueueConnection arg1, IBaseTransportOptions arg2, ICreationScope arg3, long arg4, long arg5, string arg6) 24 | { 25 | new VerifyQueueData(arg1.Queue, (PostgreSqlMessageQueueTransportOptions)arg2).Verify(arg4 * arg5, arg6); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests/JobScheduler/JobSchedulerMultipleTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.JobScheduler; 4 | using DotNetWorkQueue.Queue; 5 | using DotNetWorkQueue.Transport.PostgreSQL.Basic; 6 | using DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests.JobScheduler 10 | { 11 | [CollectionDefinition("JobScheduler", DisableParallelization = true)] 12 | public class JobSchedulerMultipleTests 13 | { 14 | [Theory] 15 | [InlineData(2)] 16 | public void Run( 17 | int producerCount) 18 | { 19 | var queueName = GenerateQueueName.Create(); 20 | var consumer = 21 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerMultipleTests(); 22 | 23 | consumer.Run(new QueueConnection(queueName, 24 | ConnectionInfo.ConnectionString), producerCount); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests/JobScheduler/JobSchedulerTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.JobScheduler; 4 | using DotNetWorkQueue.Transport.PostgreSQL.Basic; 5 | using DotNetWorkQueue.Transport.PostgreSQL.Integration.Tests; 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.PostgreSQL.Linq.Integration.Tests.JobScheduler 9 | { 10 | [CollectionDefinition("JobScheduler", DisableParallelization = true)] 11 | public class JobSchedulerTests 12 | { 13 | [Theory] 14 | #if NETFULL 15 | 16 | #else 17 | 18 | #endif 19 | [InlineData(true, false), 20 | InlineData(true, true)] 21 | public void Run( 22 | bool interceptors, 23 | bool dynamic) 24 | { 25 | var queueName = GenerateQueueName.Create(); 26 | var consumer = 27 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerTests(); 28 | 29 | consumer.Run( 30 | new QueueConnection(queueName, 31 | ConnectionInfo.ConnectionString), interceptors, dynamic, Helpers.Verify, Helpers.SetError); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Tests/Basic/Command/CreateQueueTablesAndSaveConfigurationCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DotNetWorkQueue.Transport.PostgreSQL.Schema; 3 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.PostgreSQL.Tests.Basic.Command 7 | { 8 | public class CreateQueueTablesAndSaveConfigurationCommandTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var tables = new List(); 14 | var test = new CreateQueueTablesAndSaveConfigurationCommand
(tables); 15 | Assert.Equal(tables, test.Tables); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Tests/Basic/Factory/SqlServerMessageQueueTransportOptionsFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.PostgreSQL.Basic.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.PostgreSQL.Tests.Basic.Factory 9 | { 10 | public class PostgreSqlMessageQueueTransportOptionsFactoryTests 11 | { 12 | [Fact] 13 | public void Create() 14 | { 15 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 16 | var test = fixture.Create(); 17 | test.Create(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL.Tests/Schema/ColumnsTests.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using DotNetWorkQueue.Transport.PostgreSQL.Schema; 4 | using Xunit; 5 | 6 | #endregion 7 | 8 | namespace DotNetWorkQueue.Transport.PostgreSQL.Tests.Schema 9 | { 10 | public class ColumnsTests 11 | { 12 | [Fact] 13 | public void Add_Column() 14 | { 15 | var test = new Columns(); 16 | test.Add(new Column("testing", ColumnTypes.Bigint, true)); 17 | Assert.Contains(test.Items, item => item.Name == "testing"); 18 | } 19 | [Fact] 20 | public void Remove_Column() 21 | { 22 | var test = new Columns(); 23 | var column = new Column("testing", ColumnTypes.Bigint, true); 24 | test.Add(column); 25 | test.Remove(column); 26 | Assert.DoesNotContain(test.Items, item => item.Name == "testing"); 27 | } 28 | [Fact] 29 | public void Script() 30 | { 31 | var test = new Columns(); 32 | test.Add(new Column("testing", ColumnTypes.Bigint, true)); 33 | Assert.Contains("testing", test.Script()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.PostgreSQL/InternalsVisibleForTests.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | using System.Runtime.CompilerServices; 20 | 21 | [assembly: InternalsVisibleTo("DotNetWorkQueue.Transport.PostgreSQL.Tests")] -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.IntegrationTests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.IntegrationTests/ConnectionString.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetWorkQueue.Transport.Redis.IntegrationTests 2 | { 3 | public class ConnectionInfo 4 | { 5 | /// 6 | /// The connection string to the redis server for the integration tests. All tests in this project will use this connection string for linux tests 7 | /// 8 | private const string ConnectionStringLinux = "192.168.0.2,defaultDatabase=1,syncTimeout=15000"; 9 | /// 10 | /// The connection string to the redis server for the integration tests. All tests in this project will use this connection string for windows tests 11 | /// 12 | private readonly ConnectionInfoTypes _type; 13 | public ConnectionInfo(ConnectionInfoTypes type) 14 | { 15 | _type = type; 16 | } 17 | 18 | public string ConnectionString 19 | { 20 | get 21 | { 22 | switch (_type) 23 | { 24 | case ConnectionInfoTypes.Linux: 25 | return ConnectionStringLinux; 26 | default: 27 | return string.Empty; 28 | } 29 | } 30 | } 31 | } 32 | 33 | public enum ConnectionInfoTypes 34 | { 35 | Linux = 0 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.IntegrationTests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.IntegrationTests 6 | { 7 | public static class GenerateQueueName 8 | { 9 | /// 10 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 11 | /// 12 | /// 13 | public static string Create() 14 | { 15 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 16 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 17 | return "IT" + BitConverter.ToString(hash) 18 | .Replace("-", string.Empty) 19 | .Replace("_", string.Empty) 20 | .ToLower(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Linq.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/DeleteMessageCommandTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture.Xunit2; 2 | using DotNetWorkQueue.Transport.Redis.Basic; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 4 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 8 | { 9 | public class DeleteMessageCommandTests 10 | { 11 | [Theory, AutoData] 12 | public void Create_Default(string number) 13 | { 14 | var test = new DeleteMessageCommand(number); 15 | Assert.Equal(number, test.QueueId); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/MoveDelayedRecordsCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 6 | { 7 | public class MoveDelayedRecordsCommandTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | using (var cancel = new CancellationTokenSource()) 13 | { 14 | var test = new MoveDelayedRecordsCommand(cancel.Token); 15 | Assert.NotNull(test); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/MoveRecordToErrorQueueCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture.Xunit2; 3 | using DotNetWorkQueue.Transport.Redis.Basic; 4 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 5 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 6 | using NSubstitute; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 10 | { 11 | public class MoveRecordToErrorQueueCommandTests 12 | { 13 | [Theory, AutoData] 14 | public void Create_Default(string number) 15 | { 16 | var error = new Exception(); 17 | var context = Substitute.For(); 18 | var test = new MoveRecordToErrorQueueCommand(error, number, context); 19 | Assert.Equal(number, test.QueueId); 20 | Assert.Equal(error, test.Exception); 21 | Assert.Equal(context, test.MessageContext); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/ResetHeartBeatCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 4 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 8 | { 9 | public class ResetHeartBeatCommandTests 10 | { 11 | [Fact] 12 | public void Create_Default() 13 | { 14 | var test = new ResetHeartBeatCommand(new MessageToReset(string.Empty, DateTime.Now, null)); 15 | Assert.NotNull(test); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/RollbackMessageCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AutoFixture.Xunit2; 3 | using DotNetWorkQueue.Transport.Redis.Basic; 4 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 5 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 9 | { 10 | public class RollbackMessageCommandTests 11 | { 12 | [Theory, AutoData] 13 | public void Create_Null_Constructor_Time_Ok(string number) 14 | { 15 | var test = new RollbackMessageCommand(null, number, null); 16 | Assert.NotNull(test); 17 | } 18 | [Theory, AutoData] 19 | public void Create_Default(string number) 20 | { 21 | var test = new RollbackMessageCommand(null, number, null); 22 | Assert.Equal(number, test.QueueId); 23 | Assert.Null(test.IncreaseQueueDelay); 24 | 25 | TimeSpan? time = TimeSpan.MinValue; 26 | test = new RollbackMessageCommand(null, number, time); 27 | Assert.Equal(number, test.QueueId); 28 | Assert.Equal(time, test.IncreaseQueueDelay); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/SaveMetaDataCommandTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture.Xunit2; 2 | using DotNetWorkQueue.Transport.Redis.Basic; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 7 | { 8 | public class SaveMetaDataCommandTests 9 | { 10 | [Theory, AutoData] 11 | public void Create_Default(string number, int metaNumber) 12 | { 13 | var id = new RedisQueueId(number); 14 | var meta = new RedisMetaData(metaNumber); 15 | var test = new SaveMetaDataCommand(id, meta); 16 | Assert.Equal(id, test.Id); 17 | Assert.Equal(meta, test.MetaData); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/SendHeartBeatCommandTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture.Xunit2; 2 | using DotNetWorkQueue.Transport.Redis.Basic; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 4 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 8 | { 9 | public class SendHeartBeatCommandTests 10 | { 11 | [Theory, AutoData] 12 | public void Create_Default(string number) 13 | { 14 | var test = new SendHeartBeatCommand(number); 15 | Assert.Equal(number, test.QueueId); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/SendMessageCommandBatchTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DotNetWorkQueue.Messages; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 7 | { 8 | public class SendMessageCommandBatchTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var messages = new List>(); 14 | var test = new SendMessageCommandBatch(messages); 15 | Assert.Equal(messages, test.Messages); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Command/SendMessageCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic.Command; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 3 | using NSubstitute; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Command 7 | { 8 | public class SendMessageCommandTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var message = Substitute.For(); 14 | var data = Substitute.For(); 15 | var test = new SendMessageCommand(message, data); 16 | Assert.Equal(message, test.MessageToSend); 17 | Assert.Equal(data, test.MessageData); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Factory/ReceiveMessagesFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Factory 9 | { 10 | public class ReceiveMessagesFactoryTests 11 | { 12 | [Fact] 13 | public void Create() 14 | { 15 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 16 | var test = fixture.Create(); 17 | test.Create(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Factory/RedisQueueCorrelationIdFactoryTest.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Factory; 4 | 5 | 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Factory 9 | { 10 | public class RedisQueueCorrelationIdFactoryTest 11 | { 12 | [Fact] 13 | public void Create() 14 | { 15 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 16 | var test = fixture.Create(); 17 | test.Create(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Factory/RedisQueueWorkSubFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Factory; 4 | using NSubstitute; 5 | 6 | 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Factory 10 | { 11 | public class RedisQueueWorkSubFactoryTests 12 | { 13 | [Fact] 14 | public void Create() 15 | { 16 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 17 | var test = fixture.Create(); 18 | test.Create(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Factory/UnixTimeFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Exceptions; 4 | using DotNetWorkQueue.Transport.Redis.Basic; 5 | using DotNetWorkQueue.Transport.Redis.Basic.Factory; 6 | 7 | 8 | using Xunit; 9 | 10 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Factory 11 | { 12 | public class UnixTimeFactoryTests 13 | { 14 | [Fact] 15 | public void Create() 16 | { 17 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 18 | var options = Helpers.CreateOptions(); 19 | fixture.Inject(options); 20 | var test = fixture.Create(); 21 | test.Create(); 22 | 23 | options.TimeServer = TimeLocations.LocalMachine; 24 | test.Create(); 25 | 26 | options.TimeServer = TimeLocations.SntpServer; 27 | test.Create(); 28 | 29 | options.TimeServer = TimeLocations.Custom; 30 | test.Create(); 31 | 32 | options.TimeServer = (TimeLocations)99; 33 | Assert.Throws( 34 | delegate 35 | { 36 | test.Create(); 37 | }); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/MessageID/GetUuidMessageIdTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.Redis.Basic.MessageID; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.MessageID 6 | { 7 | public class GetUuidMessageIdTests 8 | { 9 | [Fact] 10 | public void Create() 11 | { 12 | var test = new GetUuidMessageId(); 13 | Assert.IsAssignableFrom(new Guid(test.Create().Id.Value.ToString())); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Query/GetMetaDataQueryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture.Xunit2; 2 | using DotNetWorkQueue.Transport.Redis.Basic; 3 | using DotNetWorkQueue.Transport.Redis.Basic.Query; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Query 7 | { 8 | public class GetMetaDataQueryTests 9 | { 10 | [Theory, AutoData] 11 | public void Create_Default(string number) 12 | { 13 | var id = new RedisQueueId(number); 14 | var test = new GetMetaDataQuery(id); 15 | Assert.Equal(id, test.Id); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Query/ReceiveMessageQueryTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic.Query; 2 | using NSubstitute; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Query 6 | { 7 | public class ReceiveMessageQueryTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var context = Substitute.For(); 13 | var test = new ReceiveMessageQuery(context); 14 | Assert.Equal(context, test.MessageContext); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisErrorTrackingTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 5 | { 6 | public class RedisErrorTrackingTests 7 | { 8 | [Fact] 9 | public void Exception_Count_Zero_Default() 10 | { 11 | var test = new RedisErrorTracking(); 12 | var value = test.GetExceptionCount("test"); 13 | Assert.Equal(0, value); 14 | } 15 | [Fact] 16 | public void Exception_Count_Increment() 17 | { 18 | var test = new RedisErrorTracking(); 19 | test.IncrementExceptionCount("test"); 20 | var value = test.GetExceptionCount("test"); 21 | Assert.Equal(1, value); 22 | value = test.GetExceptionCount("test_no_value"); 23 | Assert.Equal(0, value); 24 | test.IncrementExceptionCount("test"); 25 | value = test.GetExceptionCount("test"); 26 | Assert.Equal(2, value); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisHeadersTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.Redis.Basic; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 7 | { 8 | public class RedisHeadersTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var test = Create(); 14 | Assert.NotNull(test.CorrelationId); 15 | Assert.NotNull(test.IncreaseQueueDelay); 16 | } 17 | 18 | private RedisHeaders Create() 19 | { 20 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 21 | return fixture.Create(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisMessageTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using NSubstitute; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 6 | { 7 | public class RedisMessageTests 8 | { 9 | [Fact] 10 | public void Create_Null_Message_OK() 11 | { 12 | var test = new RedisMessage(null, null, false); 13 | Assert.Null(test.Message); 14 | } 15 | [Fact] 16 | public void Create_Message() 17 | { 18 | var message = Substitute.For(); 19 | var test = new RedisMessage("1", message, false); 20 | Assert.Equal(message, test.Message); 21 | Assert.Equal("1", test.MessageId); 22 | } 23 | [Fact] 24 | public void Create_Null_Message_Expired_False() 25 | { 26 | var test = new RedisMessage("1", null, false); 27 | Assert.False(test.Expired); 28 | } 29 | [Fact] 30 | public void Create_Null_Message_Expired_True() 31 | { 32 | var test = new RedisMessage("1", null, true); 33 | Assert.True(test.Expired); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisMetaDataTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 5 | { 6 | public class RedisMetaDataTests 7 | { 8 | [Fact] 9 | public void Create_Default() 10 | { 11 | var test = new RedisMetaData(1000); 12 | Assert.Equal(1000, test.QueueDateTime); 13 | Assert.NotNull(test.ErrorTracking); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisNamesTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using NSubstitute; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 6 | { 7 | public class RedisNamesTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var test = new RedisNames(CreateConnection()); 13 | Assert.Contains("testQueue", test.Values); 14 | Assert.Contains("testQueue", test.Delayed); 15 | Assert.Contains("testQueue", test.Error); 16 | Assert.Contains("testQueue", test.Expiration); 17 | Assert.Contains("testQueue", test.Id); 18 | Assert.Contains("testQueue", test.MetaData); 19 | Assert.Contains("testQueue", test.Notification); 20 | Assert.Contains("testQueue", test.Pending); 21 | Assert.Contains("testQueue", test.Working); 22 | Assert.Contains("testQueue", test.Headers); 23 | } 24 | 25 | public IConnectionInformation CreateConnection() 26 | { 27 | var connection = Substitute.For(); 28 | connection.QueueName.Returns("testQueue"); 29 | return connection; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisQueueDelayTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.Redis.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 6 | { 7 | public class RedisQueueDelayTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var time = TimeSpan.FromSeconds(1); 13 | var test = new RedisQueueDelay(time); 14 | Assert.Equal(time, test.IncreaseDelay); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisQueueIdTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 5 | { 6 | public class RedisQueueIdTests 7 | { 8 | [Fact] 9 | public void Create_Default() 10 | { 11 | const long id = 1; 12 | var test = new RedisQueueId(id.ToString()); 13 | Assert.Equal(id.ToString(), test.Id.Value); 14 | Assert.True(test.HasValue); 15 | } 16 | [Fact] 17 | public void Create_Default_ToString() 18 | { 19 | const long id = 1; 20 | var test = new RedisQueueId(id.ToString()); 21 | Assert.Equal("1", test.ToString()); 22 | } 23 | [Fact] 24 | public void Create_Default_Empty() 25 | { 26 | var id = string.Empty; 27 | var test = new RedisQueueId(id); 28 | Assert.Equal(id, test.Id.Value); 29 | Assert.False(test.HasValue); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/RedisSimpleBatchSizeTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic 5 | { 6 | public class RedisSimpleBatchSizeTests 7 | { 8 | [Fact] 9 | public void Create_Default() 10 | { 11 | var test = new RedisSimpleBatchSize(); 12 | Assert.Equal(1, test.BatchSize(1)); 13 | Assert.Equal(25, test.BatchSize(25)); 14 | Assert.Equal(50, test.BatchSize(50)); 15 | Assert.Equal(40, test.BatchSize(80)); 16 | Assert.Equal(50, test.BatchSize(100)); 17 | Assert.Equal(250, test.BatchSize(500)); 18 | Assert.Equal(256, test.BatchSize(512)); 19 | Assert.Equal(256, test.BatchSize(10000)); 20 | Assert.Equal(256, test.BatchSize(25000)); 21 | Assert.Equal(256, test.BatchSize(int.MaxValue)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Time/BaseTimeConfigurationTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Configuration; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Time 6 | { 7 | public class BaseTimeConfigurationTests 8 | { 9 | [Fact] 10 | public void Create() 11 | { 12 | var test = new BaseTimeConfiguration(); 13 | Assert.Equal(TimeSpan.FromSeconds(900), test.RefreshTime); 14 | test.RefreshTime = TimeSpan.FromSeconds(100); 15 | Assert.Equal(TimeSpan.FromSeconds(100), test.RefreshTime); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Basic/Time/SntpTimeConfigurationTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.Redis.Basic.Time; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests.Basic.Time 6 | { 7 | public class SntpTimeConfigurationTests 8 | { 9 | [Fact] 10 | public void Create() 11 | { 12 | var test = new SntpTimeConfiguration(); 13 | Assert.Equal(TimeSpan.FromSeconds(900), test.RefreshTime); 14 | Assert.Equal(123, test.Port); 15 | Assert.Equal("pool.ntp.org", test.Server); 16 | 17 | test.RefreshTime = TimeSpan.FromSeconds(100); 18 | Assert.Equal(TimeSpan.FromSeconds(100), test.RefreshTime); 19 | 20 | test.Port = 567; 21 | Assert.Equal(567, test.Port); 22 | 23 | test.Server = "test"; 24 | Assert.Equal("test", test.Server); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/Helpers.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.Redis.Basic; 2 | using DotNetWorkQueue.Transport.Redis.Basic.Time; 3 | 4 | namespace DotNetWorkQueue.Transport.Redis.Tests 5 | { 6 | public static class Helpers 7 | { 8 | public static RedisQueueTransportOptions CreateOptions() 9 | { 10 | return new RedisQueueTransportOptions(new SntpTimeConfiguration(), new DelayedProcessingConfiguration()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis.Tests/HelpersTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.Redis.Tests 6 | { 7 | public class HelpersTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var jobs = Enumerable.Range(0, 100) 13 | .Select(x => "test"); 14 | var enumerable = jobs as IList ?? jobs.ToList(); 15 | Assert.Equal(2, enumerable.Partition(50).Count()); 16 | Assert.Equal(10, enumerable.Partition(10).Count()); 17 | 18 | jobs = Enumerable.Range(0, 87) 19 | .Select(x => "test"); 20 | 21 | var part = jobs.Partition(20); 22 | 23 | var i = 0; 24 | foreach (var p in part) 25 | { 26 | Assert.Equal(i == 4 ? 7 : 20, p.Count()); 27 | i++; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Redis/IDelayedProcessingMonitor.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue.Transport.Redis 20 | { 21 | /// 22 | /// Moves delayed records to the pending queue 23 | /// 24 | public interface IDelayedProcessingMonitor : IMonitor 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/DeleteMessageCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 6 | { 7 | public class DeleteMessageCommandTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | const int id = 19334; 13 | var test = new DeleteMessageCommand(id); 14 | Assert.Equal(id, test.QueueId); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/DeleteStatusTableStatusCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 6 | { 7 | public class DeleteStatusTableStatusCommandTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | const int id = 19334; 13 | var test = new DeleteStatusTableStatusCommand(id); 14 | Assert.Equal(id, test.QueueId); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/MoveRecordToErrorQueueCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 4 | using NSubstitute; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 8 | { 9 | public class MoveRecordToErrorQueueCommandTests 10 | { 11 | [Fact] 12 | public void Create_Default() 13 | { 14 | const int id = 19334; 15 | var error = new Exception(); 16 | var context = Substitute.For(); 17 | var test = new MoveRecordToErrorQueueCommand(error, id, context); 18 | Assert.Equal(id, test.QueueId); 19 | Assert.Equal(error, test.Exception); 20 | Assert.Equal(context, test.MessageContext); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/ResetHeartBeatCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 3 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 4 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 5 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 9 | { 10 | public class ResetHeartBeatCommandTests 11 | { 12 | [Fact] 13 | public void Create_Default() 14 | { 15 | const int id = 293; 16 | var date = DateTime.Now; 17 | var message = new MessageToReset(id, date, null); 18 | var test = new ResetHeartBeatCommand(message); 19 | Assert.Equal(message, test.MessageReset); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/RollbackMessageCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 7 | { 8 | public class RollbackMessageCommandTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | DateTime? lastDateTime = DateTime.Now; 14 | TimeSpan? queue = TimeSpan.FromDays(1); 15 | const int id = 19334; 16 | var test = new RollbackMessageCommand(lastDateTime, id, queue); 17 | Assert.Equal(id, test.QueueId); 18 | Assert.Equal(queue, test.IncreaseQueueDelay); 19 | Assert.Equal(lastDateTime, test.LastHeartBeat); 20 | } 21 | [Fact] 22 | public void Create_Default2() 23 | { 24 | const int id = 19334; 25 | var test = new RollbackMessageCommand(null, id, null); 26 | Assert.Equal(id, test.QueueId); 27 | Assert.Null(test.IncreaseQueueDelay); 28 | Assert.Null(test.LastHeartBeat); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/SendHeartBeatCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 6 | { 7 | public class SendHeartBeatCommandTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | const int id = 19334; 13 | var test = new SendHeartBeatCommand(id); 14 | Assert.Equal(id, test.QueueId); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/SendMessageCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Messages; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 4 | using NSubstitute; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 8 | { 9 | public class SendMessageCommandTests 10 | { 11 | [Fact] 12 | public void Create_Default() 13 | { 14 | var id = Substitute.For(); 15 | var message = new AdditionalMessageData(); 16 | var test = new SendMessageCommand(id, message); 17 | Assert.Equal(id, test.MessageToSend); 18 | Assert.Equal(message, test.MessageData); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/SetErrorCountCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 6 | { 7 | public class SetErrorCountCommandTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | const int id = 19334; 13 | var type = "errorType"; 14 | var test = new SetErrorCountCommand(type, id); 15 | Assert.Equal(id, test.QueueId); 16 | Assert.Equal(type, test.ExceptionType); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Command/SetStatusTableStatusCommandTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Command; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Command 6 | { 7 | public class SetStatusTableStatusCommandTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | const int id = 19334; 13 | var test = new SetStatusTableStatusCommand(id, QueueStatuses.Processing); 14 | Assert.Equal(id, test.QueueId); 15 | Assert.Equal(QueueStatuses.Processing, test.Status); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/CorrelationIdTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.Shared.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic 6 | { 7 | public class CorrelationIdTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var id = Guid.NewGuid(); 13 | var test = new MessageCorrelationId(id); 14 | Assert.Equal(id, test.Id.Value); 15 | Assert.True(test.HasValue); 16 | } 17 | [Fact] 18 | public void Create_Default_ToString() 19 | { 20 | var id = Guid.NewGuid(); 21 | var test = new MessageCorrelationId(id); 22 | Assert.Equal(id.ToString(), test.ToString()); 23 | } 24 | [Fact] 25 | public void Create_Default_Empty_Guid() 26 | { 27 | var id = Guid.Empty; 28 | var test = new MessageCorrelationId(id); 29 | Assert.Equal(id, test.Id.Value); 30 | Assert.False(test.HasValue); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Factory/ReceiveMessagesFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Factory; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Factory 7 | { 8 | public class ReceiveMessagesFactoryTests 9 | { 10 | [Fact] 11 | public void Create() 12 | { 13 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 14 | var test = fixture.Create(); 15 | test.Create(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/MessageQueueIdTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic; 2 | using DotNetWorkQueue.Transport.Shared.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic 6 | { 7 | public class MessageQueueIdTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | long id = 1; 13 | var test = new MessageQueueId(id); 14 | Assert.Equal(id, test.Id.Value); 15 | Assert.True(test.HasValue); 16 | } 17 | [Fact] 18 | public void Create_Default_ToString() 19 | { 20 | long id = 1; 21 | var test = new MessageQueueId(id); 22 | Assert.Equal("1", test.ToString()); 23 | } 24 | [Fact] 25 | public void Create_Default_0() 26 | { 27 | long id = 0; 28 | var test = new MessageQueueId(id); 29 | Assert.Equal(id, test.Id.Value); 30 | Assert.False(test.HasValue); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/FindExpiredMessagesToDeleteQueryTests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 7 | { 8 | public class FindExpiredMessagesToDeleteQueryTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | using (var cancel = new CancellationTokenSource()) 14 | { 15 | var test = new FindExpiredMessagesToDeleteQuery(cancel.Token); 16 | Assert.Equal(cancel.Token, test.Cancellation); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/FindMessagesToResetByHeartBeatQueryTests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 7 | { 8 | public class FindMessagesToResetByHeartBeatQueryTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | using (var cancel = new CancellationTokenSource()) 14 | { 15 | var test = new FindMessagesToResetByHeartBeatQuery(cancel.Token); 16 | Assert.Equal(cancel.Token, test.Cancellation); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/GetColumnNamesFromTableQueryTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 5 | { 6 | public class GetColumnNamesFromTableQueryTests 7 | { 8 | [Fact] 9 | public void Create_Default() 10 | { 11 | var test = new GetColumnNamesFromTableQuery("test1", "test2"); 12 | Assert.Equal("test1", test.ConnectionString); 13 | Assert.Equal("test2", test.TableName); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/GetErrorRecordExistsQueryTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 6 | { 7 | public class GetErrorRecordExistsQueryTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var test = new GetErrorRecordExistsQuery("test", 100); 13 | Assert.Equal("test", test.ExceptionType); 14 | Assert.Equal(100, test.QueueId); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/GetErrorRetryCountQueryTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 6 | { 7 | public class GetErrorRetryCountQueryTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var test = new GetErrorRetryCountQuery("test", 100); 13 | Assert.Equal("test", test.ExceptionType); 14 | Assert.Equal(100, test.QueueId); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/GetTableExistsQueryTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 5 | { 6 | public class GetTableExistsQueryTests 7 | { 8 | [Fact] 9 | public void Create_Default() 10 | { 11 | var test = new GetTableExistsQuery("test1", "test2"); 12 | Assert.Equal("test1", test.ConnectionString); 13 | Assert.Equal("test2", test.TableName); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/GetUtcDateQueryTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 2 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 6 | { 7 | public class GetUtcDateQueryTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var test = new GetUtcDateQuery("test"); 13 | Assert.Equal("test", test.ConnectionString); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/Query/MessageToResetTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Query; 3 | using DotNetWorkQueue.Transport.Shared.Basic.Query; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic.Query 7 | { 8 | public class MessageToResetTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var date = DateTime.UtcNow; 14 | var test = new MessageToReset(100, date, null); 15 | Assert.Equal(100, test.QueueId); 16 | Assert.Equal(date, test.HeartBeat); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.RelationalDatabase.Tests/Basic/SqlQueueDelayTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Queue; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.RelationalDatabase.Tests.Basic 6 | { 7 | public class SqlQueueDelayTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var test = new QueueDelay(TimeSpan.FromHours(1)); 13 | Assert.Equal(TimeSpan.FromHours(1), test.IncreaseDelay); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Integration.Tests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using System; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | #endregion 8 | 9 | namespace DotNetWorkQueue.Transport.SQLite.Integration.Tests 10 | { 11 | public static class GenerateQueueName 12 | { 13 | /// 14 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 15 | /// 16 | /// 17 | public static string Create() 18 | { 19 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 20 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 21 | return "I" + BitConverter.ToString(hash) 22 | .Replace("-", string.Empty) 23 | .Replace("_", string.Empty) 24 | .ToLower(); 25 | 26 | } 27 | public static string CreateFileName() 28 | { 29 | return Create() + ".db3"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Linq.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Basic/Command/CreateQueueTablesAndSaveConfigurationCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 3 | using DotNetWorkQueue.Transport.SQLite.Schema; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Basic.Command 7 | { 8 | public class CreateQueueTablesAndSaveConfigurationCommandTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var tables = new List
(); 14 | var test = new CreateQueueTablesAndSaveConfigurationCommand
(tables); 15 | Assert.Equal(tables, test.Tables); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Basic/CommandStringTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Basic 6 | { 7 | public class CommandStringTests 8 | { 9 | [Fact] 10 | public void Create_Command() 11 | { 12 | var commands = new List(); 13 | var test = new CommandString("testing", commands); 14 | Assert.Equal("testing", test.CommandText); 15 | Assert.Equal(commands, test.AdditionalCommands); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Basic/ConnectionStringInfoTests.cs: -------------------------------------------------------------------------------- 1 |  2 | using DotNetWorkQueue.Transport.SQLite.Basic; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Basic 6 | { 7 | public class ConnectionStringInfoTests 8 | { 9 | [Fact] 10 | public void Create_ConnectionStringInfo() 11 | { 12 | var test = new ConnectionStringInfo(false, @"c:\test\temp.db3"); 13 | Assert.False(test.IsInMemory); 14 | Assert.Equal(@"c:\test\temp.db3", test.FileName); 15 | Assert.True(test.IsValid); 16 | } 17 | [Fact] 18 | public void Create_InMemoryIsValid() 19 | { 20 | var test = new ConnectionStringInfo(true, string.Empty); 21 | Assert.True(test.IsValid); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Basic/Factory/SQLiteMessageQueueTransportOptionsFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.SQLite.Basic.Factory; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Basic.Factory 7 | { 8 | public class SqLiteMessageQueueTransportOptionsFactoryTests 9 | { 10 | [Fact] 11 | public void Create() 12 | { 13 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 14 | var test = fixture.Create(); 15 | test.Create(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Basic/SqlHeadersTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic; 4 | using DotNetWorkQueue.Transport.Shared.Basic; 5 | using Xunit; 6 | 7 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Basic 8 | { 9 | public class SqlHeadersTests 10 | { 11 | [Fact] 12 | public void Create_Default() 13 | { 14 | var test = Create(); 15 | Assert.NotNull(test.QueueDelay); 16 | } 17 | 18 | private IIncreaseQueueDelay Create() 19 | { 20 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 21 | return fixture.Create(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/SQLiteConnectionInformationTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using Xunit; 3 | 4 | namespace DotNetWorkQueue.Transport.SQLite.Tests 5 | { 6 | public class SqLiteConnectionInformationTests 7 | { 8 | private const string GoodConnection = 9 | @"Data Source=c:\temp\test.db;Version=3;"; 10 | 11 | private const string BadConnection = 12 | "Thisisabadconnectionstring"; 13 | 14 | [Fact] 15 | public void GetSet_Connection() 16 | { 17 | var test = new SqliteConnectionInformation(new QueueConnection(string.Empty, GoodConnection), null); 18 | Assert.NotNull(test); 19 | } 20 | [Fact] 21 | public void Test_Clone() 22 | { 23 | var test = new SqliteConnectionInformation(new QueueConnection("blah", GoodConnection), null); 24 | var clone = test.Clone(); 25 | 26 | Assert.Equal(test.ConnectionString, clone.ConnectionString); 27 | Assert.Equal(test.QueueName, clone.QueueName); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Schema/ColumnsTests.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | using DotNetWorkQueue.Transport.SQLite.Schema; 3 | using Xunit; 4 | 5 | #endregion 6 | 7 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Schema 8 | { 9 | public class ColumnsTests 10 | { 11 | [Fact] 12 | public void Add_Column() 13 | { 14 | var test = new Columns(); 15 | test.Add(new Column("testing", ColumnTypes.Integer, true, null)); 16 | Assert.Contains(test.Items, item => item.Name == "testing"); 17 | } 18 | [Fact] 19 | public void Remove_Column() 20 | { 21 | var test = new Columns(); 22 | var column = new Column("testing", ColumnTypes.Integer, true, null); 23 | test.Add(column); 24 | test.Remove(column); 25 | Assert.DoesNotContain(test.Items, item => item.Name == "testing"); 26 | } 27 | [Fact] 28 | public void Script() 29 | { 30 | var test = new Columns(); 31 | test.Add(new Column("testing", ColumnTypes.Integer, true, null)); 32 | Assert.Contains("testing", test.Script()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Schema/DefaultTests.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using DotNetWorkQueue.Transport.SQLite.Schema; 4 | using Xunit; 5 | 6 | #endregion 7 | 8 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Schema 9 | { 10 | public class DefaultTests 11 | { 12 | [Fact] 13 | public void Default() 14 | { 15 | var test = new Default("test", "test1"); 16 | Assert.Equal("test", test.Name); 17 | Assert.Equal("test1", test.Value); 18 | } 19 | [Fact] 20 | public void Script() 21 | { 22 | var test = new Default("test", "test1"); 23 | Assert.Contains("test", test.Script()); 24 | Assert.Contains("test1", test.Script()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite.Tests/Schema/IdentityTests.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using DotNetWorkQueue.Transport.SQLite.Schema; 4 | using KellermanSoftware.CompareNetObjects; 5 | using Tynamix.ObjectFiller; 6 | using Xunit; 7 | 8 | #endregion 9 | 10 | namespace DotNetWorkQueue.Transport.SQLite.Tests.Schema 11 | { 12 | public class IdentityTests 13 | { 14 | [Fact] 15 | public void Script() 16 | { 17 | var test = new Identity(); 18 | Assert.Contains("PRIMARY KEY AUTOINCREMENT", test.Script()); 19 | } 20 | [Fact] 21 | public void Clone() 22 | { 23 | var pFiller = new Filler(); 24 | var test = pFiller.Create(); 25 | var clone = test.Clone(); 26 | var compareLogic = new CompareLogic(); 27 | var result = compareLogic.Compare(test, clone); 28 | Assert.True(result.AreEqual, result.DifferencesString); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SQLite/InternalsVisibleForTests.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | using System.Runtime.CompilerServices; 20 | 21 | [assembly: InternalsVisibleTo("DotNetWorkQueue.Transport.SQLite.Tests")] -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Shared/Basic/Command/DeleteQueueTablesCommand.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue.Transport.Shared.Basic.Command 20 | { 21 | /// 22 | /// Deletes the tables for a queue 23 | /// 24 | public class DeleteQueueTablesCommand 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.Shared/IQuery.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue.Transport.Shared 20 | { 21 | /// 22 | /// Returns the results of a query 23 | /// 24 | /// The type of the result. 25 | // ReSharper disable once UnusedTypeParameter 26 | public interface IQuery 27 | { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.IntegrationTests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.IntegrationTests/GenerateQueueName.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using System; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | #endregion 8 | 9 | namespace DotNetWorkQueue.Transport.SqlServer.IntegrationTests 10 | { 11 | public static class GenerateQueueName 12 | { 13 | /// 14 | /// Tried a datetime, but we can start the tests too fast - ended up with duplicates every once and a while. 15 | /// 16 | /// 17 | public static string Create() 18 | { 19 | var encoded = new UTF8Encoding().GetBytes(Guid.NewGuid().ToString()); 20 | var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encoded); 21 | return "INTTEST" + BitConverter.ToString(hash) 22 | .Replace("-", string.Empty) 23 | .Replace("_", string.Empty) 24 | .ToLower(); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.IntegrationTests/connectionstring.txt: -------------------------------------------------------------------------------- 1 | Server=192.168.0.58;Application Name=IntegrationTesting;Database=IntegrationTests;user=brian;password=123abc;max pool size=500 -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xunit; -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests/JobScheduler/JobSchedulerMultipleTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.JobScheduler; 4 | using DotNetWorkQueue.Queue; 5 | using DotNetWorkQueue.Transport.SqlServer.Basic; 6 | using DotNetWorkQueue.Transport.SqlServer.IntegrationTests; 7 | using Xunit; 8 | 9 | namespace DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests.JobScheduler 10 | { 11 | [CollectionDefinition("JobScheduler", DisableParallelization = true)] 12 | public class JobSchedulerMultipleTests 13 | { 14 | [Theory] 15 | [InlineData(2)] 16 | public void Run( 17 | int producerCount) 18 | { 19 | var queueName = GenerateQueueName.Create(); 20 | var consumer = 21 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerMultipleTests(); 22 | consumer.Run( 23 | new QueueConnection(queueName, ConnectionInfo.ConnectionString), producerCount); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests/JobScheduler/JobSchedulerTests.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Configuration; 2 | using DotNetWorkQueue.IntegrationTests.Shared; 3 | using DotNetWorkQueue.IntegrationTests.Shared.JobScheduler; 4 | using DotNetWorkQueue.Transport.SqlServer.Basic; 5 | using DotNetWorkQueue.Transport.SqlServer.IntegrationTests; 6 | using Xunit; 7 | 8 | namespace DotNetWorkQueue.Transport.SqlServer.Linq.Integration.Tests.JobScheduler 9 | { 10 | [CollectionDefinition("JobScheduler", DisableParallelization = true)] 11 | public class JobSchedulerTests 12 | { 13 | [Theory] 14 | #if NETFULL 15 | [InlineData(true, false), 16 | InlineData(true, true)] 17 | #else 18 | [InlineData(true, false)] 19 | #endif 20 | public void Run( 21 | bool interceptors, 22 | bool dynamic) 23 | { 24 | 25 | var queueName = GenerateQueueName.Create(); 26 | var consumer = 27 | new DotNetWorkQueue.IntegrationTests.Shared.JobScheduler.Implementation.JobSchedulerTests(); 28 | consumer.Run( 29 | new QueueConnection(queueName, ConnectionInfo.ConnectionString), interceptors, dynamic, Helpers.Verify, Helpers.SetError); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Tests/Basic/Command/CreateQueueTablesAndSaveConfigurationCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DotNetWorkQueue.Transport.RelationalDatabase.Basic.Command; 3 | using DotNetWorkQueue.Transport.SqlServer.Schema; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.SqlServer.Tests.Basic.Command 7 | { 8 | public class CreateQueueTablesAndSaveConfigurationCommandTests 9 | { 10 | [Fact] 11 | public void Create_Default() 12 | { 13 | var tables = new List
(); 14 | var test = new CreateQueueTablesAndSaveConfigurationCommand
(tables); 15 | Assert.Equal(tables, test.Tables); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Tests/Basic/Factory/SqlServerMessageQueueTransportOptionsFactoryTests.cs: -------------------------------------------------------------------------------- 1 | using AutoFixture; 2 | using AutoFixture.AutoNSubstitute; 3 | using DotNetWorkQueue.Transport.SqlServer.Basic.Factory; 4 | using Xunit; 5 | 6 | namespace DotNetWorkQueue.Transport.SqlServer.Tests.Basic.Factory 7 | { 8 | public class SqlServerMessageQueueTransportOptionsFactoryTests 9 | { 10 | [Fact] 11 | public void Create() 12 | { 13 | var fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); 14 | var test = fixture.Create(); 15 | test.Create(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Tests/Basic/SqlQueueDelayTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetWorkQueue.Queue; 3 | using Xunit; 4 | 5 | namespace DotNetWorkQueue.Transport.SqlServer.Tests.Basic 6 | { 7 | public class SqlQueueDelayTests 8 | { 9 | [Fact] 10 | public void Create_Default() 11 | { 12 | var test = new QueueDelay(TimeSpan.FromHours(1)); 13 | Assert.Equal(TimeSpan.FromHours(1), test.IncreaseDelay); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Tests/Schema/ColumnsTests.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using DotNetWorkQueue.Transport.SqlServer.Schema; 4 | using Xunit; 5 | 6 | #endregion 7 | 8 | namespace DotNetWorkQueue.Transport.SqlServer.Tests.Schema 9 | { 10 | public class ColumnsTests 11 | { 12 | [Fact] 13 | public void Add_Column() 14 | { 15 | var test = new Columns(); 16 | test.Add(new Column("testing", ColumnTypes.Bigint, true, null)); 17 | Assert.Contains(test.Items, item => item.Name == "testing"); 18 | } 19 | [Fact] 20 | public void Remove_Column() 21 | { 22 | var test = new Columns(); 23 | var column = new Column("testing", ColumnTypes.Bigint, true, null); 24 | test.Add(column); 25 | test.Remove(column); 26 | Assert.DoesNotContain(test.Items, item => item.Name == "testing"); 27 | } 28 | [Fact] 29 | public void Script() 30 | { 31 | var test = new Columns(); 32 | test.Add(new Column("testing", ColumnTypes.Bigint, true, null)); 33 | Assert.Contains("testing", test.Script()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Tests/Schema/IdentityTests.cs: -------------------------------------------------------------------------------- 1 | #region Using 2 | 3 | using DotNetWorkQueue.Transport.SqlServer.Schema; 4 | using KellermanSoftware.CompareNetObjects; 5 | using Tynamix.ObjectFiller; 6 | using Xunit; 7 | 8 | #endregion 9 | 10 | namespace DotNetWorkQueue.Transport.SqlServer.Tests.Schema 11 | { 12 | public class IdentityTests 13 | { 14 | [Fact] 15 | public void Default() 16 | { 17 | var test = new Identity(1, 2); 18 | Assert.Equal(1, test.Seed); 19 | Assert.Equal(2, test.Increment); 20 | } 21 | [Fact] 22 | public void Script() 23 | { 24 | var test = new Identity(1, 2); 25 | Assert.Contains("1", test.Script()); 26 | Assert.Contains("2", test.Script()); 27 | } 28 | [Fact] 29 | public void Clone() 30 | { 31 | var pFiller = new Filler(); 32 | var test = pFiller.Create(); 33 | var clone = test.Clone(); 34 | var compareLogic = new CompareLogic(); 35 | var result = compareLogic.Compare(test, clone); 36 | Assert.True(result.AreEqual, result.DifferencesString); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Source/DotNetWorkQueue.Transport.SqlServer/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer/InternalsVisibleForTests.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | using System.Runtime.CompilerServices; 20 | 21 | [assembly: InternalsVisibleTo("DotNetWorkQueue.Transport.SqlServer.Tests")] 22 | [assembly: InternalsVisibleTo("DotNetWorkQueue.Transport.SqlServer.Integration.Tests")] -------------------------------------------------------------------------------- /Source/DotNetWorkQueue.Transport.SqlServer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Configuration/AdminApiConfiguration.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue.Configuration 20 | { 21 | /// 22 | /// Configuration class for the admin API 23 | /// 24 | /// Currently empty 25 | public class AdminApiConfiguration 26 | { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/DotNetWorkQueue.licenseheader: -------------------------------------------------------------------------------- 1 | extensions: designer.cs generated.cs 2 | extensions: .cs 3 | // --------------------------------------------------------------------- 4 | //This file is part of DotNetWorkQueue 5 | //Copyright © 2015-2022 Brian Lehnen 6 | // 7 | //This library is free software; you can redistribute it and/or 8 | //modify it under the terms of the GNU Lesser General Public 9 | //License as published by the Free Software Foundation; either 10 | //version 2.1 of the License, or (at your option) any later version. 11 | // 12 | //This library is distributed in the hope that it will be useful, 13 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | //Lesser General Public License for more details. 16 | // 17 | //You should have received a copy of the GNU Lesser General Public 18 | //License along with this library; if not, write to the Free Software 19 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | // --------------------------------------------------------------------- -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Source/DotNetWorkQueue/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IClear.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// 23 | /// 24 | public interface IClear 25 | { 26 | /// 27 | /// Clears this instance. 28 | /// 29 | void Clear(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IClearErrorMessagesMonitor.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// Removes messages in an error status on a schedule 23 | /// 24 | /// 25 | public interface IClearErrorMessagesMonitor : IMonitor 26 | { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IConsumerQueueNotification.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Notifications; 2 | using DotNetWorkQueue.Queue; 3 | 4 | namespace DotNetWorkQueue 5 | { 6 | /// 7 | /// Notification for consumer queue message processing 8 | /// 9 | public interface IConsumerQueueNotification 10 | { 11 | /// 12 | /// The message has been rolled back for re-processing, if possible 13 | /// 14 | /// The rollback information 15 | void InvokeRollback(RollBackNotification rollbackNotification); 16 | 17 | /// 18 | /// The message has completed processing. 19 | /// 20 | /// The message that has been completed 21 | void InvokeMessageComplete(MessageCompleteNotification messageCompleteNotification); 22 | 23 | /// 24 | /// Subscribe for user notifications 25 | /// 26 | /// User notifications 27 | void Sub(ConsumerQueueNotifications notifications); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IGetTimeFactory.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// Returns instance of 23 | /// 24 | public interface IGetTimeFactory 25 | { 26 | /// 27 | /// Returns instance of 28 | /// 29 | IGetTime Create(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IQueueMonitor.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// Wraps multiple queue monitor processes into a composite interface 23 | /// 24 | public interface IQueueMonitor : IMonitor 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/ITransportInitDuplex.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// This allows a transport to inject its dependencies into the root container for sending and receiving messages 23 | /// 24 | public interface ITransportInitDuplex : ITransportInitSend, ITransportInitReceive 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/ITransportInitReceive.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// This allows a transport to inject its dependencies into the root container for receiving messages 23 | /// 24 | public interface ITransportInitReceive : ITransportInit 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/ITransportInitSend.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// This allows a transport to inject its dependencies into the root container for sending messages 23 | /// 24 | public interface ITransportInitSend : ITransportInit 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IWaitForEventOrCancelWorker.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// Allows a worker to pause and wait to be told to continue, or to cancel waiting. 23 | /// 24 | public interface IWaitForEventOrCancelWorker : IWaitForEventOrCancel 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/IWorker.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blehnen/DotNetWorkQueue/8fa7a3062329953e80e1e0608ec9e179462ae789/Source/DotNetWorkQueue/IWorker.cs -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Notifications/ErrorNotification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DotNetWorkQueue.Notifications 5 | { 6 | /// 7 | /// A message error 8 | /// 9 | public class ErrorNotification : ABaseNotification 10 | { 11 | /// 12 | /// Message error 13 | /// 14 | /// Message Id 15 | /// Correlation Id 16 | /// Message headers 17 | /// The error 18 | public ErrorNotification(IMessageId id, ICorrelationId correlationId, IReadOnlyDictionary headers, Exception error) : base(id, correlationId, headers) 19 | { 20 | Error = error; 21 | } 22 | 23 | /// 24 | /// The exception that occurred. 25 | /// 26 | public Exception Error { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Notifications/ErrorReceiveNotification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetWorkQueue.Notifications 4 | { 5 | /// 6 | /// An error obtaining messages from the transport 7 | /// 8 | public class ErrorReceiveNotification 9 | { 10 | /// 11 | /// An error obtaining messages from the transport 12 | /// 13 | /// The error. 14 | public ErrorReceiveNotification(Exception error) 15 | { 16 | Error = error; 17 | } 18 | 19 | /// 20 | /// The exception that occurred. 21 | /// 22 | public Exception Error { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Notifications/MessageCompleteNotification.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DotNetWorkQueue.Notifications 4 | { 5 | /// 6 | /// A message has completed processing 7 | /// 8 | public class MessageCompleteNotification : ABaseNotification 9 | { 10 | /// 11 | /// A message has completed processing. 12 | /// 13 | /// The message id. 14 | /// The correlation id. 15 | /// The message headers. 16 | /// The message body. 17 | public MessageCompleteNotification(IMessageId id, ICorrelationId correlationId, IReadOnlyDictionary headers, dynamic body) : base(id, correlationId, headers) 18 | { 19 | Body = body; 20 | } 21 | 22 | /// 23 | /// Gets the body of the message. 24 | /// 25 | /// Only the message processor knows the type; If you need to access this data, you will need to cast it to your object type 26 | public dynamic Body { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Notifications/PoisonMessageNotification.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Exceptions; 2 | 3 | namespace DotNetWorkQueue.Notifications 4 | { 5 | /// 6 | /// A poison message notification. 7 | /// 8 | public class PoisonMessageNotification : ABaseNotification 9 | { 10 | /// 11 | /// A poison message notification. 12 | /// 13 | /// The error. 14 | public PoisonMessageNotification(PoisonMessageException error) : base(error.MessageId, error.CorrelationId, error.Headers) 15 | { 16 | Error = error; 17 | } 18 | 19 | /// 20 | /// The exception that occurred. 21 | /// 22 | public PoisonMessageException Error { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Notifications/RollbackNotification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DotNetWorkQueue.Notifications 5 | { 6 | /// 7 | /// A message rollback notification 8 | /// 9 | public class RollBackNotification : ABaseNotification 10 | { 11 | /// 12 | /// A message rollback notification. 13 | /// 14 | /// The message id. 15 | /// The correlation id. 16 | /// The message headers. 17 | /// The message error. 18 | public RollBackNotification(IMessageId id, ICorrelationId correlationId, IReadOnlyDictionary headers, Exception error) : base(id, correlationId, headers) 19 | { 20 | Error = error; 21 | } 22 | 23 | /// 24 | /// The error that triggered the rollback. 25 | /// 26 | public Exception Error { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Queue/ConsumerQueueErrorNotification.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Notifications; 2 | 3 | namespace DotNetWorkQueue.Queue 4 | { 5 | internal class ConsumerQueueErrorNotification : IConsumerQueueErrorNotification 6 | { 7 | private ConsumerQueueNotifications _notifications; 8 | public void InvokeError(ErrorNotification error) 9 | { 10 | _notifications?.Error?.Invoke(error); 11 | } 12 | 13 | public void InvokeError(ErrorReceiveNotification error) 14 | { 15 | _notifications?.ReceiveMessageError?.Invoke(error); 16 | } 17 | 18 | public void InvokeMovedToErrorQueue(ErrorNotification error) 19 | { 20 | _notifications?.Error?.Invoke(error); 21 | } 22 | 23 | public void InvokePoisonMessageError(PoisonMessageNotification notification) 24 | { 25 | _notifications?.PoisonMessage?.Invoke(notification); 26 | } 27 | 28 | public void Sub(ConsumerQueueNotifications notifications) 29 | { 30 | _notifications = notifications; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Queue/ConsumerQueueNotification.cs: -------------------------------------------------------------------------------- 1 | using DotNetWorkQueue.Notifications; 2 | 3 | namespace DotNetWorkQueue.Queue 4 | { 5 | internal class ConsumerQueueNotification : IConsumerQueueNotification 6 | { 7 | private ConsumerQueueNotifications _notifications; 8 | 9 | public void InvokeRollback(RollBackNotification rollbackNotification) 10 | { 11 | _notifications?.MessageRollBack?.Invoke(rollbackNotification); 12 | } 13 | 14 | public void InvokeMessageComplete(MessageCompleteNotification messageCompleteNotification) 15 | { 16 | _notifications?.MessageCompleted?.Invoke(messageCompleteNotification); 17 | } 18 | 19 | public void Sub(ConsumerQueueNotifications notifications) 20 | { 21 | _notifications = notifications; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/Queue/WaitForEventOrCancelWorker.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue.Queue 20 | { 21 | /// 22 | /// 23 | /// A worker wait/event handle 24 | /// 25 | internal class WaitForEventOrCancelWorker : WaitForEventOrCancel, IWaitForEventOrCancelWorker 26 | { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/DotNetWorkQueue/iClearExpiredMessagesMonitor.cs: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | //This file is part of DotNetWorkQueue 3 | //Copyright © 2015-2022 Brian Lehnen 4 | // 5 | //This library is free software; you can redistribute it and/or 6 | //modify it under the terms of the GNU Lesser General Public 7 | //License as published by the Free Software Foundation; either 8 | //version 2.1 of the License, or (at your option) any later version. 9 | // 10 | //This library is distributed in the hope that it will be useful, 11 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | //Lesser General Public License for more details. 14 | // 15 | //You should have received a copy of the GNU Lesser General Public 16 | //License along with this library; if not, write to the Free Software 17 | //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | // --------------------------------------------------------------------- 19 | namespace DotNetWorkQueue 20 | { 21 | /// 22 | /// Clears the expired messages from a queue 23 | /// 24 | public interface IClearExpiredMessagesMonitor : IMonitor 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parallelizeAssembly": true 3 | } --------------------------------------------------------------------------------