public void Establish_context() { mocks = new MockRepository(); namespaceTreeBuilder = new NamespaceTreeBuilder(); testModelData = new TestModelData(); var assembly = new TestData("assembly", "assembly", "assembly"); testModelData.RootTest.Children.Add(assembly); var nsRootCodeElement = mocks.StrictMock<ICodeElementInfo>(); var nsRootCodeReference = new CodeReference("assembly", null, null, null, null); var nsRoot = new Test("nsRoot", nsRootCodeElement); using (mocks.Record()) { Expect.Call(nsRootCodeElement.CodeReference).Return(nsRootCodeReference); Expect.Call(nsRootCodeElement.GetCodeLocation()).Return(new CodeLocation("about:blank", 1, 1)); } nsRoot.Kind = Gallio.Model.TestKinds.Namespace; nsRoot.IsTestCase = false; var nsRootTest = new TestData(nsRoot, true); assembly.Children.Add(nsRootTest); var nsLevel1CodeElement = mocks.StrictMock<ICodeElementInfo>(); var nsLevel1CodeReference = new CodeReference("assembly", null, null, null, null); var nsLevel1 = new Test("nsLevel1", nsLevel1CodeElement); using (mocks.Record()) { Expect.Call(nsLevel1CodeElement.CodeReference).Return(nsLevel1CodeReference); Expect.Call(nsLevel1CodeElement.GetCodeLocation()).Return(new CodeLocation("about:blank", 1, 1)); } nsLevel1.Kind = Gallio.Model.TestKinds.Namespace; nsLevel1.IsTestCase = false; var nsLevel1Test = new TestData(nsLevel1, true); nsRootTest.Children.Add(nsLevel1Test); var nsLevel2CodeElement = mocks.StrictMock<ICodeElementInfo>(); var nsLevel2CodeReference = new CodeReference("assembly", null, null, null, null); var nsLevel2 = new Test("nsLevel2", nsLevel2CodeElement); using (mocks.Record()) { Expect.Call(nsLevel2CodeElement.CodeReference).Return(nsLevel2CodeReference); Expect.Call(nsLevel2CodeElement.GetCodeLocation()).Return(new CodeLocation("about:blank", 1, 1)); } nsLevel2.Kind = Gallio.Model.TestKinds.Namespace; nsLevel2.IsTestCase = false; var nsLevel2Test = new TestData(nsLevel2, true); nsLevel1Test.Children.Add(nsLevel2Test); var nsLevel2aCodeElement = mocks.StrictMock<ICodeElementInfo>(); var nsLevel2aCodeReference = new CodeReference("assembly", null, null, null, null); var nsLevel2a = new Test("nsLevel2a", nsLevel2aCodeElement); using (mocks.Record()) { Expect.Call(nsLevel2aCodeElement.CodeReference).Return(nsLevel2aCodeReference); Expect.Call(nsLevel2aCodeElement.GetCodeLocation()).Return(new CodeLocation("about:blank", 1, 1)); } nsLevel2a.Kind = Gallio.Model.TestKinds.Namespace; nsLevel2a.IsTestCase = false; var nsLevel2aTest = new TestData(nsLevel2a, true); nsLevel1Test.Children.Add(nsLevel2aTest); var fixture1CodeElement = mocks.StrictMock<ICodeElementInfo>(); var fixture1CodeReference = new CodeReference("assembly", "nsRoot.nsLevel1.nsLevel2", "fixture1", null, null); var fixture1 = new Test("fixture1", fixture1CodeElement); using (mocks.Record()) { Expect.Call(fixture1CodeElement.CodeReference).Return(fixture1CodeReference); Expect.Call(fixture1CodeElement.GetCodeLocation()).Return(new CodeLocation("about:blank", 1, 1)); } fixture1.Kind = Gallio.Model.TestKinds.Fixture; fixture1.IsTestCase = false; var fixture1Test = new TestData(fixture1, true); nsLevel2Test.Children.Add(fixture1Test); var fixture2CodeElement = mocks.StrictMock<ICodeElementInfo>(); var fixture2CodeReference = new CodeReference("assembly", "nsRoot.nsLevel1.nsLevel2a", "fixture2", null, null); var fixture2 = new Test("fixture2", fixture2CodeElement); using (mocks.Record()) { Expect.Call(fixture2CodeElement.CodeReference).Return(fixture2CodeReference); Expect.Call(fixture2CodeElement.GetCodeLocation()).Return(new CodeLocation("about:blank", 1, 1)); } fixture2.Kind = Gallio.Model.TestKinds.Fixture; fixture2.IsTestCase = false; var fixture2Test = new TestData(fixture2, true); nsLevel2aTest.Children.Add(fixture2Test); }