Exemplo n.º 1
0
        public void TestTransaction()
        {
            bool calledBack = false;

            TransactionInternal.Apply(
                (trans, _) =>
            {
                trans.Prioritized(Node <Unit> .Null, trans2 => calledBack = true);
                return(UnitInternal.Value);
            },
                false);
            Assert.IsTrue(calledBack);
        }
Exemplo n.º 2
0
        public void TestNode()
        {
            Node <int> a = new Node <int>();
            Node <int> b = new Node <int>();

            TransactionInternal.Apply(
                (trans, _) =>
            {
                a.Link(trans, (t, v) => { }, b);
                trans.Prioritized(a, t => { });
                return(UnitInternal.Value);
            },
                false);
            Assert.That(a.Rank, Is.LessThan(b.Rank));
        }