Пример #1
0
        public void Subdependency()
        {
            var dependent   = new DependentBuilder(this.Session).Build();
            var dependee    = new DependeeBuilder(this.Session).Build();
            var subdependee = new SubdependeeBuilder(this.Session).Build();

            dependent.Dependee   = dependee;
            dependee.Subdependee = subdependee;

            this.Session.Commit();

            subdependee.Subcounter = 10;

            this.Session.Derive(true);

            Assert.AreEqual(1, dependent.Counter);
            Assert.AreEqual(1, dependee.Counter);

            Assert.AreEqual(11, dependent.Subcounter);
            Assert.AreEqual(11, dependee.Subcounter);
            Assert.AreEqual(11, subdependee.Subcounter);
        }
Пример #2
0
        public void Subdependency()
        {
            var dependent = new DependentBuilder(this.DatabaseSession).Build();
            var dependee = new DependeeBuilder(this.DatabaseSession).Build();
            var subdependee = new SubdependeeBuilder(this.DatabaseSession).Build();

            dependent.Dependee = dependee;
            dependee.Subdependee = subdependee;

            this.DatabaseSession.Commit();

            subdependee.Subcounter = 10;

            this.DatabaseSession.Derive(true);

            Assert.AreEqual(1, dependent.Counter);
            Assert.AreEqual(1, dependee.Counter);

            Assert.AreEqual(11, dependent.Subcounter);
            Assert.AreEqual(11, dependee.Subcounter);
            Assert.AreEqual(11, subdependee.Subcounter);
        }