public void DimentionValueWriterTest()
        {
            var writer = new NHibernateDimentionValueWriter();
            var slabWriter = new ConstSlabWriter();
            writer.Initialize();

            var dimentions = new IDimentionValue[] {
                new DimentionValueImpl (1, 1),
                new DimentionValueImpl (2, 2),
                new DimentionValueImpl (3, 3),
                new DimentionValueImpl (4, 4),
                new DimentionValueImpl (5, 5),
            };

            var slabId = slabWriter.GetNewSlabId();
            writer.WriteDimentionValues(slabId, dimentions);

            var value1 = writer.ReadDimentionValue(1, slabId);
            Assert.IsNotNull(value1);
            Assert.AreEqual(value1.GetDimentionId(), 1);
            Assert.AreEqual(value1.GetValue(), 1);
            Assert.AreEqual(value1.GetSlabId(), slabWriter.GetNewSlabId());

            var value3 = writer.ReadDimentionValue(3, slabWriter.GetNewSlabId());
            Assert.IsNotNull(value3);
            Assert.AreEqual(value3.GetDimentionId(), 3);
            Assert.AreEqual(value3.GetValue(), 3);
            Assert.AreEqual(value3.GetSlabId(), slabWriter.GetNewSlabId());
        }
        public void SlabWriterTest()
        {
            var slabWriter = new NHibernateSlabInfoWriter();
            slabWriter.Initialize();

            var dimentionWriter = new NHibernateDimentionValueWriter();
            var realSlabWriter = new RealSlabWriter {
                Writer = slabWriter
            };
            dimentionWriter.Initialize();

            var rnd = new Random();
            var dimentions = new IDimentionValue[] {
                new DimentionValueImpl(rnd.Next(), rnd.Next()),
                new DimentionValueImpl(rnd.Next(), rnd.Next()),
            };

            dimentionWriter.WriteDimentionValues(realSlabWriter.GetNewSlabId(), dimentions);

            var fromDb = dimentionWriter
                .ReadDimentionValue
                (dimentions[1].GetDimentionId(), realSlabWriter.LastSlabId);

            Assert.IsNotNull(fromDb);
            Assert.AreEqual(fromDb.GetValue(), dimentions[1].GetValue());
        }