public void GetBinding_ReturnsSameBindingTypeAsODataModelBinderProvider() { HttpConfiguration config = new HttpConfiguration(); Type parameterType = typeof(Guid); Mock<ParameterInfo> parameterInfoMock = new Mock<ParameterInfo>(); parameterInfoMock.Setup(info => info.ParameterType).Returns(parameterType); ReflectedHttpParameterDescriptor parameter = new ReflectedHttpParameterDescriptor(); parameter.Configuration = config; parameter.ParameterInfo = parameterInfoMock.Object; HttpParameterBinding binding = new FromODataUriAttribute().GetBinding(parameter); ModelBinderParameterBinding modelBinding = Assert.IsType<ModelBinderParameterBinding>(binding); Assert.Equal(new ODataModelBinderProvider().GetBinder(config, parameterType).GetType(), modelBinding.Binder.GetType()); }
public void GetBinding_ReturnsSameBindingTypeAsODataModelBinderProvider() { HttpConfiguration config = new HttpConfiguration(); Type parameterType = typeof(Guid); Mock <ParameterInfo> parameterInfoMock = new Mock <ParameterInfo>(); parameterInfoMock.Setup(info => info.ParameterType).Returns(parameterType); ReflectedHttpParameterDescriptor parameter = new ReflectedHttpParameterDescriptor(); parameter.Configuration = config; parameter.ParameterInfo = parameterInfoMock.Object; HttpParameterBinding binding = new FromODataUriAttribute().GetBinding(parameter); ModelBinderParameterBinding modelBinding = Assert.IsType <ModelBinderParameterBinding>(binding); Assert.Equal(new ODataModelBinderProvider().GetBinder(config, parameterType).GetType(), modelBinding.Binder.GetType()); }