コード例 #1
0
ファイル: CodeTypeSetupTest.cs プロジェクト: ubik/NStub
        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" });
        }
コード例 #2
0
ファイル: CodeTypeSetupTest.cs プロジェクト: ubik/NStub
        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));
        }
コード例 #3
0
ファイル: CodeTypeSetupTest.cs プロジェクト: ubik/NStub
        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);
        }
コード例 #4
0
ファイル: CodeTypeSetupTest.cs プロジェクト: ubik/NStub
 public void TearDown()
 {
     this.testObject = null;
 }