public void HasName_should_set_name_on_underlying_configuration()
        {
            var configuration = new UpdateModificationFunctionConfiguration<Entity>();

            configuration.HasName("Foo");

            Assert.Equal("Foo", configuration.Configuration.Name);
        }
        public void RowsAffectedParameter_should_set_column_name()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            configuration.RowsAffectedParameter("Foo");

            Assert.Equal("Foo", configuration.Configuration.RowsAffectedParameterName);
        }
        public void HasName_should_set_name_on_underlying_configuration()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            configuration.HasName("Foo");

            Assert.Equal("Foo", configuration.Configuration.Name);
        }
        public void Association_when_reference_should_throw_when_complex_property_expression()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            Assert.Equal(
                Strings.InvalidPropertyExpression("e => e.Parent.Parent"),
                Assert.Throws <InvalidOperationException>(
                    () => configuration.Association <Entity>(e => e.Parent.Parent, c => { })).Message);
        }
        public void Association_when_reference_should_invoke_action_with_configuration()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            AssociationModificationFunctionConfiguration <Entity> associationConfiguration = null;

            configuration.Association <Entity>(e => e.Parent, c => { associationConfiguration = c; });

            Assert.NotNull(associationConfiguration);
        }
        public void Result_should_return_parent_configuration_for_valid_property_expressions()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            Assert.Same(configuration, configuration.Result(e => e.Int, "Foo"));
            Assert.Same(configuration, configuration.Result(e => e.Nullable, "Foo"));
            Assert.Same(configuration, configuration.Result(e => e.String, "Foo"));
            Assert.Same(configuration, configuration.Result(e => e.Bytes, "Foo"));
            Assert.Same(configuration, configuration.Result(e => e.Geography, "Foo"));
            Assert.Same(configuration, configuration.Result(e => e.Geometry, "Foo"));
        }
        public void Parameter_should_return_configuration_for_valid_property_expressions()
        {
            var configuration = new UpdateModificationFunctionConfiguration<Entity>();

            Assert.Same(configuration, configuration.Parameter(e => e.Int, "Foo"));
            Assert.Same(configuration, configuration.Parameter(e => e.Nullable, "Foo"));
            Assert.Same(configuration, configuration.Parameter(e => e.String, "Foo"));
            Assert.Same(configuration, configuration.Parameter(e => e.Bytes, "Foo"));
            Assert.Same(configuration, configuration.Parameter(e => e.Geography, "Foo"));
            Assert.Same(configuration, configuration.Parameter(e => e.Geometry, "Foo"));
            Assert.Same(configuration, configuration.Parameter(e => e.ComplexType.Int, "Foo"));
        }
        public void Parameter_should_return_configuration_for_valid_property_expressions_when_original_values()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            Assert.Same(configuration, configuration.Parameter(e => e.Int, "Foo", "Bar"));
            Assert.Same(configuration, configuration.Parameter(e => e.Nullable, "Foo", "Bar"));
            Assert.Same(configuration, configuration.Parameter(e => e.String, "Foo", "Bar"));
            Assert.Same(configuration, configuration.Parameter(e => e.Bytes, "Foo", "Bar"));
            Assert.Same(configuration, configuration.Parameter(e => e.Geography, "Foo", "Bar"));
            Assert.Same(configuration, configuration.Parameter(e => e.Geometry, "Foo", "Bar"));
            Assert.Same(configuration, configuration.Parameter(e => e.ComplexType.Int, "Foo", "Bar"));
        }
        public void Association_when_reference_should_throw_when_complex_property_expression()
        {
            var configuration = new UpdateModificationFunctionConfiguration<Entity>();

            Assert.Equal(
                Strings.InvalidPropertyExpression("e => e.Parent.Parent"),
                Assert.Throws<InvalidOperationException>(
                    () => configuration.Association<Entity>(e => e.Parent.Parent, c => { })).Message);
        }
        public void Association_when_reference_should_invoke_action_with_configuration()
        {
            var configuration = new UpdateModificationFunctionConfiguration<Entity>();

            AssociationModificationFunctionConfiguration<Entity> associationConfiguration = null;

            configuration.Association<Entity>(e => e.Parent, c => { associationConfiguration = c; });

            Assert.NotNull(associationConfiguration);
        }
        public void RowsAffectedParameter_should_set_column_name()
        {
            var configuration = new UpdateModificationFunctionConfiguration<Entity>();

            configuration.RowsAffectedParameter("Foo");

            Assert.Equal("Foo", configuration.Configuration.RowsAffectedParameterName);
        }
        public void Result_should_throw_when_complex_property_expressions()
        {
            var configuration = new UpdateModificationFunctionConfiguration<Entity>();

            Assert.Throws<InvalidOperationException>(() => configuration.Result(e => e.ComplexType.Int, "Foo"));
        }
        public void Result_should_throw_when_complex_property_expressions()
        {
            var configuration = new UpdateModificationFunctionConfiguration <Entity>();

            Assert.Throws <InvalidOperationException>(() => configuration.Result(e => e.ComplexType.Int, "Foo"));
        }