コード例 #1
0
            /// <exception cref="System.Exception"></exception>
            public virtual void Test()
            {
                Fixture().ResetConfig();
                IConfiguration config = Fixture().Config();

                config.ReflectWith(((IReflector)ExcludingReflector.Value));
                TypeAlias alias = new TypeAlias(typeof(RemovedClassRefactoringTestSuite.Sub), typeof(
                                                    RemovedClassRefactoringTestSuite.NoSuper));

                config.AddAlias(alias);
                if ((((bool)DoDefragment.Value)))
                {
                    Defragment();
                }
                else
                {
                    Reopen();
                }
                RemovedClassRefactoringTestSuite.NoSuper result = ((RemovedClassRefactoringTestSuite.NoSuper
                                                                    )RetrieveOnlyInstance(typeof(RemovedClassRefactoringTestSuite.NoSuper)));
                Assert.AreEqual("sub", result._subField);
                RemovedClassRefactoringTestSuite.NoSuper newSuper = new RemovedClassRefactoringTestSuite.NoSuper
                                                                        ("foo");
                Store(newSuper);
                IQuery q = NewQuery(typeof(RemovedClassRefactoringTestSuite.NoSuper));

                q.Descend("_subField").Constrain("foo");
                IObjectSet objectSet = q.Execute();

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