public void Should_Leave_Delegates_In_Place()
        {
            var b  = new B();
            var d1 = new ServiceConventionDelegate(x => { });
            var d2 = new ServiceConventionDelegate(x => { });
            var d3 = new ServiceConventionDelegate(x => { });
            var c  = new C();
            var d  = new D();
            var e  = new E();
            var f  = new F();

            var provider = new ConventionProvider(
                new IConvention[] { b, c },
                new object[] { d1, d, d2 },
                new object[] { e, d3, f }
                );

            provider.GetAll()
            .Select(x => x.Convention as object ?? x.Delegate)
            .Should()
            .ContainInOrder(
                d1,
                e,
                d,
                d2,
                b,
                c,
                d3,
                f
                );
        }
        public void Should_Include_Unit_Test_Conventions()
        {
            var b  = new B();
            var d1 = new ServiceConventionDelegate(x => { });
            var d2 = new ServiceConventionDelegate(x => { });
            var d3 = new ServiceConventionDelegate(x => { });
            var c  = new C();
            var d  = new D();
            var e  = new E();
            var f  = new F();

            var provider = new ConventionProvider(
                new IConvention[] { b, c },
                new object[] { d1, d, d2 },
                new object[] { e, d3, f }
                );

            provider.GetAll(HostType.UnitTestHost)
            .Select(x => x.Convention as object ?? x.Delegate)
            .Should()
            .ContainInOrder(
                d1,
                e,
                d,
                d2,
                b,
                c,
                d3
                );
        }
        public void Should_Throw_When_A_Cycle_Is_Detected()
        {
            var c1 = new Cyclic1();
            var c2 = new Cyclic2();

            var provider = new ConventionProvider(
                new IConvention[] { c1, c2 },
                Array.Empty <object>(),
                Array.Empty <object>()
                );

            Action a = () => provider.GetAll();

            a.Should().Throw <NotSupportedException>();
        }
        public void Should_Not_Affect_Default_Sort_Order()
        {
            var b = new B();
            var c = new C();
            var d = new D();
            var e = new E();
            var f = new F();

            var provider = new ConventionProvider(
                new IConvention[] { b, c },
                new object[] { d },
                new object[] { e, f }
                );

            provider.GetAll()
            .Select(x => x.Convention as object ?? x.Delegate)
            .Should()
            .ContainInOrder(e, d, b, c, f);
        }
        public void Should_Sort_Conventions_Correctly()
        {
            var b = new B();
            var c = new C();
            var d = new D();
            var e = new E();
            var f = new F();

            var provider = new ConventionProvider(
                new IConvention[] { b, c },
                new object[] { d, f },
                new object[] { e }
                );

            provider.GetAll()
            .Select(x => x.Convention as object ?? x.Delegate)
            .Should()
            .ContainInOrder(e, d, f, b, c);
        }