public virtual void TestDiscoveringRelationshipsBetweenTypes()
        {
            _dependencyExplorer.Requires(typeof(A), typeof(B)).Should().BeTrue();
            _dependencyExplorer.Requires(typeof(B), typeof(A)).Should().BeFalse();

            _dependencyExplorer.Requires(typeof(C), typeof(A)).Should().BeTrue();
            _dependencyExplorer.Requires(typeof(C), typeof(B)).Should().BeTrue();
            _dependencyExplorer.Requires(typeof(B), typeof(C)).Should().BeFalse();
            _dependencyExplorer.Requires(typeof(A), typeof(C)).Should().BeFalse();

            _dependencyExplorer.Requires(typeof(D), typeof(A)).Should().BeTrue();
            _dependencyExplorer.Requires(typeof(D), typeof(B)).Should().BeTrue();
            _dependencyExplorer.Requires(typeof(D), typeof(C)).Should().BeTrue();
            _dependencyExplorer.Requires(typeof(D), typeof(E)).Should().BeFalse();
        }
        public void Should_Handle_Adapted_Steps_Requirements()
        {
            var requiredAdapter  = new StepAdapter <ITestContext>(new RequiredAdaptedStep());
            var dependentAdapter = new StepAdapter <ITestContext>(new DependentAdaptedStep());

            _dependencyExplorer.Requires(dependentAdapter.GetStepType(),
                                         requiredAdapter.GetStepType())
            .Should().BeTrue("adapted steps has dependency defined");

            _dependencyExplorer.Requires(dependentAdapter.GetStepType(),
                                         new RequiredNotAdaptedStep().GetStepType())
            .Should().BeTrue();

            _dependencyExplorer.Requires(new DependentNotAdaptedStep().GetStepType(), requiredAdapter.GetStepType())
            .Should().BeTrue();

            _dependencyExplorer.HasRequired(dependentAdapter.GetStepType()).Should().BeTrue();
        }
Beispiel #3
0
 private bool RequiresDependency(Step <TCtx> step, Step <TCtx> s)
 {
     return(_dependencyExplorer.Requires(step.GetStepType(), s.GetStepType()));
 }
 private bool HasDependency(T from, T to)
 {
     return(_dependencyExplorer.Requires(from.GetType(), to.GetType()));
 }