Beispiel #1
0
 public static void Derive(this ISession session, bool throwExceptionOnError)
 {
     var derivation = new Derivation(session);
     var derivationLog = derivation.Derive();
     if (throwExceptionOnError && derivationLog.HasErrors)
     {
         throw new DerivationException(derivationLog);
     }
 }
Beispiel #2
0
        public void Sort()
        {
            var x = new C1Builder(this.DatabaseSession).Build();
            var y = new C1Builder(this.DatabaseSession).Build();
            var z = new C1Builder(this.DatabaseSession).Build();

            x.AddDependency(y);
            y.AddDependency(z);

            var derivation = new Derivation(this.DatabaseSession);

            var sequence = new List<IObject>();
            derivation["sequence"] = sequence;

            derivation.Derive();

            Assert.AreEqual(z, sequence[0]);
            Assert.AreEqual(y, sequence[1]);
            Assert.AreEqual(x, sequence[2]);
        }
Beispiel #3
0
        public void SortDiamond()
        {
            var a = new C1Builder(this.DatabaseSession).Build();
            var b = new C1Builder(this.DatabaseSession).Build();
            var c = new C1Builder(this.DatabaseSession).Build();
            var d = new C1Builder(this.DatabaseSession).Build();

            a.AddDependency(b);
            a.AddDependency(c);

            b.AddDependency(d);
            c.AddDependency(d);

            var derivation = new Derivation(this.DatabaseSession);

            var sequence = new List<IObject>();
            derivation["sequence"] = sequence;

            derivation.Derive();

            Assert.AreEqual(d, sequence[0]);
            Assert.AreEqual(a, sequence[3]);
        }
Beispiel #4
0
 public static DerivationLog Derive(this ISession session)
 {
     var derivation = new Derivation(session);
     return derivation.Derive();
 }