public void BindingParameterConfigurationThrowsWhenParameterTypeIsNotEntity()
        { 
            // Arrange
            ODataModelBuilder builder = new ODataModelBuilder();
            builder.ComplexType<Address>();

            // Act & Assert
            ArgumentException exception = Assert.Throws<ArgumentException>(() =>
            {
                BindingParameterConfiguration configuration = new BindingParameterConfiguration("name", builder.GetTypeConfigurationOrNull(typeof(Address)));
            });
            Assert.True(exception.Message.Contains(string.Format("'{0}'", typeof(Address).FullName)));
            Assert.Equal("parameterType", exception.ParamName);
        }
        public void BindingParameterConfigurationThrowsWhenParameterTypeIsNotEntity()
        {
            // Arrange
            ODataModelBuilder builder = new ODataModelBuilder();

            builder.ComplexType <Address>();

            // Act & Assert
            ArgumentException exception = Assert.Throws <ArgumentException>(() =>
            {
                BindingParameterConfiguration configuration = new BindingParameterConfiguration("name", builder.GetTypeConfigurationOrNull(typeof(Address)), true);
            });

            Assert.True(exception.Message.Contains(string.Format("'{0}'", typeof(Address).FullName)));
            Assert.Equal("parameterType", exception.ParamName);
        }
Пример #3
0
 /// <summary>
 /// Specifies the bindingParameter name, type and whether it is alwaysBindable, use only if the procedure "isBindable".
 /// </summary>
 internal void SetBindingParameterImplementation(string name, IEdmTypeConfiguration bindingParameterType)
 {
     _bindingParameter = new BindingParameterConfiguration(name, bindingParameterType);
 }