diff --git a/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs b/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs index 8862a85e5c377..2537fb30e95db 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs @@ -15,6 +15,7 @@ public sealed class TestProviderFactory : DbProviderFactory private TestProviderFactory() { } } + [PlatformSpecific(~TestPlatforms.Browser)] public class DbProviderFactoriesTests { [Fact] diff --git a/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoryTest.cs b/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoryTest.cs index 9393016bc51f9..b810686ab4f72 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoryTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoryTest.cs @@ -6,6 +6,7 @@ namespace System.Data.Tests.Common { + [PlatformSpecific(~TestPlatforms.Browser)] public class DbProviderFactoryTest { [Fact] diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataRowTest2.cs b/src/libraries/System.Data.Common/tests/System/Data/DataRowTest2.cs index 7369c85886694..bfb22d111550f 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataRowTest2.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataRowTest2.cs @@ -1894,7 +1894,7 @@ public void IsNull_ByIndex() Assert.True(dr.IsNull(1)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void IsNull_ByName() { DataTable dt = new DataTable(); diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetInferXmlSchemaTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetInferXmlSchemaTest.cs index b953a5d3616c6..5bf2ef00533a8 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetInferXmlSchemaTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetInferXmlSchemaTest.cs @@ -246,7 +246,7 @@ public void SimpleElementTable() DataSetAssertion.AssertDataColumn("col3", dt.Columns[2], "col3", true, false, 0, 1, "col3", MappingType.Element, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, 2, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void SimpleDataSet() { DataSet ds = GetDataSet(_xml8, null); @@ -337,7 +337,7 @@ public void SignificantWhitespaceIgnored2() DataSetAssertion.AssertDataSet("pure_whitespace", ds, "root", 0, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TwoElementTable() { // FIXME: Also test ReadXml (, XmlReadMode.InferSchema) and @@ -356,7 +356,7 @@ public void TwoElementTable() DataSetAssertion.AssertDataColumn("col2_2", dt.Columns[1], "col2_2", true, false, 0, 1, "col2_2", MappingType.Element, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ConflictSimpleComplexColumns() { DataSet ds = GetDataSet(_xml18, null); @@ -377,7 +377,7 @@ public void ConflictSimpleComplexColumns() DataSetAssertion.AssertForeignKeyConstraint("fkey", dr.ChildKeyConstraint, "table_col", AcceptRejectRule.None, Rule.Cascade, Rule.Cascade, new string[] { "table_Id" }, new string[] { "table_Id" }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ConflictColumnTable() { DataSet ds = GetDataSet(_xml19, null); @@ -398,7 +398,7 @@ public void ConflictColumnTable() DataSetAssertion.AssertForeignKeyConstraint("fkey", dr.ChildKeyConstraint, "table_col", AcceptRejectRule.None, Rule.Cascade, Rule.Cascade, new string[] { "table_Id" }, new string[] { "table_Id" }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ConflictColumnTableAttribute() { // Conflicts between a column and a table, additionally an attribute. @@ -421,7 +421,7 @@ public void ConflictColumnTableAttribute() DataSetAssertion.AssertForeignKeyConstraint("fkey", dr.ChildKeyConstraint, "table_col", AcceptRejectRule.None, Rule.Cascade, Rule.Cascade, new string[] { "table_Id" }, new string[] { "table_Id" }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ConflictAttributeDataTable() { Assert.Throws(() => @@ -433,7 +433,7 @@ public void ConflictAttributeDataTable() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ConflictExistingPrimaryKey() { Assert.Throws(() => diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlSchemaTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlSchemaTest.cs index 4c1bfa8ca081b..de1c0685bb05e 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlSchemaTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlSchemaTest.cs @@ -52,7 +52,7 @@ private DataSet CreateTestSet() return ds; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void SingleElementTreatmentDifference() { // This is one of the most complicated case. When the content @@ -149,7 +149,7 @@ public void SingleElementTreatmentDifference() DataSetAssertion.AssertDataTable("complex", ds.Tables[0], "Root", 1, 0, 0, 0, 0, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void SuspiciousDataSetElement() { string schema = @" @@ -174,7 +174,7 @@ public void SuspiciousDataSetElement() DataSetAssertion.AssertDataTable("table", ds.Tables[0], "elem", 2, 0, 0, 0, 0, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void UnusedComplexTypesIgnored() { string xs = @" @@ -213,7 +213,7 @@ public void SimpleTypeComponentsIgnored() DataSetAssertion.AssertDataSet("ds", ds, "NewDataSet", 0, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void IsDataSetAndTypeIgnored() { string xsbase = @" @@ -243,7 +243,7 @@ public void IsDataSetAndTypeIgnored() DataSetAssertion.AssertDataSet("ds", ds, "NewDataSet", 1, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void NestedReferenceNotAllowed() { string xs = @" @@ -272,7 +272,7 @@ public void NestedReferenceNotAllowed() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void IsDataSetOnLocalElementIgnored() { string xsbase = @" @@ -294,7 +294,7 @@ public void IsDataSetOnLocalElementIgnored() DataSetAssertion.AssertDataSet("ds", ds, "NewDataSet", 1, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void LocaleOnRootWithoutIsDataSet() { using (new ThreadCultureChange("fi-FI")) @@ -323,7 +323,7 @@ public void LocaleOnRootWithoutIsDataSet() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ElementHasIdentityConstraint() { string constraints = @" @@ -381,7 +381,7 @@ public void ElementHasIdentityConstraint() Assert.Equal(0, ds.Relations.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void PrefixedTargetNS() { string xs = @" @@ -477,7 +477,7 @@ private void ReadTest1Check(DataSet ds) new string[] { "Column1_3" }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] // 001-004 public void TestSampleFileNoTables() { @@ -510,7 +510,7 @@ public void TestSampleFileNoTables() DataSetAssertion.AssertDataSet("004", ds, "NewDataSet", 0, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestSampleFileSimpleTables() { var ds = new DataSet(); @@ -547,7 +547,7 @@ public void TestSampleFileSimpleTables() DataSetAssertion.AssertDataColumn("att2", dt.Columns["att2"], "att2", true, false, 0, 1, "att2", MappingType.Attribute, typeof(int), 2, string.Empty, -1, string.Empty, /*1*/-1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestSampleFileComplexTables() { // Nested simple type element @@ -608,7 +608,7 @@ public void TestSampleFileComplexTables() DataSetAssertion.AssertDataColumn("id", dt.Columns[1], "uno_Id", true, false, 0, 1, "uno_Id", MappingType.Hidden, typeof(int), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestSampleFileComplexTables3() { var ds = new DataSet(); @@ -639,7 +639,7 @@ public void TestSampleFileComplexTables3() DataSetAssertion.AssertDataColumn("simple", dt.Columns[1], "e_text", false, false, 0, 1, "e_text", MappingType.SimpleContent, typeof(decimal), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestSampleFileXPath() { var ds = new DataSet(); @@ -681,7 +681,7 @@ public void TestSampleFileXPath() ")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestAnnotatedRelation1() { var ds = new DataSet(); @@ -732,7 +732,7 @@ public void TestAnnotatedRelation1() DataSetAssertion.AssertDataRelation("rel", ds.Relations[0], "rel", false, new string[] { "pk" }, new string[] { "fk" }, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestAnnotatedRelation2() { var ds = new DataSet(); @@ -783,7 +783,7 @@ public void TestAnnotatedRelation2() DataSetAssertion.AssertDataRelation("rel", ds.Relations[0], "rel", true, new string[] { "pk" }, new string[] { "fk" }, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void RepeatableSimpleElement() { var ds = new DataSet(); @@ -811,7 +811,7 @@ public void RepeatableSimpleElement() DataSetAssertion.AssertDataRelation("rel", ds.Relations[0], "Foo_Bar", true, new string[] { "Foo_Id" }, new string[] { "Foo_Id" }, true, true); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestMoreThanOneRepeatableColumns() { var ds = new DataSet(); @@ -861,7 +861,7 @@ public void AutoIncrementStep() Assert.True(ds.GetXmlSchema().IndexOf("AutoIncrementStep") > 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadConstraints() { var ds = new DataSet(); @@ -904,7 +904,7 @@ public void ReadConstraints() Assert.Equal("fk1", ds.Tables[1].Constraints[0].ConstraintName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadAnnotatedRelations_MultipleColumns() { var ds = new DataSet(); diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlTest.cs index 0bf6fd5491433..fa45aa582875a 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlTest.cs @@ -65,7 +65,7 @@ public class DataSetReadXmlTest "; private const string schema2 = schema1 + xml8; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadSimpleAuto() { DataSet ds; @@ -285,7 +285,7 @@ public void ReadSimpleIgnoreSchema() "NewDataSet", 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadSimpleInferSchema() { DataSet ds; @@ -606,7 +606,7 @@ public void SequentialRead2() DataSetAssertion.AssertDataTable("#3", ds.Tables[0], "root", 1, 2, 0, 0, 0, 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadComplexElementDocument() { var ds = new DataSet(); @@ -639,7 +639,7 @@ public void IgnoreSchemaShouldFillData() Assert.Equal(0, dt.Rows.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void NameConflictDSAndTable() { string xml = @" @@ -657,7 +657,7 @@ public void NameConflictDSAndTable() Assert.NotNull(ds.Tables["PriceListDetails"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ColumnOrder() { string xml = "" + @@ -690,7 +690,7 @@ public void ColumnOrder() Assert.Equal(3, ds.Tables[0].Columns[3].Ordinal); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void XmlSpace() { string xml = "" + diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs index bd35d061c0dd4..4c2e8b38b4e5f 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs @@ -367,7 +367,7 @@ public void OwnWriteXmlSchema() Assert.Equal("", TextString); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadWriteXml() { var ds = new DataSet(); @@ -424,7 +424,7 @@ public void ReadWriteXml() Assert.Equal("", TextString); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadWriteXmlDiffGram() { var ds = new DataSet(); @@ -507,7 +507,7 @@ public void ReadWriteXmlDiffGram() Assert.Equal("", TextString); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void WriteXmlSchema() { using (new ThreadCultureChange("fi-FI")) @@ -989,7 +989,7 @@ public void WriteNestedTableXml() Assert.Equal(sw.ToString().Replace("\r\n", "\n"), xml.Replace("\r\n", "\n")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void WriteXmlToStream() { string xml = "sample textsample text 2"; @@ -1028,7 +1028,7 @@ public void WtiteXmlEncodedXml() Assert.Equal(sw.ToString().Replace("\r\n", "\n"), xml.Replace("\r\n", "\n")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadWriteXml2() { string xml = ""; @@ -1046,7 +1046,7 @@ public void ReadWriteXml2() Assert.Equal(xml, sw.ToString()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadWriteXml3() { string input = @" @@ -1559,7 +1559,7 @@ public void WriteXmlModeSchema() Assert.Equal(result.Replace("\r\n", "\n"), xml.Replace("\r\n", "\n")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void WriteXmlModeSchema1() { // Keeping the brackets as the test otherwise starts to fail. diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetTest2.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetTest2.cs index aec8467dbc609..d5943b3da388c 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetTest2.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetTest2.cs @@ -540,7 +540,7 @@ public void HasErrors() #region test namespaces - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_BasicXml() { StringBuilder sb = new StringBuilder(); @@ -572,7 +572,7 @@ public void InferXmlSchema_BasicXml() Assert.Equal("Discontinued", ds.Tables[1].Columns[2].ColumnName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_WithoutIgnoreNameSpaces() { StringBuilder sb = new StringBuilder(); @@ -597,7 +597,7 @@ public void InferXmlSchema_WithoutIgnoreNameSpaces() Assert.Equal(8, ds.Tables.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_IgnoreNameSpace() { StringBuilder sb = new StringBuilder(); @@ -637,7 +637,7 @@ public void InferXmlSchema_IgnoreNameSpace() Assert.Equal("Discontinued", ds.Tables[2].Columns["Discontinued"].ColumnName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_IgnoreNameSpaces() //Ignoring 2 namespaces { StringBuilder sb = new StringBuilder(); @@ -667,7 +667,7 @@ public void InferXmlSchema_IgnoreNameSpaces() //Ignoring 2 namespaces #endregion #region inferringTables - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringTables1() { //According to the msdn documantaion : @@ -691,7 +691,7 @@ public void InferXmlSchema_inferringTables1() Assert.Equal("Element1_Text", ds.Tables[0].Columns["Element1_Text"].ColumnName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringTables2() { //According to the msdn documantaion : @@ -741,7 +741,7 @@ public void InferXmlSchema_inferringTables3() Assert.Equal("Element2", ds.Tables[0].Columns["Element2"].ColumnName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringTables4() { //According to the msdn documantaion : @@ -766,7 +766,7 @@ public void InferXmlSchema_inferringTables4() Assert.Equal("attr2", ds.Tables[0].Columns["attr2"].ColumnName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringTables5() { //According to the msdn documantaion : @@ -791,7 +791,7 @@ public void InferXmlSchema_inferringTables5() #endregion #region inferringColumns - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringColumns1() { //ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconinferringcolumns.htm @@ -815,7 +815,7 @@ public void InferXmlSchema_inferringColumns1() Assert.Equal(typeof(string), ds.Tables[0].Columns["attr2"].DataType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringColumns2() { //ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconinferringcolumns.htm @@ -850,7 +850,7 @@ public void InferXmlSchema_inferringColumns2() #region Inferring Relationships - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_inferringRelationships1() { //ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconinferringrelationships.htm @@ -914,7 +914,7 @@ public void InferXmlSchema_inferringRelationships1() #region Inferring Element Text - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_elementText1() { //ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconinferringelementtext.htm @@ -942,7 +942,7 @@ public void InferXmlSchema_elementText1() Assert.Equal(typeof(string), ds.Tables["Element1"].Columns["Element1_Text"].DataType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void InferXmlSchema_elementText2() { //ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconinferringelementtext.htm @@ -988,7 +988,7 @@ public void Locale() Assert.Equal(culInfo, ds.Locale); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void DataSetSpecificCulture() { using (new ThreadCultureChange("cs-CZ")) @@ -2235,7 +2235,7 @@ public void ReadXml_Strm2() // Tables[2] ParentRelations[0] name Assert.Equal("Stock_Price", ds.Tables[2].ParentRelations[0].RelationName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadXml_Strm3() { DataSet ds = new DataSet("TestDataSet"); @@ -2264,7 +2264,7 @@ public void ReadXml_Strm3() Assert.Equal(MappingType.Hidden, ds.Tables["Price"].Columns["Stock_Id"].ColumnMapping); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadXml_Strm4() { _ds = new DataSet("Stocks"); @@ -2365,7 +2365,7 @@ private void privateTestCase(string name, string toTable, string toTestSelect, s Assert.Equal(_ds.Tables[toTable].Select(toTestSelect)[0]["Stock_Id"], _ds.Tables[toCompareTable].Select(toCompareSelect)[0]["Stock_Id"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadXml_Strm5() { string xmlData; @@ -2589,7 +2589,7 @@ private string dataSetDescription(DataSet ds) return desc; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadXml_Strm6() { // TC1 @@ -2608,7 +2608,7 @@ public void ReadXml_Strm6() Assert.Equal(3, ds.Tables["c"].Rows.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadXmlSchema_2() { var ds = new DataSet(); @@ -3070,7 +3070,7 @@ private void CheckNode(string description, string xPath, int expectedNodesCout, Assert.Equal(expectedNodesCout, actualNodeCount); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void WriteXml_Stream() { { @@ -3515,7 +3515,7 @@ private void AssertDataTableValues(DataTable dt) Assert.Equal("data8", dt.Rows[0]["&ID"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void Bug537229_BinFormatSerializer_Test() { DataSet ds = new DataSet(); diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataSetTypedDataSetTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataSetTypedDataSetTest.cs index cc5d61cdac4a7..856b779e8c11a 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataSetTypedDataSetTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataSetTypedDataSetTest.cs @@ -40,7 +40,7 @@ public class DataSetTypedDataSetTest { private string _eventStatus = string.Empty; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TypedDataSet() { int i = 0; diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataTableExtensionsTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataTableExtensionsTest.cs index e3f53fe429ab6..8608ba7bd645d 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataTableExtensionsTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataTableExtensionsTest.cs @@ -5,6 +5,7 @@ namespace System.Data.Tests { + [PlatformSpecific(~TestPlatforms.Browser)] public class DataTableExtensionsTest { private DataTable _dt; diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataTableReadXmlSchemaTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataTableReadXmlSchemaTest.cs index 59191f5226fea..17bb95df00d1a 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataTableReadXmlSchemaTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataTableReadXmlSchemaTest.cs @@ -53,7 +53,7 @@ private DataSet CreateTestSet() return ds; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void SuspiciousDataSetElement() { string schema = @" @@ -108,7 +108,7 @@ public void UnusedComplexTypesIgnored() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void IsDataSetAndTypeIgnored() { string xsbase = @" @@ -140,7 +140,7 @@ public void IsDataSetAndTypeIgnored() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void NestedReferenceNotAllowed() { string xs = @" @@ -194,7 +194,7 @@ public void LocaleOnRootWithoutIsDataSet() DataSetAssertion.AssertDataColumn("col2", dt.Columns[1], "Child", false, false, 0, 1, "Child", MappingType.Element, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void PrefixedTargetNS() { string xs = @" @@ -308,7 +308,7 @@ public void TestSampleFileSimpleTables() DataSetAssertion.AssertDataColumn("att2", dt.Columns["att2"], "att2", true, false, 0, 1, "att2", MappingType.Attribute, typeof(int), 2, string.Empty, -1, string.Empty, /*1*/-1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestSampleFileComplexTables3() { var ds = new DataSet(); @@ -338,7 +338,7 @@ public void TestSampleFileComplexTables3() DataSetAssertion.AssertDataColumn("simple", dt.Columns[1], "e_text", false, false, 0, 1, "e_text", MappingType.SimpleContent, typeof(decimal), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void TestSampleFileXPath() { var ds = new DataSet(); @@ -428,7 +428,7 @@ public void ReadConstraints() Assert.Equal("Constraint1", ds.Tables[0].Constraints[0].ConstraintName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void XsdSchemaSerializationIgnoresLocale() { var serializer = new BinaryFormatter(); @@ -475,7 +475,7 @@ public void XsdSchemaSerializationIgnoresLocale() Assert.DoesNotContain("()2", rawSchemaXML); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported), nameof(PlatformDetection.IsNotInvariantGlobalization))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix for this bug")] public void XsdSchemaDeserializationIgnoresLocale() { diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataTableTest.cs b/src/libraries/System.Data.Common/tests/System/Data/DataTableTest.cs index 2202651e330eb..df8276d0aac4e 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataTableTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataTableTest.cs @@ -375,7 +375,7 @@ public void SelectOperators() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void DataColumnTypeSerialization() { DataTable dt = new DataTable("MyTable"); @@ -1767,7 +1767,7 @@ public void TestWriteXmlSchema3() Assert.Equal("", textString); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void Serialize() { // Create an array with multiple elements refering to @@ -2887,7 +2887,7 @@ public void ReadXmlSchema() Assert.True(column3.Unique); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void ReadXmlSchema_2() { DataTable dt = new DataTable(); @@ -3111,7 +3111,7 @@ public void ReadXmlSchema_ByXmlReader() Assert.Equal(0, dt2.Rows.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void WriteXmlSchema() { using (new ThreadCultureChange("en-GB")) diff --git a/src/libraries/System.Data.Common/tests/System/Data/DataTableTest4.cs b/src/libraries/System.Data.Common/tests/System/Data/DataTableTest4.cs index 4fa0a6308fa76..da6cabc4ecd1b 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/DataTableTest4.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/DataTableTest4.cs @@ -870,7 +870,7 @@ public void XmlTest7() Assert.Equal(3, row["ParentID"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void XmlTest8() { MakeParentTable1(); @@ -910,7 +910,7 @@ public void XmlTest8() Assert.Equal("3", row["DepartmentID"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void XmlTest9() { MakeParentTable1(); diff --git a/src/libraries/System.Data.Common/tests/System/Data/FacadeTest.cs b/src/libraries/System.Data.Common/tests/System/Data/FacadeTest.cs index 49540efe7a7eb..f8eba45d7f5c4 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/FacadeTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/FacadeTest.cs @@ -10,6 +10,7 @@ public class FacadeTest [Theory] [InlineData("Microsoft.SqlServer.Server.SqlMetaData")] // Type from System.Data.SqlClient [InlineData("System.Data.SqlTypes.SqlBytes")] // Type from System.Data.Common + [PlatformSpecific(~TestPlatforms.Browser)] public void TestSystemData(string typeName) { // Verify that the type can be loaded via .NET Framework compat facade diff --git a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs index 1f6fb8536ea45..0cae8f7a40409 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs @@ -37,7 +37,7 @@ public static class SqlStringSortingTest private static readonly UnicodeEncoding s_unicodeEncoding = new UnicodeEncoding(bigEndian: false, byteOrderMark: false, throwOnInvalidBytes: true); - [ConditionalTheory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [InlineData("ja-JP", 0x0411)] // Japanese - Japan [InlineData("ar-SA", 0x0401)] // Arabic - Saudi Arabia [InlineData("de-DE", 0x0407)] // German - Germany diff --git a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringTest.cs b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringTest.cs index d123a60bf4e0b..86a4b1683c4c9 100644 --- a/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringTest.cs +++ b/src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringTest.cs @@ -62,7 +62,7 @@ public void Constructor_Value_Success() ValidateProperties(value, CultureInfo.CurrentCulture, new SqlString(value)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [InlineData(1033, "en-US")] [InlineData(1036, "fr-FR")] public void Constructor_ValueLcid_Success(int lcid, string name) @@ -97,35 +97,38 @@ public void Create() SqlString testString = new SqlString("Test"); Assert.Equal("Test", testString.Value); - // SqlString (String, int) - testString = new SqlString("Test", 2057); - Assert.Equal(2057, testString.LCID); - - // SqlString (int, SqlCompareOptions, byte[]) - testString = new SqlString(2057, - SqlCompareOptions.BinarySort | SqlCompareOptions.IgnoreCase, - new byte[2] { 123, 221 }); - Assert.Equal(2057, testString.CompareInfo.LCID); - - // SqlString(string, int, SqlCompareOptions) - testString = new SqlString("Test", 2057, SqlCompareOptions.IgnoreNonSpace); - Assert.False(testString.IsNull); - - // SqlString (int, SqlCompareOptions, byte[], bool) - testString = new SqlString(2057, SqlCompareOptions.BinarySort, new byte[4] { 100, 100, 200, 45 }, true); - Assert.Equal((byte)63, testString.GetNonUnicodeBytes()[0]); - testString = new SqlString(2057, SqlCompareOptions.BinarySort, new byte[2] { 113, 100 }, false); - Assert.Equal("qd", testString.Value); - - // SqlString (int, SqlCompareOptions, byte[], int, int) - testString = new SqlString(2057, SqlCompareOptions.BinarySort, new byte[2] { 113, 100 }, 0, 2); - Assert.False(testString.IsNull); - - // SqlString (int, SqlCompareOptions, byte[], int, int, bool) - testString = new SqlString(2057, SqlCompareOptions.IgnoreCase, new byte[3] { 100, 111, 50 }, 1, 2, false); - Assert.Equal("o2", testString.Value); - testString = new SqlString(2057, SqlCompareOptions.IgnoreCase, new byte[3] { 123, 111, 222 }, 1, 2, true); - Assert.False(testString.IsNull); + if (PlatformDetection.IsNotInvariantGlobalization) + { + // SqlString (String, int) + testString = new SqlString("Test", 2057); + Assert.Equal(2057, testString.LCID); + + // SqlString (int, SqlCompareOptions, byte[]) + testString = new SqlString(2057, + SqlCompareOptions.BinarySort | SqlCompareOptions.IgnoreCase, + new byte[2] { 123, 221 }); + Assert.Equal(2057, testString.CompareInfo.LCID); + + // SqlString(string, int, SqlCompareOptions) + testString = new SqlString("Test", 2057, SqlCompareOptions.IgnoreNonSpace); + Assert.False(testString.IsNull); + + // SqlString (int, SqlCompareOptions, byte[], bool) + testString = new SqlString(2057, SqlCompareOptions.BinarySort, new byte[4] { 100, 100, 200, 45 }, true); + Assert.Equal((byte)63, testString.GetNonUnicodeBytes()[0]); + testString = new SqlString(2057, SqlCompareOptions.BinarySort, new byte[2] { 113, 100 }, false); + Assert.Equal("qd", testString.Value); + + // SqlString (int, SqlCompareOptions, byte[], int, int) + testString = new SqlString(2057, SqlCompareOptions.BinarySort, new byte[2] { 113, 100 }, 0, 2); + Assert.False(testString.IsNull); + + // SqlString (int, SqlCompareOptions, byte[], int, int, bool) + testString = new SqlString(2057, SqlCompareOptions.IgnoreCase, new byte[3] { 100, 111, 50 }, 1, 2, false); + Assert.Equal("o2", testString.Value); + testString = new SqlString(2057, SqlCompareOptions.IgnoreCase, new byte[3] { 123, 111, 222 }, 1, 2, true); + Assert.False(testString.IsNull); + } } [Fact] @@ -170,7 +173,7 @@ public void PublicFields() } // Test properties - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void Properties() { using (new ThreadCultureChange("en-AU")) @@ -207,7 +210,7 @@ public void CompareToArgumentException() AssertExtensions.Throws(null, () => _test1.CompareTo(test)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void CompareToSqlTypeException() { SqlString t1 = new SqlString("test", 2057, SqlCompareOptions.IgnoreCase); @@ -215,7 +218,7 @@ public void CompareToSqlTypeException() Assert.Throws(() => t1.CompareTo(t2)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void CompareTo() { Assert.True(_test1.CompareTo(_test3) < 0); diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 3a61b3e16c987..75ce0856c06db 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -21,9 +21,6 @@ - - -