public AzureTableStoragePerformanceTests()
 {
     try
     {
         _logger = LogManager.GetLogger(TargetTableName);
         var storageAccount = GetStorageAccount();
         // Create the table client.
         var tableClient = storageAccount.CreateCloudTableClient();
         //create charts table if not exists.
         _cloudTable = tableClient.GetTableReference(TargetTableName);
         _cloudTable.DeleteIfExists();
         _cloudTable.CreateIfNotExists();
     }
     catch (Exception ex)
     {
         throw new Exception("Failed to initialize tests, make sure Azure Storage Emulator is running.", ex);
     }
 }
        public static void Initialize(TestContext context)
        {
            ConnectionStringSettingsCollection settings =
                ConfigurationManager.ConnectionStrings;
            ConnectionStringSettings connectionStringSettings = settings["Azure"];
            var builder = new DbConnectionStringBuilder
                          {
                          	ConnectionString = connectionStringSettings.ConnectionString
                          };
            accountName = (string) builder["AccountName"];
            accountKey = (string) builder["AccountKey"];
            var account = CloudStorageAccount.Parse(connectionStringSettings.ConnectionString);
            CloudTableClient tableClient = account.CreateCloudTableClient();

            // Create Table
            table = tableClient.GetTableReference(TableName);
            var b = table.DeleteIfExists();
            Console.WriteLine(string.Format("deleted table {0}: {1}", TableName, b));
            table.CreateIfNotExists();

            // Insert Entity
            var person = new ContactEntity("Peter", "Ritchie") { Email = "*****@*****.**", PhoneNumber = "555-0123" };
            table.Execute(TableOperation.Insert(person));
        }
 public static void DeleteAzureTable(CloudTable table)
 {
     table.DeleteIfExists();
 }
Beispiel #4
0
        public override bool OnStart()
        {
            ServicePointManager.DefaultConnectionLimit = 5000;

            command.Clear();

            // Gracefully stop crawling
            crawlHtml = false;
            crawlXml = false;

            crawlUrl.Clear();
            xmls.Clear();
            urls.Clear();
            disallow.Clear();

            while (answers.PeekMessage() != null)
            {
                answers.DeleteMessage(answers.GetMessage());
            }

            while (command.PeekMessage() != null)
            {
                command.DeleteMessage(answers.GetMessage());
            }

            table = tableClient.GetTableReference("sites" + guid);
            errorTable = tableClient.GetTableReference("errors" + guid);

            table.DeleteIfExists();
            errorTable.DeleteIfExists();

            guid = Guid.NewGuid().ToString().Substring(0, 5);

            table = tableClient.GetTableReference("sites" + guid);
            errorTable = tableClient.GetTableReference("errors" + guid);

            table.CreateIfNotExists();
            errorTable.CreateIfNotExists();

            siteEntries = 0;

            return base.OnStart();
        }
