Exemplo n.º 1
0
        public void DeliversHQXocument()
        {
            var mem  = new RamMnemonic();
            var hive = new MemorizedHive("in-memory", mem);

            hive.HQ().Cell("A").Update(new InputOf(new byte[1] {
                0xAB
            }));

            Assert.Equal(
                new byte[1] {
                0xAB
            },
                hive.HQ().Cell("A").Content()
                );
        }
Exemplo n.º 2
0
        public void DeliversHQInParallel()
        {
            var mem  = new RamMnemonic();
            var hive = new MemorizedHive("cars", mem);

            Parallel.For(0, Environment.ProcessorCount << 4, i =>
                    {
                    var xoc = hive.HQ().Xocument("test");
                    xoc.Modify(
                        new Directives()
                        .Xpath("/test")
                        .AddIf("result")
                        .Set("passed")
                        );
                    Assert.Equal(
                        "passed",
                        hive.HQ().Xocument("test").Value("/test/result/text()", "")
                        );
                });
        }