|
|
|
@ -3,6 +3,7 @@
@@ -3,6 +3,7 @@
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using ICSharpCode.RubyBinding; |
|
|
|
|
using ICSharpCode.SharpDevelop.Dom; |
|
|
|
|
using NUnit.Framework; |
|
|
|
|
using RubyBinding.Tests.Utils; |
|
|
|
|
using UnitTesting.Tests.Utils; |
|
|
|
@ -14,32 +15,54 @@ namespace RubyBinding.Tests.Testing
@@ -14,32 +15,54 @@ namespace RubyBinding.Tests.Testing
|
|
|
|
|
{ |
|
|
|
|
RubyTestFramework testFramework; |
|
|
|
|
|
|
|
|
|
[SetUp] |
|
|
|
|
public void Init() |
|
|
|
|
void CreateTestFramework() |
|
|
|
|
{ |
|
|
|
|
testFramework = new RubyTestFramework(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void IsTestMemberReturnsTrueForMethodThatStartsWithTest() |
|
|
|
|
public void IsTestMember_MethodThatStartsWithTest_ReturnsTrue() |
|
|
|
|
{ |
|
|
|
|
CreateTestFramework(); |
|
|
|
|
MockClass c = MockClass.CreateMockClassWithoutAnyAttributes(); |
|
|
|
|
MockMethod method = new MockMethod(c, "testRunThis"); |
|
|
|
|
Assert.IsTrue(testFramework.IsTestMember(method)); |
|
|
|
|
var method = new MockMethod(c, "testRunThis"); |
|
|
|
|
|
|
|
|
|
bool result = testFramework.IsTestMember(method); |
|
|
|
|
|
|
|
|
|
Assert.IsTrue(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void IsTestMemberReturnsFalseForNull() |
|
|
|
|
public void IsTestMember_NullPassed_ReturnsFalse() |
|
|
|
|
{ |
|
|
|
|
Assert.IsFalse(testFramework.IsTestMember(null)); |
|
|
|
|
CreateTestFramework(); |
|
|
|
|
bool result = testFramework.IsTestMember(null); |
|
|
|
|
|
|
|
|
|
Assert.IsFalse(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void IsTestMemberReturnsFalseForMethodThatDoesNotStartWithTest() |
|
|
|
|
public void IsTestMember_MethodThatDoesNotStartWithTest_ReturnsFalse() |
|
|
|
|
{ |
|
|
|
|
CreateTestFramework(); |
|
|
|
|
MockClass c = MockClass.CreateMockClassWithoutAnyAttributes(); |
|
|
|
|
MockMethod method = new MockMethod(c, "RunThis"); |
|
|
|
|
Assert.IsFalse(testFramework.IsTestMember(method)); |
|
|
|
|
var method = new MockMethod(c, "RunThis"); |
|
|
|
|
|
|
|
|
|
bool result = testFramework.IsTestMember(method); |
|
|
|
|
|
|
|
|
|
Assert.IsFalse(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void IsTestMember_FieldThatStartsWithTest_ReturnsFalse() |
|
|
|
|
{ |
|
|
|
|
CreateTestFramework(); |
|
|
|
|
MockClass c = MockClass.CreateMockClassWithoutAnyAttributes(); |
|
|
|
|
var field = new DefaultField(c, "testField"); |
|
|
|
|
|
|
|
|
|
bool result = testFramework.IsTestMember(field); |
|
|
|
|
|
|
|
|
|
Assert.IsFalse(result); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|