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 SetUpTestnameThrowsWithoutInit() { Assert.Throws <KeyNotFoundException>(() => testObject.SetUpTestname()); }