Beispiel #1
0
        public DynamoDbInboxEmptyWhenSearchedAsyncTests()
        {
            _dynamoDbTestHelper = new DynamoDbTestHelper();
            _dynamoDbTestHelper.CreateInboxTable(new DynamoDbInboxBuilder(_dynamoDbTestHelper.DynamoDbInboxTestConfiguration.TableName).CreateInboxTableRequest(readCapacityUnits: 2, writeCapacityUnits: 1));

            _dynamoDbInbox = new DynamoDbInbox(_dynamoDbTestHelper.DynamoDbContext, _dynamoDbTestHelper.DynamoDbInboxTestConfiguration);
        }
        public DynamoDbInboxDuplicateMessageAsyncTests()
        {
            _dynamoDbInbox = new DynamoDbInbox(Client);

            _raisedCommand = new MyCommand {
                Value = "Test"
            };
            _contextKey = "context-key";
        }
 public DynamoDbImboxDuplicateMessageTests()
 {
     _dynamoDbInbox = new DynamoDbInbox(Client);
     _raisedCommand = new MyCommand {
         Value = "Test"
     };
     _contextKey = "context-key";
     _dynamoDbInbox.Add(_raisedCommand, _contextKey);
 }
        public DynamoDbCommandExistsAsyncTests()
        {
            _command = new MyCommand {
                Id = _guid, Value = "Test Earliest"
            };
            _contextKey = "test-context-key";

            _dynamoDbInbox = new DynamoDbInbox(Client);

            _dynamoDbInbox.Add(_command, _contextKey);
        }
        public DynamoDbInboxDuplicateMessageAsyncTests()
        {
            _dynamoDbTestHelper = new DynamoDbTestHelper();
            _dynamoDbTestHelper.CreateInboxTable(new DynamoDbInboxBuilder(_dynamoDbTestHelper.DynamoDbInboxTestConfiguration.TableName).CreateInboxTableRequest(readCapacityUnits: 2, writeCapacityUnits: 1));

            _dynamoDbInbox = new DynamoDbInbox(_dynamoDbTestHelper.DynamoDbContext, _dynamoDbTestHelper.DynamoDbInboxTestConfiguration);
            _raisedCommand = new MyCommand {
                Value = "Test"
            };
            _contextKey = "context-key";
        }
        public DynamoDbRangeOfCommandsTests()
        {
            _guids = new[] { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };

            _commandEarliest = new MyCommand {
                Id = _guids[0], Value = "Test Earliest"
            };
            _storedCommandEarliest = ConstructCommand(_commandEarliest, _timeStamp.AddHours(-4));

            _command2 = new MyCommand {
                Id = _guids[1], Value = "Test Message 2"
            };
            _storedCommand2 = ConstructCommand(_command2, _timeStamp.AddHours(-2));

            _commandLatest = new MyCommand {
                Id = _guids[2], Value = "Test Latest"
            };
            _storedCommandLatest = ConstructCommand(_commandLatest, _timeStamp.AddHours(-1));

            var nonTopicCommand = ConstructCommand(new DifferentCommand {
                Id = _guids[3], Value = "Different Command "
            }, _timeStamp.AddHours(-2));

            _dynamoDbTestHelper = new DynamoDbTestHelper();
            var createTableRequest = new DynamoDbInboxBuilder(_dynamoDbTestHelper.DynamoDbInboxTestConfiguration.TableName).CreateInboxTableRequest();

            _dynamoDbTestHelper.CreateInboxTable(createTableRequest);
            _dynamoDbInbox = new DynamoDbInbox(_dynamoDbTestHelper.DynamoDbContext, _dynamoDbTestHelper.DynamoDbInboxTestConfiguration);

            var config = new DynamoDBOperationConfig
            {
                OverrideTableName = _dynamoDbTestHelper.DynamoDbInboxTestConfiguration.TableName,
                ConsistentRead    = false
            };

            var dbContext = _dynamoDbTestHelper.DynamoDbContext;

            dbContext.SaveAsync(_storedCommandEarliest, config).GetAwaiter().GetResult();
            dbContext.SaveAsync(_storedCommand2, config).GetAwaiter().GetResult();
            dbContext.SaveAsync(_storedCommandLatest, config).GetAwaiter().GetResult();
            dbContext.SaveAsync(nonTopicCommand, config).GetAwaiter().GetResult();
        }
Beispiel #7
0
        public DynamoDbCommandExistsAsyncTests()
        {
            _command = new MyCommand {
                Id = _guid, Value = "Test Earliest"
            };
            _contextKey = "test-context-key";

            var createTableRequest = new DynamoDbInboxBuilder(DynamoDbTestHelper.DynamoDbInboxTestConfiguration.TableName).CreateInboxTableRequest();

            DynamoDbTestHelper.CreateInboxTable(createTableRequest);
            _dynamoDbInbox = new DynamoDbInbox(DynamoDbTestHelper.DynamoDbContext, DynamoDbTestHelper.DynamoDbInboxTestConfiguration);

            var config = new DynamoDBOperationConfig
            {
                OverrideTableName = DynamoDbTestHelper.DynamoDbInboxTestConfiguration.TableName,
                ConsistentRead    = false
            };

            var dbContext = DynamoDbTestHelper.DynamoDbContext;

            dbContext.SaveAsync(ConstructCommand(_command, DateTime.UtcNow, _contextKey), config).GetAwaiter().GetResult();
        }
Beispiel #8
0
 public DynamoDbInboxEmptyWhenSearchedAsyncTests()
 {
     _dynamoDbInbox = new DynamoDbInbox(Client);
 }