Exemple #1
0
        public void IsTestMethodReturnsTrueWhenMethodHasFullyQualifiedNUnitTestAttribute()
        {
            MockAttribute testAttribute = new MockAttribute("MbUnit.Framework.TestAttribute");
            MockMethod    mockMethod    = MockMethod.CreateMockMethodWithAttribute(testAttribute);

            Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
        }
Exemple #2
0
        public void IsTestMethodReturnsTrueWhenMethodHasTestAttributeAttribute()
        {
            MockAttribute testAttribute = new MockAttribute("TestAttribute");
            MockMethod    mockMethod    = MockMethod.CreateMockMethodWithAttribute(testAttribute);

            Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
        }
Exemple #3
0
        public void IsTestMember_MethodHasFullyQualifiedNUnitTestAttribute_ReturnsTrue()
        {
            CreateTestFramework();
            MockAttribute testAttribute = new MockAttribute("NUnit.Framework.TestAttribute");
            MockMethod    mockMethod    = MockMethod.CreateMockMethodWithAttribute(testAttribute);

            bool result = testFramework.IsTestMember(mockMethod);

            Assert.IsTrue(result);
        }
Exemple #4
0
        public void IsTestMember_MethodHasTestAttributeWithoutAttributePart_ReturnsTrue()
        {
            CreateTestFramework();
            MockAttribute testAttribute = new MockAttribute("Test");
            MockMethod    mockMethod    = MockMethod.CreateMockMethodWithAttribute(testAttribute);

            bool result = testFramework.IsTestMember(mockMethod);

            Assert.IsTrue(result);
        }
Exemple #5
0
        public void IsTestMethodReturnsTrueWhenProjectIsNull()
        {
            MockAttribute      testAttribute      = new MockAttribute("Test");
            MockMethod         mockMethod         = MockMethod.CreateMockMethodWithAttribute(testAttribute);
            MockProjectContent mockProjectContent = (MockProjectContent)mockMethod.DeclaringType.ProjectContent;

            mockProjectContent.Project = null;

            Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
        }
Exemple #6
0
        public void IsTestMethodReturnsFalseWhenMethodHasHasParameters()
        {
            MockAttribute testAttribute = new MockAttribute("Test");
            MockMethod    mockMethod    = MockMethod.CreateMockMethodWithAttribute(testAttribute);
            MockParameter mockParameter = new MockParameter();

            mockMethod.Parameters.Add(mockParameter);

            Assert.IsFalse(testFramework.IsTestMethod(mockMethod));
        }
Exemple #7
0
        public void Init()
        {
            MockAttribute testAttribute = new MockAttribute("Test");

            methodWithTestAttribute = MockMethod.CreateMockMethodWithAttribute(testAttribute);
            memberNodeForMethodWithTestAttribute = new MockMemberNode(methodWithTestAttribute);

            testFrameworks = new MockRegisteredTestFrameworks();
            testFrameworks.AddTestMethod(methodWithTestAttribute);

            testableCondition = new TestableCondition(testFrameworks);
        }
Exemple #8
0
        public void IsTestMember_MethodHasParameters_ReturnsFalse()
        {
            CreateTestFramework();
            var        testAttribute = new MockAttribute("Test");
            MockMethod mockMethod    = MockMethod.CreateMockMethodWithAttribute(testAttribute);
            var        mockParameter = new MockParameter();

            mockMethod.Parameters.Add(mockParameter);

            bool result = testFramework.IsTestMember(mockMethod);

            Assert.IsFalse(result);
        }
Exemple #9
0
        public void IsTestMember_ProjectIsNull_ReturnsTrue()
        {
            CreateTestFramework();
            var                testAttribute      = new MockAttribute("Test");
            MockMethod         mockMethod         = MockMethod.CreateMockMethodWithAttribute(testAttribute);
            MockProjectContent mockProjectContent = (MockProjectContent)mockMethod.DeclaringType.ProjectContent;

            mockProjectContent.Project = null;

            bool result = testFramework.IsTestMember(mockMethod);

            Assert.IsTrue(result);
        }
 public void Init()
 {
     firstAttribute = new MockAttribute("first");
     mockMethod     = MockMethod.CreateMockMethodWithAttribute(firstAttribute);
 }