public void should_map_controller_should_return_expected_result_for_controller_version(int majorVersion, bool expected) { // arrange var configuration = new HttpConfiguration(); var controller = new HttpControllerDescriptor(configuration, string.Empty, typeof(ControllerV1)); var convention = new VersionedAttributeRoutingConvention("Tests", configuration, new ApiVersion(majorVersion, 0)); // act var result = convention.ShouldMapController(controller); // assert result.Should().Be(expected); }
public void should_map_controller_should_return_true_for_versionX2Dneutral_controller() { // arrange var configuration = new HttpConfiguration(); var controller = new HttpControllerDescriptor(configuration, string.Empty, typeof(NeutralController)); var convention = new VersionedAttributeRoutingConvention("Tests", configuration, new ApiVersion(1, 0)); // act var result = convention.ShouldMapController(controller); // assert result.Should().BeTrue(); }
public void should_map_controller_should_return_expected_result_for_controller_version(int majorVersion, bool expected) { // arrange var model = new ODataModelBuilder().GetEdmModel(); var controller = new HttpControllerDescriptor(new HttpConfiguration(), string.Empty, typeof(ControllerV1)); var convention = new VersionedAttributeRoutingConvention(model, new HttpControllerDescriptor[0]); model.SetAnnotationValue(model, new ApiVersion(majorVersion, 0)); // act var result = convention.ShouldMapController(controller); // assert result.Should().Be(expected); }
public void should_map_controller_should_return_true_for_versionX2Dneutral_controller() { // arrange var model = new ODataModelBuilder().GetEdmModel(); var controller = new HttpControllerDescriptor(new HttpConfiguration(), string.Empty, typeof(NeutralController)); var convention = new VersionedAttributeRoutingConvention(model, new HttpControllerDescriptor[0]); model.SetAnnotationValue(model, new ApiVersion(1, 0)); // act var result = convention.ShouldMapController(controller); // assert result.Should().BeTrue(); }