public void RetrieveTest() { try { InsertOrReplaceTest(); var tables = new AzureStorage.Tables(Properties.Settings.Default.AzureConnection); var tblResult = tables.Retrieve(tableName, rowKey, partitionKey); Assert.AreNotEqual(tblResult.HttpStatusCode, 404); var tblEntity = ((Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity)(tblResult.Result)); Assert.IsNotNull(tblResult); CollectionAssert.AreEqual(testData.binaryProperty, tblEntity.Properties["binaryProperty"].BinaryValue); Assert.AreEqual(testData.boolProperty, tblEntity.Properties["boolProperty"].BooleanValue); //Assert.AreEqual(testData.datetimeOffsetProperty, tblEntity.Properties["datetimeOffsetProperty"].DateTimeOffsetValue); //Assert.AreEqual(testData.dateTimeProperty, tblEntity.Properties["dateTimeProperty"].DateTime); Assert.AreEqual(testData.doubleProperty, tblEntity.Properties["doubleProperty"].DoubleValue); Assert.AreEqual(testData.guidProperty, tblEntity.Properties["guidProperty"].GuidValue); Assert.AreEqual(testData.intProperty, tblEntity.Properties["intProperty"].Int32Value); Assert.AreEqual(testData.stringProperty, tblEntity.Properties["stringProperty"].StringValue); } catch (Exception e) { Assert.Fail("Retrieve test failed: " + e.Message); } }
public void RetrieveTestGenericTypes() { try { InsertOrReplaceTest(); var tables = new AzureStorage.Tables(Properties.Settings.Default.AzureConnection); var retObj = tables.Retrieve <UnitTestObject>(tableName, rowKey, partitionKey); CollectionAssert.AreEqual(testData.binaryProperty, retObj.binaryProperty); Assert.AreEqual(testData.boolProperty, retObj.boolProperty); //Assert.AreEqual(testData.datetimeOffsetProperty, tblEntity.Properties["datetimeOffsetProperty"].DateTimeOffsetValue); //Assert.AreEqual(testData.dateTimeProperty, tblEntity.Properties["dateTimeProperty"].DateTime); Assert.AreEqual(testData.doubleProperty, retObj.doubleProperty); Assert.AreEqual(testData.guidProperty, retObj.guidProperty); Assert.AreEqual(testData.intProperty, retObj.intProperty); Assert.AreEqual(testData.stringProperty, retObj.stringProperty); } catch (Exception e) { Assert.Fail("Retrieve test failed: " + e.Message); } }
public void RetrieveTestGenericTypes() { try { InsertOrReplaceTest(); var tables = new AzureStorage.Tables(Properties.Settings.Default.AzureConnection); var retObj = tables.Retrieve<UnitTestObject>(tableName, rowKey, partitionKey); CollectionAssert.AreEqual(testData.binaryProperty, retObj.binaryProperty); Assert.AreEqual(testData.boolProperty, retObj.boolProperty); //Assert.AreEqual(testData.datetimeOffsetProperty, tblEntity.Properties["datetimeOffsetProperty"].DateTimeOffsetValue); //Assert.AreEqual(testData.dateTimeProperty, tblEntity.Properties["dateTimeProperty"].DateTime); Assert.AreEqual(testData.doubleProperty, retObj.doubleProperty); Assert.AreEqual(testData.guidProperty, retObj.guidProperty); Assert.AreEqual(testData.intProperty, retObj.intProperty); Assert.AreEqual(testData.stringProperty, retObj.stringProperty); } catch (Exception e) { Assert.Fail("Retrieve test failed: " + e.Message); } }