System.Data.Tests.DataTableTest.PropertyExceptions C# (CSharp) Метод

PropertyExceptions() приватный Метод

private PropertyExceptions ( ) : void
Результат void
        public void PropertyExceptions()
        {
            CultureInfo orig = CultureInfo.CurrentCulture;
            try
            {
                CultureInfo.CurrentCulture = new CultureInfo("en-US");
                DataSet set = new DataSet();
                DataTable table = new DataTable();
                DataTable table1 = new DataTable();
                set.Tables.Add(table);
                set.Tables.Add(table1);

                DataColumn col = new DataColumn();
                col.ColumnName = "Id";
                col.DataType = typeof(int);
                table.Columns.Add(col);
                UniqueConstraint uc = new UniqueConstraint("UK1", table.Columns[0]);
                table.Constraints.Add(uc);
                table.CaseSensitive = false;

                col = new DataColumn();
                col.ColumnName = "Name";
                col.DataType = typeof(string);
                table.Columns.Add(col);

                col = new DataColumn();
                col.ColumnName = "Id";
                col.DataType = typeof(int);
                table1.Columns.Add(col);
                col = new DataColumn();
                col.ColumnName = "Name";
                col.DataType = typeof(string);
                table1.Columns.Add(col);

                DataRelation dr = new DataRelation("DR", table.Columns[0], table1.Columns[0]);
                set.Relations.Add(dr);

                try
                {
                    table.CaseSensitive = true;
                    table1.CaseSensitive = true;
                    Assert.False(true);
                }
                catch (ArgumentException)
                {
                }

                try
                {
                    CultureInfo cultureInfo = new CultureInfo("en-gb");
                    table.Locale = cultureInfo;
                    table1.Locale = cultureInfo;
                    Assert.False(true);
                }
                catch (ArgumentException)
                {
                }

                try
                {
                    table.Prefix = "Prefix#1";
                    Assert.False(true);
                }
                catch (DataException)
                {
                }
            }
            finally
            {
                CultureInfo.CurrentCulture = orig;
            }
        }
DataTableTest