public void AddAfter_should_throw_when_after_convention_not_found()
        {
            var mockConvention = new Mock<IConvention>();
            var conventionsConfiguration = new ConventionsConfiguration();

            Assert.Equal(Strings.ConventionNotFound(mockConvention.Object.GetType(), typeof(ConventionFixture)), Assert.Throws<InvalidOperationException>(() => conventionsConfiguration.AddAfter<ConventionFixture>(mockConvention.Object)).Message);
        }
        public void AddAfter_should_add_after_existing_convention()
        {
            var mockConvention = new Mock<IConvention>();
            var conventionsConfiguration = new ConventionsConfiguration(new[] { new ConventionFixture() });

            conventionsConfiguration.AddAfter<ConventionFixture>(mockConvention.Object);

            Assert.Equal(2, conventionsConfiguration.Conventions.Count());
            Assert.Same(mockConvention.Object, conventionsConfiguration.Conventions.Last());
        }
        public void AddAfter_should_throw_when_after_convention_not_found()
        {
            var mockConvention           = new Mock <IConvention>();
            var conventionsConfiguration = new ConventionsConfiguration();

            Assert.Equal(
                Strings.ConventionNotFound(mockConvention.Object.GetType(), typeof(ConventionFixture)),
                Assert.Throws <InvalidOperationException>(() => conventionsConfiguration.AddAfter <ConventionFixture>(mockConvention.Object)).
                Message);
        }
        public void AddAfter_should_add_after_existing_convention()
        {
            var mockConvention           = new Mock <IConvention>();
            var conventionsConfiguration = new ConventionsConfiguration(new[] { new ConventionFixture() });

            conventionsConfiguration.AddAfter <ConventionFixture>(mockConvention.Object);

            Assert.Equal(2, conventionsConfiguration.Conventions.Count());
            Assert.Same(mockConvention.Object, conventionsConfiguration.Conventions.Last());
        }