public void SetUpTestnameTest() { /*this.typeDeclarations = new CodeTypeDeclarationCollection(); * this.testClassDeclaration = new System.CodeDom.CodeTypeDeclaration(); * typeDeclarations.Add(this.testClassDeclaration);*/ testClassDeclaration.UserData[NStubConstants.UserDataClassTypeKey] = typeof(NStub.CSharp.Tests.Stubs.InfoApe); testClassDeclaration.Name = "NStub.CSharp.TopRootClass"; typeDeclarations.Add(this.testClassDeclaration); testClassDeclaration.UserData[NStubConstants.UserDataClassTypeKey] = typeof(NStub.CSharp.Tests.Stubs.InfoApe); testClassDeclaration.Name = "NStub.CSharp.BlaFasel.MyWorkClass"; this.namespaceDetector = new NStub.CSharp.NamespaceDetector(typeDeclarations); this.testObject = new CodeTypeSetup(this.namespaceDetector, buildData, this.testClassDeclaration); // testObject.SetUpCodeNamespace("NStub.CSharp", new[] { "System.F**k", "Rhino.Mocks" }); var expected = "MyWorkClass"; var actual = testObject.SetUpTestname(); Assert.AreEqual(expected, actual); Assert.AreEqual("NStub.CSharp.BlaFasel.MyWorkClass", testObject.BaseKey); Assert.AreEqual("MyWorkClassTest", testClassDeclaration.Name); // testObject.SetUpCodeNamespace("Jedzia.Loves.Testing", new[] { "System.F**k", "Rhino.Mocks" }); }
public void ConstructWithParametersNamespaceDetectorTestClassDeclarationTest() { this.testObject = new CodeTypeSetup(this.namespaceDetector, buildData, this.testClassDeclaration); Assert.Throws <ArgumentNullException>(() => new CodeTypeSetup(null, buildData, this.testClassDeclaration)); Assert.Throws <ArgumentNullException>(() => new CodeTypeSetup(this.namespaceDetector, null, this.testClassDeclaration)); Assert.Throws <ArgumentNullException>(() => new CodeTypeSetup(this.namespaceDetector, buildData, null)); }
public void SetUp() { buildData = new BuildDataDictionary(); this.typeDeclarations = new CodeTypeDeclarationCollection(); this.testClassDeclaration = new System.CodeDom.CodeTypeDeclaration(); typeDeclarations.Add(this.testClassDeclaration); this.namespaceDetector = new NStub.CSharp.NamespaceDetector(typeDeclarations); this.testObject = new CodeTypeSetup(this.namespaceDetector, buildData, this.testClassDeclaration); }
public void TearDown() { this.testObject = null; }