void DoTestAllDataWithDictionaryMultiple() { bool isSuccess; try { StashClientOptions options = StashConfiguration.GetDefaultOptions(); AllDataWithDictionaryMultiple(options); // use large data must fail // if control came here we failed isSuccess = false; } catch (Exception) { isSuccess = true; } if (!isSuccess) { Assert.Fail(); } { StashClientOptions options = StashConfiguration.GetDefaultOptions(); options.SupportLargeObjectsInPool = true; AllDataWithDictionary entity = AllDataWithDictionaryMultiple(options); // now read without the support large pool options and validate the the entities do NOT match // and the unmapped pool count is different options.SupportLargeObjectsInPool = false; StashClient <AllDataWithDictionary> client = StashConfiguration.GetClient <AllDataWithDictionary>(options); AllDataWithDictionary entityRead = client.Get(entity.PartitionKey, entity.RowKey); Assert.IsFalse(entityRead.Equals(entity)); // now read without the support large pool options and validate the the entities DO match // and the unmapped pool count is different options.SupportLargeObjectsInPool = true; client = StashConfiguration.GetClient <AllDataWithDictionary>(options); entityRead = client.Get(entity.PartitionKey, entity.RowKey); Assert.IsTrue(entityRead.Equals(entity)); // delete client.Delete(entityRead); } }
AllDataWithDictionaryMultiple( StashClientOptions options) { StashClient <AllDataWithDictionary> client = StashConfiguration.GetClient <AllDataWithDictionary>(options); AllDataWithDictionary entity = TypeFactory <AllDataWithDictionary> .Create(DataSize.Multiple); // DataSize.Multiple client.Insert(entity); AllDataWithDictionary entityRead = client.Get(entity.PartitionKey, entity.RowKey); Assert.IsTrue(entityRead.Equals(entity)); return(entityRead); }