|
|
@ -11,24 +11,21 @@ using System.Collections.Generic; |
|
|
|
using developwithpassion.specifications.rhinomocks; |
|
|
|
using developwithpassion.specifications.rhinomocks; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
using Machine.Specifications; |
|
|
|
using Machine.Specifications; |
|
|
|
|
|
|
|
using ICSharpCode.UnitTesting; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Dom; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.MachineSpecifications.Tests |
|
|
|
namespace ICSharpCode.MachineSpecifications.Tests |
|
|
|
{ |
|
|
|
{ |
|
|
|
public abstract class MSpecTestFrameworkConcern : Observes<MSpecTestFramework> { |
|
|
|
|
|
|
|
protected static void EstablishContext() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static IProject testProject; |
|
|
|
|
|
|
|
protected static IProject nonTestProject; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Subject(typeof(MSpecTestFramework))] |
|
|
|
[Subject(typeof(MSpecTestFramework))] |
|
|
|
public class When_checking_if_is_a_test_project : MSpecTestFrameworkConcern { |
|
|
|
public class When_checking_if_is_a_test_project : Observes<MSpecTestFramework> |
|
|
|
static bool resultForTestProject; |
|
|
|
{ |
|
|
|
|
|
|
|
static IProject testProject; |
|
|
|
|
|
|
|
static IProject nonTestProject; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool resultForTestProject; |
|
|
|
static bool resultForNonTestProject; |
|
|
|
static bool resultForNonTestProject; |
|
|
|
|
|
|
|
|
|
|
|
Establish ctx = EstablishContext; |
|
|
|
Establish ctx; |
|
|
|
|
|
|
|
|
|
|
|
Because of = () => { |
|
|
|
Because of = () => { |
|
|
|
resultForTestProject = sut.IsTestProject(testProject); |
|
|
|
resultForTestProject = sut.IsTestProject(testProject); |
|
|
@ -41,4 +38,34 @@ namespace ICSharpCode.MachineSpecifications.Tests |
|
|
|
It should_return_false_for_project_which_has_no_reference_to_test_framework = () => |
|
|
|
It should_return_false_for_project_which_has_no_reference_to_test_framework = () => |
|
|
|
resultForNonTestProject.ShouldBeFalse(); |
|
|
|
resultForNonTestProject.ShouldBeFalse(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Subject(typeof(MSpecTestFramework))] |
|
|
|
|
|
|
|
public class When_checking_if_is_a_test_class : Observes<MSpecTestFramework> |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
static IClass classWithoutSpecificationMembers; |
|
|
|
|
|
|
|
static IClass classWithSpecificationMembers; |
|
|
|
|
|
|
|
static IClass classWithSpecificationMembersAndBehaviorAttribute; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool resultForClassWithBehaviorAttribute; |
|
|
|
|
|
|
|
static bool resultForClassWithSpecifications; |
|
|
|
|
|
|
|
static bool resultForClassWithoutSpecifications; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Establish ctx; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Because of = () => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
resultForClassWithoutSpecifications = sut.IsTestClass(classWithoutSpecificationMembers); |
|
|
|
|
|
|
|
resultForClassWithSpecifications = sut.IsTestClass(classWithSpecificationMembers); |
|
|
|
|
|
|
|
resultForClassWithBehaviorAttribute = sut.IsTestClass(classWithSpecificationMembersAndBehaviorAttribute); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It should_return_false_for_class_without_specification_members = () => |
|
|
|
|
|
|
|
resultForClassWithoutSpecifications.ShouldBeFalse(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It should_return_true_for_class_with_specification_members = () => |
|
|
|
|
|
|
|
resultForClassWithSpecifications.ShouldBeTrue(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It should_return_false_for_class_with_behavior_attribute = () => |
|
|
|
|
|
|
|
resultForClassWithBehaviorAttribute.ShouldBeFalse(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |