public void AssertEqualTo(EncryptableTestEntity other)
 {
     Assert.NotNull(other);
     Assert.AreEqual(this.RowKey, other.RowKey, "RowKeys do not match");
     Assert.AreEqual(this.StringField, other.StringField, "String fields do not match");
     CollectionAssert.AreEqual(this.ByteField, other.ByteField, "Byte fields do not match");
 }
Пример #2
0
        public EncryptableTestEntity GetEntity(EncryptableTestEntity requestedEntity)
        {
            TableOperation retrieveOperation = TableOperation.Retrieve<EncryptableTestEntity>(requestedEntity.PartitionKey, requestedEntity.RowKey);
            TableResult retrievedResult = GetTable().Execute(retrieveOperation);
            EncryptableTestEntity entity = (EncryptableTestEntity)retrievedResult.Result;

            return entity;
        }
Пример #3
0
 public void AddEntity(EncryptableTestEntity entity)
 {
     try
     {
         var op = TableOperation.InsertOrReplace(entity);
         GetTable().Execute(op);
     }
     catch (Exception ex)
     {
         Trace.Write(ex.ToString());
     }
 }
Пример #4
0
        public void Setup()
        {
            encryptedTable = new TestTable(CloudStorageAccount.DevelopmentStorageAccount);
            encryptedTable.CurrentEncryptionVersion = SetupFixture.TEST_ENCRYPTION_VERSION;

            unencryptedTable = new TestTable(CloudStorageAccount.DevelopmentStorageAccount);
            unencryptedTable.CurrentEncryptionVersion = 0;

            testEntity = new EncryptableTestEntity()
            {
                StringField = Guid.NewGuid().ToString(),
                ByteField = Guid.NewGuid().ToByteArray(),
                EncryptionVersion = SetupFixture.TEST_ENCRYPTION_VERSION
            };
        }
        public void Setup()
        {
            client = acct.CreateCloudTableClient();
            table = client.GetTableReference("AzureTableCryptoUnitTestTable");

            testEntity = new EncryptableTestEntity()
            {
                StringField = Guid.NewGuid().ToString(),
                ByteField = Guid.NewGuid().ToByteArray(),
                EncryptionVersion = SetupFixture.TEST_ENCRYPTION_VERSION
            };
        }
Пример #6
0
 public void UpdateEntity(EncryptableTestEntity entity)
 {
     var op = TableOperation.InsertOrReplace(entity);
     GetTable().Execute(op);
 }
Пример #7
0
 public void DeleteEntity(EncryptableTestEntity entity)
 {
     entity.ETag = "*";
     var op = TableOperation.Delete(entity);
     GetTable().Execute(op);
 }