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); }
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); }
private void EnsureOneItemInContext( TableStorageProvider tableStorageProvider ) { var item = new SimpleDataItem { FirstType = "First", SecondType = 2 }; tableStorageProvider.Add( _tableName, item, _partitionKey, _rowKey ); tableStorageProvider.Save(); }
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(); }
public void AddHash(Hash hashToAdd) { _tableStorageProvider.Add(string.Empty, hashToAdd, _hashPartitionKey, hashToAdd.Url); }