public void ShouldGetIndividualShardlet()
        {
            //assemble
            var driver = new AzureShardSetConnectionDriver();

            var shardSetConfig = GetShardSetConfig();

            InsertTestShardlets(driver, 10);

            // act (should be in cache)
            const string shardingKey     = "1";
            var          distributionKey = GetDistributionKey(shardingKey);
            var          shardlet        = driver.GetShardletByShardingKey(shardSetConfig.ShardSetName, shardingKey, distributionKey);

            //assert
            Assert.IsNotNull(shardlet);
            Assert.AreEqual(shardingKey, shardlet.ShardingKey);
            Assert.AreEqual(distributionKey, shardlet.DistributionKey);

            // act (no caching)
            AzureCache.Clear();
            shardlet = driver.GetShardletByShardingKey(shardSetConfig.ShardSetName, shardingKey, distributionKey);

            //assert
            Assert.IsNotNull(shardlet);
            Assert.AreEqual(shardingKey, shardlet.ShardingKey);
            Assert.AreEqual(distributionKey, shardlet.DistributionKey);
        }
 public void TestInitialize()
 {
     AzureShardSetConnectionDriver.InitializeAzureTables(_testShardSetName, true);
     AzureShardSetConnectionDriver.InitializeAzureTables();
     AzureCache.Clear();
 }
Beispiel #3
0
 public void T0_ClearCache()
 {
     AzureCache.Clear();
 }