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

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

            Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
 }