예제 #1
0
        public void controller_should_return_existing_controller_builder_conventions_for_type()
        {
            // arrange
            var builder = new ODataQueryOptionsConventionBuilder();
            var originalControllerBuilder = builder.Controller(typeof(StubController));

            // act
            var controllerBuilder = builder.Controller(typeof(StubController));

            // assert
            controllerBuilder.Should().BeSameAs(originalControllerBuilder);
        }
예제 #2
0
        public void controller_for_type_should_not_allow_both_compileX2Dtime_and_runX2Dtime_conventions()
        {
            // arrange
            var builder = new ODataQueryOptionsConventionBuilder();

            builder.Controller(typeof(StubController));

            // act
            Action controllerConvention = () => builder.Controller <StubController>();

            // assert
            controllerConvention.Should().Throw <InvalidOperationException>();
        }