示例#1
0
        public async Task AddItem_TypeWithSingleStringProperty_ItemAddedToStore()
        {
            var dataItem = new TypeWithStringProperty
            {
                FirstType = "b"
            };

            _tableStorageProvider.Add(_tableName, dataItem, _partitionKey, _rowKey);
            await _tableStorageProvider.SaveAsync();

            var result = await _tableStorageProvider.GetAsync <TypeWithStringProperty>(_tableName, _partitionKey, _rowKey);

            Assert.AreEqual("b", result.FirstType);
        }
示例#2
0
        public async Task GetAsync_ObjectInsertedIsInheritsDynamicObject_RetrievedProperly()
        {
            dynamic item = new DynamicPropertyBag();

            item.Foo = "test";
            item.Bar = 1;

            string partitionKey = "partitionKey";
            string rowKey       = "rowKey";

            _tableStorageProvider.Add(_tableName, item, partitionKey, rowKey);
            await _tableStorageProvider.SaveAsync();

            dynamic result = await _tableStorageProvider.GetAsync(_tableName, partitionKey, rowKey);

            Assert.AreEqual(item.Foo, result.Foo);
            Assert.AreEqual(item.Bar, result.Bar);
        }
示例#3
0
        private void EnsureOneItemInContext( TableStorageProvider tableStorageProvider )
        {
            var item = new SimpleDataItem
                    {
                       FirstType = "First",
                       SecondType = 2
                    };

             tableStorageProvider.Add( _tableName, item, _partitionKey, _rowKey );
             tableStorageProvider.Save();
        }
示例#4
0
 private void EnsureItemsInContext( TableStorageProvider tableStorageProvider, int count )
 {
     for ( int i = 0; i < count; i++ )
      {
     var item = new SimpleDataItem
                {
                   FirstType = i.ToString( CultureInfo.InvariantCulture ),
                   SecondType = i
                };
     tableStorageProvider.Add( _tableName, item, _partitionKey, _rowKey + i );
      }
      tableStorageProvider.Save();
 }
示例#5
0
 public void AddHash(Hash hashToAdd)
 {
     _tableStorageProvider.Add(string.Empty, hashToAdd, _hashPartitionKey, hashToAdd.Url);
 }