Exemplo n.º 1
0
        public void Copy_replicates_source()
        {
            var column1 
                = new Column("Foo", typeof(string))
                    {
                        DataType = "T",
                        IsNullable = false,
                        DefaultValue = "V",
                        DefaultSql = "Sql",
                        ValueGenerationStrategy = ValueGenerationOnSave.WhenInsertingAndUpdating,
                        IsTimestamp = true,
                        MaxLength = 4,
                        Precision = 3,
                        Scale = 2,
                        IsFixedLength = true,
                        IsUnicode = true
                    };
            var column2 = new Column("Bar", typeof(int));

            column2.Copy(column1);

            Assert.Equal("Foo", column2.Name);
            Assert.Same(typeof(string), column2.ClrType);
            Assert.Equal("T", column2.DataType);
            Assert.Equal("V", column2.DefaultValue);
            Assert.Equal("Sql", column2.DefaultSql);
            Assert.Equal(ValueGenerationOnSave.WhenInsertingAndUpdating, column2.ValueGenerationStrategy);
            Assert.True(column2.IsTimestamp);
            Assert.Equal(4, column2.MaxLength.Value);
            Assert.Equal(3, column2.Precision.Value);
            Assert.Equal(2, column2.Scale.Value);
            Assert.True(column2.IsFixedLength.Value);
            Assert.True(column2.IsUnicode.Value);
        }