Ejemplo n.º 1
0
        public void CreateDynamoDbIfDoesNotExist()
        {
            DynamoDbConfig config = GetDynamoDbConfig();
            DynamoTable    table  = new DynamoTable(config, _client);

            table.CreateIfNotExist();

            AssertDynamoDbExists(_tableName);
        }
Ejemplo n.º 2
0
        public void CanReadAndWriteData()
        {
            var          client   = new AmazonDynamoDBClient(RegionEndpoint.EUWest1);
            const string itemId   = "1";
            var          provider = new DynamoStore(new DynamoDBContext(client));
            var          config   = GetDynamoDbConfig();
            var          table    = new DynamoTable(config, client);

            table.CreateIfNotExist();

            provider.Save(new FakeDynamoItem {
                Id = itemId
            }, new DynamoDBOperationConfig());
            var result = provider.Read <FakeDynamoItem>(itemId, new DynamoDBOperationConfig());

            Assert.IsNotNull(result);
            Console.WriteLine(result.Id);
            Assert.AreEqual(result.Id, itemId);
        }