Implementation of a data class used to create new unit tests.
Inheritance: MemberBuildContextBase
Exemplo n.º 1
0
        public void ConstructWithAnyParameterIsNullShouldThrow()
        {
            Assert.Throws<ArgumentNullException>(
                () => this.testObject = new MemberBuildContext(
                                            null,
                                            this.testClassDeclaration,
                                            this.typeMember,
                                            this.buildData,
                                            this.setUpTearDownContext, TheKey));

            Assert.Throws<ArgumentNullException>(
                () => this.testObject = new MemberBuildContext(
                                            this.codeNamespace,
                                            null,
                                            this.typeMember,
                                            this.buildData,
                                            this.setUpTearDownContext, TheKey));

            Assert.Throws<ArgumentNullException>(
                () => this.testObject = new MemberBuildContext(
                                            this.codeNamespace,
                                            this.testClassDeclaration,
                                            null,
                                            this.buildData,
                                            this.setUpTearDownContext, TheKey));

            Assert.Throws<ArgumentNullException>(
                () => this.testObject = new MemberBuildContext(
                                            this.codeNamespace,
                                            this.testClassDeclaration,
                                            this.typeMember,
                                            null,
                                            this.setUpTearDownContext, TheKey));

            Assert.Throws<ArgumentNullException>(
                () => this.testObject = new MemberBuildContext(
                                            this.codeNamespace,
                                            this.testClassDeclaration,
                                            this.typeMember,
                                            this.buildData,
                                            null, TheKey));
            Assert.Throws<ArgumentNullException>(
                () => this.testObject = new MemberBuildContext(
                                            this.codeNamespace,
                                            this.testClassDeclaration,
                                            this.typeMember,
                                            this.buildData,
                                            this.setUpTearDownContext, null));
        }
Exemplo n.º 2
0
 public void ConstructWithParametersCodeNamespaceTestClassDeclarationTypeMemberBuildDataSetUpTearDownContextTest(
     )
 {
     // TODO: Implement unit test for ConstructWithParametersCodeNamespaceTestClassDeclarationTypeMemberBuildDataSetUpTearDownContext
     this.codeNamespace = new CodeNamespace();
     this.testClassDeclaration = new CodeTypeDeclaration();
     this.typeMember = new CodeTypeMember();
     this.buildData = new BuildDataDictionary();
     this.testObject = new MemberBuildContext(
         this.codeNamespace,
         this.testClassDeclaration,
         this.typeMember,
         this.buildData,
         this.setUpTearDownContext, TheKey);
 }
Exemplo n.º 3
0
        public void SetUp()
        {
            this.codeNamespace = new CodeNamespace();
            this.testClassDeclaration = new CodeTypeDeclaration();
            this.typeMember = new CodeTypeMember();

            // MethodInfo methodInfo = this.GetType().GetMethod("SetUp");
            // typeMember.UserData[NStubConstants.TestMemberMethodInfoKey] = methodInfo;
            this.buildData = new BuildDataDictionary();
            this.mocks = new MockRepository();
            this.setUpTearDownContext = this.mocks.StrictMock<ISetupAndTearDownContext>();
            this.testObject = new MemberBuildContext(
                this.codeNamespace,
                this.testClassDeclaration,
                this.typeMember,
                this.buildData,
                this.setUpTearDownContext, TheKey);
        }
Exemplo n.º 4
0
 public void TearDown()
 {
     this.testObject = null;
 }
Exemplo n.º 5
0
        public void PropertyIsConstructorNormalBehavior()
        {
            // Test read access of 'IsConstructor' Property.
            this.mocks.ReplayAll();
            var expected = false;
            var actual = this.testObject.IsConstructor;
            Assert.AreEqual(expected, actual);
            this.mocks.VerifyAll();

            this.typeMember = new CodeConstructor();
            this.testObject = this.mocks.StrictMock<MemberBuildContext>(
                this.codeNamespace,
                this.testClassDeclaration,
                this.typeMember,
                this.buildData,
                this.setUpTearDownContext, TheKey);
            this.mocks.ReplayAll();
            expected = true;
            actual = this.testObject.IsConstructor;
            Assert.AreEqual(expected, actual);
            this.mocks.VerifyAll();
        }