/// <exception cref="System.Exception"></exception> public virtual void Test() { Fixture().ResetConfig(); var config = Fixture().Config(); config.ReflectWith(((IReflector)ExcludingReflector.Value)); var alias = new TypeAlias(typeof(Sub), typeof( NoSuper)); config.AddAlias(alias); if ((((bool)DoDefragment.Value))) { Defragment(); } else { Reopen(); } var result = ((NoSuper )RetrieveOnlyInstance(typeof(NoSuper))); Assert.AreEqual("sub", result._subField); var newSuper = new NoSuper ("foo"); Store(newSuper); var q = NewQuery(typeof(NoSuper)); q.Descend("_subField").Constrain("foo"); var objectSet = q.Execute(); Assert.AreEqual(1, objectSet.Count); result = ((NoSuper)objectSet.Next()); Assert.AreEqual("foo", result._subField); Db().Refresh(result, int.MaxValue); }
/// <exception cref="System.Exception"></exception> public virtual void Test() { Fixture().ResetConfig(); var config = Fixture().Config(); config.ReflectWith(((IReflector) ExcludingReflector.Value)); var alias = new TypeAlias(typeof (Sub), typeof ( NoSuper)); config.AddAlias(alias); if ((((bool) DoDefragment.Value))) { Defragment(); } else { Reopen(); } var result = ((NoSuper ) RetrieveOnlyInstance(typeof (NoSuper))); Assert.AreEqual("sub", result._subField); var newSuper = new NoSuper ("foo"); Store(newSuper); var q = NewQuery(typeof (NoSuper)); q.Descend("_subField").Constrain("foo"); var objectSet = q.Execute(); Assert.AreEqual(1, objectSet.Count); result = ((NoSuper) objectSet.Next()); Assert.AreEqual("foo", result._subField); Db().Refresh(result, int.MaxValue); }