Beispiel #5
0
        public void CloudTableExistsAPM()
        {
            CloudTableClient tableClient = GenerateCloudTableClient();
            string           tableName   = GenerateRandomTableName();
            CloudTable       tableRef    = tableClient.GetTableReference(tableName);

            try
            {
                using (ManualResetEvent evt = new ManualResetEvent(false))
                {
                    IAsyncResult result = null;
                    tableRef.BeginExists((res) =>
                    {
                        result = res;
                        evt.Set();
                    }, null);

                    evt.WaitOne();

                    // Table should not have been deleted as it doesnt exist
                    Assert.IsFalse(tableRef.EndExists(result));
                }

                tableRef.Create();

                using (ManualResetEvent evt = new ManualResetEvent(false))
                {
                    IAsyncResult result = null;
                    tableRef.BeginExists((res) =>
                    {
                        result = res;
                        evt.Set();
                    }, null);

                    evt.WaitOne();

                    // Table should not have been deleted as it doesnt exist
                    Assert.IsTrue(tableRef.EndExists(result));
                }

                tableRef.Delete();
                using (ManualResetEvent evt = new ManualResetEvent(false))
                {
                    IAsyncResult result = null;
                    tableRef.BeginExists((res) =>
                    {
                        result = res;
                        evt.Set();
                    }, null);

                    evt.WaitOne();

                    // Table should not have been deleted as it doesnt exist
                    Assert.IsFalse(tableRef.EndExists(result));
                }
            }
            finally
            {
                tableRef.DeleteIfExists();
            }
        }
        /// <summary>
        /// Tests table access permissions with SAS, using a stored policy and using permissions on the URI.
        /// </summary>
        /// <param name="accessPermissions">The permissions to test.</param>
        /// <param name="startPk">The start partition key range.</param>
        /// <param name="startRk">The start row key range.</param>
        /// <param name="endPk">The end partition key range.</param>
        /// <param name="endRk">The end row key range.</param>
        internal void TestTableSasWithRange(
            SharedAccessTablePermissions accessPermissions,
            string startPk,
            string startRk,
            string endPk,
            string endRk)
        {
            CloudTableClient tableClient = GenerateCloudTableClient();
            CloudTable       table       = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));

            try
            {
                table.Create();

                // Set up a policy
                string           identifier  = Guid.NewGuid().ToString();
                TablePermissions permissions = new TablePermissions();
                permissions.SharedAccessPolicies.Add(identifier, new SharedAccessTablePolicy
                {
                    Permissions            = accessPermissions,
                    SharedAccessExpiryTime = DateTimeOffset.Now.AddDays(1)
                });

                table.SetPermissions(permissions);
                Thread.Sleep(30 * 1000);

                // Prepare SAS authentication using access identifier
                string           sasString           = table.GetSharedAccessSignature(new SharedAccessTablePolicy(), identifier, startPk, startRk, endPk, endRk);
                CloudTableClient identifierSasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString));

                // Prepare SAS authentication using explicit policy
                sasString = table.GetSharedAccessSignature(
                    new SharedAccessTablePolicy
                {
                    Permissions            = accessPermissions,
                    SharedAccessExpiryTime = DateTimeOffset.Now.AddMinutes(30)
                },
                    null,
                    startPk,
                    startRk,
                    endPk,
                    endRk);

                CloudTableClient explicitSasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString));

                // Point query
                TestPointQuery(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestPointQuery(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);

                // Add row
                TestAdd(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestAdd(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);

                // Update row (merge)
                TestUpdateMerge(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestUpdateMerge(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);

                // Update row (replace)
                TestUpdateReplace(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestUpdateReplace(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);

                // Delete row
                TestDelete(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestDelete(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);

                // Upsert row (merge)
                TestUpsertMerge(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestUpsertMerge(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);

                // Upsert row (replace)
                TestUpsertReplace(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
                TestUpsertReplace(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
            }
            finally
            {
                table.DeleteIfExists();
            }
        }
        public void TableSASNullAccessPolicy()
        {
            CloudTableClient tableClient = GenerateCloudTableClient();
            CloudTable       table       = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));

            try
            {
                table.Create();

                table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK")));

                TablePermissions expectedPermissions = new TablePermissions();

                // Add a policy
                expectedPermissions.SharedAccessPolicies.Add(Guid.NewGuid().ToString(), new SharedAccessTablePolicy
                {
                    Permissions            = SharedAccessTablePermissions.Query | SharedAccessTablePermissions.Add,
                    SharedAccessStartTime  = DateTimeOffset.Now - TimeSpan.FromHours(1),
                    SharedAccessExpiryTime = DateTimeOffset.Now + TimeSpan.FromHours(1)
                });

                table.SetPermissions(expectedPermissions);
                Thread.Sleep(30 * 1000);

                // Generate the sasToken the user should use
                string sasToken = table.GetSharedAccessSignature(null, expectedPermissions.SharedAccessPolicies.First().Key, "AAAA", null, "AAAA", null);

                CloudTable sasTable = new CloudTable(table.Uri, new StorageCredentials(sasToken));

                sasTable.Execute(TableOperation.Insert(new DynamicTableEntity("AAAA", "foo")));

                TableResult result = sasTable.Execute(TableOperation.Retrieve("AAAA", "foo"));

                Assert.IsNotNull(result.Result);

                // revoke table permissions
                table.SetPermissions(new TablePermissions());
                Thread.Sleep(30 * 1000);

                OperationContext opContext = new OperationContext();
                try
                {
                    sasTable.Execute(TableOperation.Insert(new DynamicTableEntity("AAAA", "foo2")), null, opContext);
                    Assert.Fail();
                }
                catch (Exception)
                {
                    Assert.AreEqual(opContext.LastResult.HttpStatusCode, (int)HttpStatusCode.Forbidden);
                }

                opContext = new OperationContext();
                try
                {
                    result = sasTable.Execute(TableOperation.Retrieve("AAAA", "foo"), null, opContext);
                    Assert.Fail();
                }
                catch (Exception)
                {
                    Assert.AreEqual(opContext.LastResult.HttpStatusCode, (int)HttpStatusCode.Forbidden);
                }
            }
            finally
            {
                table.DeleteIfExists();
            }
        }
 public void MyTestCleanup()
 {
     currentTable.DeleteIfExists();
 }
Beispiel #9
0
        public void ListTablesWithPrefixExtended()
        {
            CloudTableClient tableClient = GenerateCloudTableClient();

            int    NumTables       = 50;
            int    TableNameLength = 8;
            int    NumQueries      = 100;
            string alpha           = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
            string numerics        = "0123456789";
            string legalChars      = alpha + numerics;

            string            queryString = string.Empty;
            List <CloudTable> tableList   = new List <CloudTable>();
            List <CloudTable> localTestCreatedTableList = new List <CloudTable>();

            Random rand = new Random();

            try
            {
                #region Generate Tables

                // Generate Tables in Storage
                // This will generate all caps Tables, i.e. AAAAAAAA, BBBBBBBB....
                for (int h = 26; h < alpha.Length; h++)
                {
                    string tString = string.Empty;
                    for (int i = 0; i < TableNameLength; i++)
                    {
                        tString += alpha[h];
                    }

                    CloudTable table = tableClient.GetTableReference(tString);

                    if (table.CreateIfNotExists())
                    {
                        tableList.Add(table);
                        localTestCreatedTableList.Add(table);
                    }
                }

                // Generate some random tables of TableNameLength, table must start with a letter
                for (int m = 0; m < NumTables; m++)
                {
                    string tableName = GenerateRandomStringFromCharset(1, alpha, rand).ToLower() +
                                       GenerateRandomStringFromCharset(TableNameLength - 1, legalChars, rand).ToLower();

                    CloudTable table = tableClient.GetTableReference(tableName);

                    if (table.CreateIfNotExists())
                    {
                        tableList.Add(table);
                        localTestCreatedTableList.Add(table);
                    }
                }

                #endregion

                #region Generate Query Strings to cover all boundary conditions
                List <string> queryStrings = new List <string>()
                {
                    String.Empty, "aa", "zz", "az", "Az", "Aa", "zZ", "AA", "ZZ", "AZ", "z9", "a9", "aaa"
                };
                for (int k = 0; k < legalChars.Length; k++)
                {
                    queryStrings.Add(legalChars[k].ToString());
                }

                for (int n = 0; n <= NumQueries; n++)
                {
                    queryStrings.Add(GenerateRandomStringFromCharset((n % TableNameLength) + 1, legalChars, rand));
                }
                #endregion

                #region Merge Created Tables With Pre-existing ones
                int totalTables = 0;
                foreach (CloudTable listedTable in tableClient.ListTables())
                {
                    totalTables++;
                    if (tableList.Where((tbl) => tbl.Uri == listedTable.Uri).FirstOrDefault() != null)
                    {
                        continue;
                    }

                    tableList.Add(listedTable);
                }

                Assert.AreEqual(tableList.Count, totalTables);
                #endregion

                List <CloudTable> serviceResult = null;
                List <CloudTable> LINQResult    = null;

                try
                {
                    foreach (string queryValue in queryStrings)
                    {
                        queryString = queryValue;

                        serviceResult = tableClient.ListTables(queryString).OrderBy((table) => table.Name).ToList();
                        LINQResult    = tableList.Where((table) => table.Name.ToLower().StartsWith(queryString.ToLower())).OrderBy((table) => table.Name).ToList();

                        Assert.AreEqual(serviceResult.Count(), LINQResult.Count());

                        for (int listDex = 0; listDex < serviceResult.Count(); listDex++)
                        {
                            Assert.AreEqual(serviceResult[listDex].Name, LINQResult[listDex].Name);
                        }
                    }
                }
                catch (Exception)
                {
                    // On exception log table names for repro
                    this.testContextInstance.WriteLine("Exception in ListTablesWithPrefix, Dumping Tables for repro. QueryString = {0}\r\n", queryString);

                    foreach (CloudTable table in tableList)
                    {
                        this.testContextInstance.WriteLine(table.Name);
                    }

                    this.testContextInstance.WriteLine("Linq results =======================");

                    foreach (CloudTable table in LINQResult)
                    {
                        this.testContextInstance.WriteLine(table.Name);
                    }

                    this.testContextInstance.WriteLine("Service results =======================");

                    foreach (CloudTable table in serviceResult)
                    {
                        this.testContextInstance.WriteLine(table.Name);
                    }
                    throw;
                }
            }
            finally
            {
                // Cleanup
                foreach (CloudTable table in localTestCreatedTableList)
                {
                    // Dont delete Class level tables
                    if (createdTables.Where((tbl) => tbl.Uri == table.Uri).FirstOrDefault() != null)
                    {
                        continue;
                    }

                    // Delete other tables
                    table.DeleteIfExists();
                }
            }
        }
Beispiel #10
0
 public static void MyClassCleanup()
 {
     currentTable.DeleteIfExists();
 }
Beispiel #11
0
        public void TableRegionalQueryOnSupportedTypes()
        {
            CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");

            CloudTableClient client = GenerateCloudTableClient();
            CloudTable       table  = client.GetTableReference(GenerateRandomTableName());

            try
            {
                table.Create();

                // Setup
                TableBatchOperation batch    = new TableBatchOperation();
                string             pk        = Guid.NewGuid().ToString();
                DynamicTableEntity middleRef = null;
                for (int m = 0; m < 100; m++)
                {
                    ComplexEntity complexEntity = new ComplexEntity();
                    complexEntity.String           = string.Format("{0:0000}", m);
                    complexEntity.Binary           = new byte[] { 0x01, 0x02, (byte)m };
                    complexEntity.BinaryPrimitive  = new byte[] { 0x01, 0x02, (byte)m };
                    complexEntity.Bool             = m % 2 == 0 ? true : false;
                    complexEntity.BoolPrimitive    = m % 2 == 0 ? true : false;
                    complexEntity.Double           = m + ((double)m / 100);
                    complexEntity.DoublePrimitive  = m + ((double)m / 100);
                    complexEntity.Int32            = m;
                    complexEntity.IntegerPrimitive = m;
                    complexEntity.Int64            = (long)int.MaxValue + m;
                    complexEntity.LongPrimitive    = (long)int.MaxValue + m;
                    complexEntity.Guid             = Guid.NewGuid();

                    DynamicTableEntity dynEnt = new DynamicTableEntity(pk, string.Format("{0:0000}", m));
                    dynEnt.Properties = complexEntity.WriteEntity(null);
                    batch.Insert(dynEnt);

                    if (m == 50)
                    {
                        middleRef = dynEnt;
                    }

                    // Add delay to make times unique
                    Thread.Sleep(100);
                }

                table.ExecuteBatch(batch);

                // 1. Filter on String
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterCondition("String", QueryComparisons.GreaterThanOrEqual, "0050"), 50);

                // 2. Filter on Guid
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForGuid("Guid", QueryComparisons.Equal, middleRef["Guid"].GuidValue.Value), 1);

                // 3. Filter on Long
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForLong("Int64", QueryComparisons.GreaterThanOrEqual,
                                                                                       middleRef["LongPrimitive"].Int64Value.Value), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForLong("LongPrimitive",
                                                                                              QueryComparisons.GreaterThanOrEqual, middleRef["LongPrimitive"].Int64Value.Value), 50);

                // 4. Filter on Double
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForDouble("Double", QueryComparisons.GreaterThanOrEqual,
                                                                                         middleRef["Double"].DoubleValue.Value), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForDouble("DoublePrimitive",
                                                                                                QueryComparisons.GreaterThanOrEqual, middleRef["DoublePrimitive"].DoubleValue.Value), 50);

                // 5. Filter on Integer
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForInt("Int32", QueryComparisons.GreaterThanOrEqual,
                                                                                      middleRef["Int32"].Int32Value.Value), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForInt("IntegerPrimitive",
                                                                                             QueryComparisons.GreaterThanOrEqual, middleRef["IntegerPrimitive"].Int32Value.Value), 50);

                // 6. Filter on Date
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForDate("DateTimeOffset", QueryComparisons.GreaterThanOrEqual,
                                                                                       middleRef["DateTimeOffset"].DateTimeOffsetValue.Value), 50);

                // 7. Filter on Boolean
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBool("Bool", QueryComparisons.Equal, middleRef["Bool"].BooleanValue.Value), 50);

                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBool("BoolPrimitive", QueryComparisons.Equal, middleRef["BoolPrimitive"].BooleanValue.Value),
                                             50);

                // 8. Filter on Binary
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBinary("Binary", QueryComparisons.Equal, middleRef["Binary"].BinaryValue), 1);

                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBinary("BinaryPrimitive", QueryComparisons.Equal,
                                                                                         middleRef["BinaryPrimitive"].BinaryValue), 1);

                // 9. Filter on Binary GTE
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBinary("Binary", QueryComparisons.GreaterThanOrEqual,
                                                                                         middleRef["Binary"].BinaryValue), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForBinary("BinaryPrimitive",
                                                                                                QueryComparisons.GreaterThanOrEqual, middleRef["BinaryPrimitive"].BinaryValue), 50);

                // 10. Complex Filter on Binary GTE
                ExecuteQueryAndAssertResults(table, TableQuery.CombineFilters(
                                                 TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal,
                                                                                    middleRef.PartitionKey),
                                                 TableOperators.And,
                                                 TableQuery.GenerateFilterConditionForBinary("Binary", QueryComparisons.GreaterThanOrEqual,
                                                                                             middleRef["Binary"].BinaryValue)), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForBinary("BinaryPrimitive",
                                                                                                QueryComparisons.GreaterThanOrEqual, middleRef["BinaryPrimitive"].BinaryValue), 50);
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = currentCulture;
                table.DeleteIfExists();
            }
        }
        public void TableGenericQueryOnSupportedTypes()
        {
            CloudTableClient client = GenerateCloudTableClient();

            CloudTable table = client.GetTableReference(GenerateRandomTableName());

            table.Create();

            try
            {
                // Setup
                TableBatchOperation batch = new TableBatchOperation();
                string        pk          = Guid.NewGuid().ToString();
                ComplexEntity middleRef   = null;
                for (int m = 0; m < 100; m++)
                {
                    ComplexEntity complexEntity = new ComplexEntity(pk, string.Format("{0:0000}", m));
                    complexEntity.String           = string.Format("{0:0000}", m);
                    complexEntity.Binary           = new byte[] { 0x01, 0x02, (byte)m };
                    complexEntity.BinaryPrimitive  = new byte[] { 0x01, 0x02, (byte)m };
                    complexEntity.Bool             = m % 2 == 0 ? true : false;
                    complexEntity.BoolPrimitive    = m % 2 == 0 ? true : false;
                    complexEntity.Double           = m + ((double)m / 100);
                    complexEntity.DoublePrimitive  = m + ((double)m / 100);
                    complexEntity.Int32            = m;
                    complexEntity.IntegerPrimitive = m;
                    complexEntity.Int64            = m;
                    complexEntity.LongPrimitive    = m;
                    complexEntity.Guid             = Guid.NewGuid();

                    batch.Insert(complexEntity);

                    if (m == 50)
                    {
                        middleRef = complexEntity;
                    }

                    // Add delay to make times unique
                    Thread.Sleep(100);
                }

                table.ExecuteBatch(batch);

                // 1. Filter on String
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterCondition("String", QueryComparisons.GreaterThanOrEqual, "0050"), 50);

                // 2. Filter on Guid
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForGuid("Guid", QueryComparisons.Equal, middleRef.Guid), 1);

                // 3. Filter on Long
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForLong("Int64", QueryComparisons.GreaterThanOrEqual,
                                                                                       middleRef.LongPrimitive), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForLong("LongPrimitive",
                                                                                              QueryComparisons.GreaterThanOrEqual, middleRef.LongPrimitive), 50);

                // 4. Filter on Double
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForDouble("Double", QueryComparisons.GreaterThanOrEqual,
                                                                                         middleRef.Double), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForDouble("DoublePrimitive",
                                                                                                QueryComparisons.GreaterThanOrEqual, middleRef.DoublePrimitive), 50);

                // 5. Filter on Integer
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForInt("Int32", QueryComparisons.GreaterThanOrEqual,
                                                                                      middleRef.Int32), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForInt("IntegerPrimitive",
                                                                                             QueryComparisons.GreaterThanOrEqual, middleRef.IntegerPrimitive), 50);

                // 6. Filter on Date
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForDate("DateTimeOffset", QueryComparisons.GreaterThanOrEqual,
                                                                                       middleRef.DateTimeOffset), 50);

                // 7. Filter on Boolean
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBool("Bool", QueryComparisons.Equal, middleRef.Bool), 50);

                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBool("BoolPrimitive", QueryComparisons.Equal, middleRef.BoolPrimitive),
                                             50);

                // 8. Filter on Binary
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBinary("Binary", QueryComparisons.Equal, middleRef.Binary), 1);

                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBinary("BinaryPrimitive", QueryComparisons.Equal,
                                                                                         middleRef.BinaryPrimitive), 1);

                // 9. Filter on Binary GTE
                ExecuteQueryAndAssertResults(table,
                                             TableQuery.GenerateFilterConditionForBinary("Binary", QueryComparisons.GreaterThanOrEqual,
                                                                                         middleRef.Binary), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForBinary("BinaryPrimitive",
                                                                                                QueryComparisons.GreaterThanOrEqual, middleRef.BinaryPrimitive), 50);

                // 10. Complex Filter on Binary GTE
                ExecuteQueryAndAssertResults(table, TableQuery.CombineFilters(
                                                 TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal,
                                                                                    middleRef.PartitionKey),
                                                 TableOperators.And,
                                                 TableQuery.GenerateFilterConditionForBinary("Binary", QueryComparisons.GreaterThanOrEqual,
                                                                                             middleRef.Binary)), 50);

                ExecuteQueryAndAssertResults(table, TableQuery.GenerateFilterConditionForBinary("BinaryPrimitive",
                                                                                                QueryComparisons.GreaterThanOrEqual, middleRef.BinaryPrimitive), 50);
            }
            finally
            {
                table.DeleteIfExists();
            }
        }