コード例 #1
0
        public void should_return_default_conventions()
        {
            var expression =
                new SetupExpression();

            expression.Get(typeof(FakeService)).ShouldBeOfType(typeof(DefaultConventions));
        }
コード例 #2
0
        public void should_throw_argumentnullexception()
        {
            var expression =
                new SetupExpression();

            var exception =
                Catch.Exception(() => expression.Get(null));

            exception.ShouldBeOfType(typeof(ArgumentNullException));
        }
コード例 #3
0
        public void should_return_new_default_conventions_for_unregistered_type()
        {
            var expression =
                new SetupExpression();

            expression.Use<FakeConventions>().AsDefault();

            var conventions =
                expression.Get(typeof(FakeService));

            conventions.ShouldBeOfType(typeof(FakeConventions));
        }
コード例 #4
0
        public void should_return_conventions_when_retrived()
        {
            var expression =
                new SetupExpression();

            expression.Use(() => new FakeConventions()).For<FakeService>();

            var conventions =
                expression.Get(typeof(FakeService));

            conventions.ShouldBeOfType(typeof(FakeConventions));
        }
コード例 #5
0
        public void should_return_registered_conventions()
        {
            var expression =
                new SetupExpression();

            expression.Use<FakeConventions>().For<FakeService>();

            var conventions =
                expression.Get(typeof(FakeService));

            conventions.ShouldBeOfType(typeof(FakeConventions));
        }