public void IsTestMethodReturnsTrueWhenMethodHasFullyQualifiedNUnitTestAttribute() { MockAttribute testAttribute = new MockAttribute("MbUnit.Framework.TestAttribute"); MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); Assert.IsTrue(testFramework.IsTestMethod(mockMethod)); }
public void IsTestMethodReturnsTrueWhenMethodHasTestAttributeAttribute() { MockAttribute testAttribute = new MockAttribute("TestAttribute"); MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); Assert.IsTrue(testFramework.IsTestMethod(mockMethod)); }
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); }
public void IsTestMember_MethodHasTestAttributeWithoutAttributePart_ReturnsTrue() { CreateTestFramework(); MockAttribute testAttribute = new MockAttribute("Test"); MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); bool result = testFramework.IsTestMember(mockMethod); Assert.IsTrue(result); }
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)); }
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)); }
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); }
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); }
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); }