public void Configuration_UnNamedStore() { var conf = LaconicConfiguration.CreateFromString(CONF_SRC); using( var app = new ServiceBaseApplication(null, conf.Root)) { using(var store = new CacheStore("SomeStoreThat will be configured from default store without name")) { store.Configure(null); Assert.AreEqual(true, store.ParallelSweep); Assert.AreEqual(true, store.InstrumentationEnabled); Assert.AreEqual(1234567, store.TableOptions["doctor"].BucketCount); Assert.AreEqual(7, store.TableOptions["doctor"].RecPerPage); Assert.AreEqual(19, store.TableOptions["doctor"].LockCount); Assert.AreEqual(193, store.TableOptions["doctor"].MaxAgeSec); Assert.AreEqual(true, store.TableOptions["doctor"].ParallelSweep); Assert.AreEqual(451000000, store.TableOptions["PATIENT"].BucketCount); Assert.AreEqual(17, store.TableOptions["PATIENT"].RecPerPage); Assert.AreEqual(1025, store.TableOptions["PATIENT"].LockCount); Assert.AreEqual(739, store.TableOptions["PATIENT"].MaxAgeSec); Assert.AreEqual(true, store.TableOptions["PATIENT"].ParallelSweep); } } }
public void Configuration_NamedStore() { var conf = LaconicConfiguration.CreateFromString(CONF_SRC); using( var app = new ServiceBaseApplication(null, conf.Root)) { using(var store = new CacheStore("BANKING")) { store.Configure(null); Assert.AreEqual(789001, store.TableOptions["Account"].BucketCount); Assert.AreEqual(23, store.TableOptions["Account"].RecPerPage); Assert.AreEqual(149, store.TableOptions["Account"].LockCount); Assert.AreEqual(12000, store.TableOptions["Account"].MaxAgeSec); Assert.AreEqual(true, store.TableOptions["Account"].ParallelSweep); Assert.AreEqual(1023, store.TableOptions["BaLaNCE"].BucketCount); Assert.AreEqual(3, store.TableOptions["BaLaNCE"].RecPerPage); Assert.AreEqual(11, store.TableOptions["BaLaNCE"].LockCount); Assert.AreEqual(230000, store.TableOptions["BaLaNCE"].MaxAgeSec); Assert.AreEqual(false, store.TableOptions["BaLaNCE"].ParallelSweep); var tbl = store["AccoUNT"]; Assert.AreEqual(789001, tbl.BucketCount); Assert.AreEqual(23, tbl.RecPerPage); Assert.AreEqual(789001*23, tbl.Capacity); Assert.AreEqual(149, tbl.LockCount); Assert.AreEqual(12000, tbl.MaxAgeSec); Assert.AreEqual(true, tbl.ParallelSweep); } } }