From 0b4d241904ed8f79744f7b3447bc2e2974207c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 13 Mar 2023 18:42:33 +0000 Subject: [PATCH 01/70] Bump version to 2.0 --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index a8bd3317..abd11611 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.14", + "version": "2.0", "assemblyVersion": { "precision": "build" }, From 7d53a44e4726a25f568a88cbf8395556e5d2aa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 13 Mar 2023 18:57:28 +0000 Subject: [PATCH 02/70] Remove empty file --- .../CoreLibrary.NoReflection.nfproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 460c925e..91005081 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -157,9 +157,6 @@ - - - From 18ec78d033b910de51e4b303fe27cf4e227c1412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 13 Mar 2023 19:02:55 +0000 Subject: [PATCH 03/70] Clean-up ghost linked files ***NO_CI*** --- .../CoreLibrary.NoReflection.nfproj | 1 + 1 file changed, 1 insertion(+) diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 91005081..130979ee 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -157,6 +157,7 @@ + From 256c8a3147885ca23bff226e1d93e45008b4cb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 3 Apr 2023 18:27:22 +0100 Subject: [PATCH 04/70] Update test framework sub-module @0928fa9 --- nanoFramework.TestFramework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index ac2b71cf..0928fa93 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit ac2b71cf5d9c08afc61074a707c326dc683c4f5f +Subproject commit 0928fa93b2d3add6a894e10b21c0a56ab93c2ff5 From 270c8c368988c205fb7ce40eb72d9f225f776387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 3 Apr 2023 19:14:37 +0100 Subject: [PATCH 05/70] Update Unit test projects --- .../NFUnitTestArithmetic.nfproj | 13 ------------- Tests/NFUnitTestArray/NFUnitTestArray.nfproj | 13 ------------- .../NFUnitTestAttributes.nfproj | 13 ------------- .../NFUnitTestBasicConcepts.nfproj | 13 ------------- .../NFUnitTestBitConverter.nfproj | 16 +--------------- Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj | 13 ------------- .../NFUnitTestConversions.nfproj | 13 ------------- .../NFUnitTestDelegates.nfproj | 13 ------------- Tests/NFUnitTestEnum/NFUnitTestEnum.nfproj | 13 ------------- .../NFUnitTestException.nfproj | 13 ------------- .../NFUnitTestInterface.nfproj | 13 ------------- Tests/NFUnitTestLexical/NFUnitTestLexical.nfproj | 13 ------------- .../NFUnitTestNamespace.nfproj | 13 ------------- Tests/NFUnitTestRecords/NFUnitTestRecords.nfproj | 13 ------------- .../NFUnitTestStatements.nfproj | 13 ------------- Tests/NFUnitTestStruct/NFUnitTestStruct.nfproj | 13 ------------- .../NFUnitTestSystemLib.nfproj | 13 ------------- Tests/NFUnitTestThread/NFUnitTestThread.nfproj | 13 ------------- Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj | 13 ------------- .../NFUnitTestVariables.nfproj | 13 ------------- .../NFUnitTest_DummyAdapter.nfproj | 13 ------------- Tests/NFUnitTest_DummyAdapter/packages.config | 4 ++-- Tests/NFUnitTest_DummyAdapter/packages.lock.json | 6 +++--- 23 files changed, 6 insertions(+), 280 deletions(-) diff --git a/Tests/NFUnitTestArithmetic/NFUnitTestArithmetic.nfproj b/Tests/NFUnitTestArithmetic/NFUnitTestArithmetic.nfproj index 51da889c..cb35d554 100644 --- a/Tests/NFUnitTestArithmetic/NFUnitTestArithmetic.nfproj +++ b/Tests/NFUnitTestArithmetic/NFUnitTestArithmetic.nfproj @@ -37,17 +37,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestArray/NFUnitTestArray.nfproj b/Tests/NFUnitTestArray/NFUnitTestArray.nfproj index 245da723..d208d3cf 100644 --- a/Tests/NFUnitTestArray/NFUnitTestArray.nfproj +++ b/Tests/NFUnitTestArray/NFUnitTestArray.nfproj @@ -34,17 +34,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj index 6d102acb..df34f066 100644 --- a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj +++ b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestBasicConcepts/NFUnitTestBasicConcepts.nfproj b/Tests/NFUnitTestBasicConcepts/NFUnitTestBasicConcepts.nfproj index 318a10c7..3396e3f5 100644 --- a/Tests/NFUnitTestBasicConcepts/NFUnitTestBasicConcepts.nfproj +++ b/Tests/NFUnitTestBasicConcepts/NFUnitTestBasicConcepts.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj b/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj index f331e43d..fcc118f7 100644 --- a/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj +++ b/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj @@ -33,18 +33,4 @@ - - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - - \ No newline at end of file + \ No newline at end of file diff --git a/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj b/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj index 8597d268..1f0ad410 100644 --- a/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj +++ b/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj @@ -44,17 +44,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestConversions/NFUnitTestConversions.nfproj b/Tests/NFUnitTestConversions/NFUnitTestConversions.nfproj index f038ee9c..4f69c8ca 100644 --- a/Tests/NFUnitTestConversions/NFUnitTestConversions.nfproj +++ b/Tests/NFUnitTestConversions/NFUnitTestConversions.nfproj @@ -35,17 +35,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestDelegates/NFUnitTestDelegates.nfproj b/Tests/NFUnitTestDelegates/NFUnitTestDelegates.nfproj index ba0ab21b..80293b02 100644 --- a/Tests/NFUnitTestDelegates/NFUnitTestDelegates.nfproj +++ b/Tests/NFUnitTestDelegates/NFUnitTestDelegates.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestEnum/NFUnitTestEnum.nfproj b/Tests/NFUnitTestEnum/NFUnitTestEnum.nfproj index f78c77fd..c422edc9 100644 --- a/Tests/NFUnitTestEnum/NFUnitTestEnum.nfproj +++ b/Tests/NFUnitTestEnum/NFUnitTestEnum.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestException/NFUnitTestException.nfproj b/Tests/NFUnitTestException/NFUnitTestException.nfproj index be674ff4..049da1ab 100644 --- a/Tests/NFUnitTestException/NFUnitTestException.nfproj +++ b/Tests/NFUnitTestException/NFUnitTestException.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestInterface/NFUnitTestInterface.nfproj b/Tests/NFUnitTestInterface/NFUnitTestInterface.nfproj index c9257439..d948cb12 100644 --- a/Tests/NFUnitTestInterface/NFUnitTestInterface.nfproj +++ b/Tests/NFUnitTestInterface/NFUnitTestInterface.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestLexical/NFUnitTestLexical.nfproj b/Tests/NFUnitTestLexical/NFUnitTestLexical.nfproj index 99c0c4fe..339c59f4 100644 --- a/Tests/NFUnitTestLexical/NFUnitTestLexical.nfproj +++ b/Tests/NFUnitTestLexical/NFUnitTestLexical.nfproj @@ -34,17 +34,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestNamespace/NFUnitTestNamespace.nfproj b/Tests/NFUnitTestNamespace/NFUnitTestNamespace.nfproj index a7f7a4b4..b4f7d7cc 100644 --- a/Tests/NFUnitTestNamespace/NFUnitTestNamespace.nfproj +++ b/Tests/NFUnitTestNamespace/NFUnitTestNamespace.nfproj @@ -43,17 +43,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestRecords/NFUnitTestRecords.nfproj b/Tests/NFUnitTestRecords/NFUnitTestRecords.nfproj index 6dcffc95..1b3921f5 100644 --- a/Tests/NFUnitTestRecords/NFUnitTestRecords.nfproj +++ b/Tests/NFUnitTestRecords/NFUnitTestRecords.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestStatementsTests/NFUnitTestStatements.nfproj b/Tests/NFUnitTestStatementsTests/NFUnitTestStatements.nfproj index 30c4e309..e7e96603 100644 --- a/Tests/NFUnitTestStatementsTests/NFUnitTestStatements.nfproj +++ b/Tests/NFUnitTestStatementsTests/NFUnitTestStatements.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestStruct/NFUnitTestStruct.nfproj b/Tests/NFUnitTestStruct/NFUnitTestStruct.nfproj index 952c14e3..acf19c82 100644 --- a/Tests/NFUnitTestStruct/NFUnitTestStruct.nfproj +++ b/Tests/NFUnitTestStruct/NFUnitTestStruct.nfproj @@ -33,17 +33,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestSystemLib/NFUnitTestSystemLib.nfproj b/Tests/NFUnitTestSystemLib/NFUnitTestSystemLib.nfproj index 54803e8a..233c69ca 100644 --- a/Tests/NFUnitTestSystemLib/NFUnitTestSystemLib.nfproj +++ b/Tests/NFUnitTestSystemLib/NFUnitTestSystemLib.nfproj @@ -56,17 +56,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestThread/NFUnitTestThread.nfproj b/Tests/NFUnitTestThread/NFUnitTestThread.nfproj index 36016567..8ded9cc5 100644 --- a/Tests/NFUnitTestThread/NFUnitTestThread.nfproj +++ b/Tests/NFUnitTestThread/NFUnitTestThread.nfproj @@ -39,17 +39,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj b/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj index cced57f9..9c74c368 100644 --- a/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj +++ b/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj @@ -41,17 +41,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTestVariables/NFUnitTestVariables.nfproj b/Tests/NFUnitTestVariables/NFUnitTestVariables.nfproj index 142a6d85..d8c24a22 100644 --- a/Tests/NFUnitTestVariables/NFUnitTestVariables.nfproj +++ b/Tests/NFUnitTestVariables/NFUnitTestVariables.nfproj @@ -34,17 +34,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - \ No newline at end of file diff --git a/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj b/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj index 61ce4327..5abcfe1a 100644 --- a/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj +++ b/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj @@ -45,17 +45,4 @@ - - - - - - - - - - Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - - - diff --git a/Tests/NFUnitTest_DummyAdapter/packages.config b/Tests/NFUnitTest_DummyAdapter/packages.config index b8ec76db..82c61161 100644 --- a/Tests/NFUnitTest_DummyAdapter/packages.config +++ b/Tests/NFUnitTest_DummyAdapter/packages.config @@ -1,5 +1,5 @@ - + - + \ No newline at end of file diff --git a/Tests/NFUnitTest_DummyAdapter/packages.lock.json b/Tests/NFUnitTest_DummyAdapter/packages.lock.json index 3322b791..53cb802e 100644 --- a/Tests/NFUnitTest_DummyAdapter/packages.lock.json +++ b/Tests/NFUnitTest_DummyAdapter/packages.lock.json @@ -10,9 +10,9 @@ }, "nanoFramework.TestFramework": { "type": "Direct", - "requested": "[2.1.53, 2.1.53]", - "resolved": "2.1.53", - "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" + "requested": "[2.1.71, 2.1.71]", + "resolved": "2.1.71", + "contentHash": "V2SYltqAwkw2ZSAZlyG515qIt2T3PL7v8UMF0GrknmTleA0HJ1qNHDXw4ymaV+RVrMexP9c27UuzQZBAKFxo9Q==" } } } From 770453603a6bd7c0eabd49caad115c2b1458d98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 27 Apr 2023 18:09:22 +0100 Subject: [PATCH 06/70] Move runsetting to nano version --- Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj | 3 +++ .runsettings => Tests/NFUnitTest_DummyAdapter/nano.runsettings | 1 + 2 files changed, 4 insertions(+) rename .runsettings => Tests/NFUnitTest_DummyAdapter/nano.runsettings (83%) diff --git a/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj b/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj index 5abcfe1a..cdd03ef4 100644 --- a/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj +++ b/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj @@ -23,6 +23,9 @@ v1.0 + + $(MSBuildProjectDirectory)\nano.runsettings + diff --git a/.runsettings b/Tests/NFUnitTest_DummyAdapter/nano.runsettings similarity index 83% rename from .runsettings rename to Tests/NFUnitTest_DummyAdapter/nano.runsettings index 90d26e0b..4e854cb2 100644 --- a/.runsettings +++ b/Tests/NFUnitTest_DummyAdapter/nano.runsettings @@ -11,5 +11,6 @@ Verbose False + E:\GitHub\nf-interpreter\build\bin\Debug\nanoFramework.nanoCLR.dll \ No newline at end of file From 2c9a590d2b852f5388b9f90cdd4ea338e9fe6a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 27 Apr 2023 18:09:48 +0100 Subject: [PATCH 07/70] Update test dummy adapter --- .../NFUnitTest_DummyAdapter.nfproj | 8 ++++---- Tests/NFUnitTest_DummyAdapter/packages.config | 2 +- Tests/NFUnitTest_DummyAdapter/packages.lock.json | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj b/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj index cdd03ef4..408a8500 100644 --- a/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj +++ b/Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj @@ -35,17 +35,17 @@ - ..\..\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll + ..\..\packages\nanoFramework.CoreLibrary.1.14.2\lib\mscorlib.dll - ..\..\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll + ..\..\packages\nanoFramework.TestFramework.2.1.71\lib\nanoFramework.TestFramework.dll - ..\..\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe + ..\..\packages\nanoFramework.TestFramework.2.1.71\lib\nanoFramework.UnitTestLauncher.exe - + \ No newline at end of file diff --git a/Tests/NFUnitTest_DummyAdapter/packages.config b/Tests/NFUnitTest_DummyAdapter/packages.config index 82c61161..1ebb8472 100644 --- a/Tests/NFUnitTest_DummyAdapter/packages.config +++ b/Tests/NFUnitTest_DummyAdapter/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Tests/NFUnitTest_DummyAdapter/packages.lock.json b/Tests/NFUnitTest_DummyAdapter/packages.lock.json index 53cb802e..67f9a727 100644 --- a/Tests/NFUnitTest_DummyAdapter/packages.lock.json +++ b/Tests/NFUnitTest_DummyAdapter/packages.lock.json @@ -4,9 +4,9 @@ ".NETnanoFramework,Version=v1.0": { "nanoFramework.CoreLibrary": { "type": "Direct", - "requested": "[1.12.0, 1.12.0]", - "resolved": "1.12.0", - "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" + "requested": "[1.14.2, 1.14.2]", + "resolved": "1.14.2", + "contentHash": "j1mrz4mitl5LItvmHMsw1aHzCAfvTTgIkRxA0mhs5mSpctJ/BBcuNwua5j3MspfRNKreCQPy/qZy/D9ADLL/PA==" }, "nanoFramework.TestFramework": { "type": "Direct", From 465b6fec1bb4b10c109b1357e6100df6c4240430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 27 Apr 2023 18:14:16 +0100 Subject: [PATCH 08/70] Move runsettings to dummy test adapter --- Tests/NFUnitTest_DummyAdapter/.runsettings | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Tests/NFUnitTest_DummyAdapter/.runsettings diff --git a/Tests/NFUnitTest_DummyAdapter/.runsettings b/Tests/NFUnitTest_DummyAdapter/.runsettings new file mode 100644 index 00000000..4e854cb2 --- /dev/null +++ b/Tests/NFUnitTest_DummyAdapter/.runsettings @@ -0,0 +1,16 @@ + + + + + 1 + .\TestResults + 1200000 + net48 + x64 + + + Verbose + False + E:\GitHub\nf-interpreter\build\bin\Debug\nanoFramework.nanoCLR.dll + + \ No newline at end of file From fb9cd1db17f75e1d5551c2dc35fdefc6b1653dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 27 Apr 2023 18:16:38 +0100 Subject: [PATCH 09/70] remove wrong file --- Tests/NFUnitTest_DummyAdapter/.runsettings | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 Tests/NFUnitTest_DummyAdapter/.runsettings diff --git a/Tests/NFUnitTest_DummyAdapter/.runsettings b/Tests/NFUnitTest_DummyAdapter/.runsettings deleted file mode 100644 index 4e854cb2..00000000 --- a/Tests/NFUnitTest_DummyAdapter/.runsettings +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 1 - .\TestResults - 1200000 - net48 - x64 - - - Verbose - False - E:\GitHub\nf-interpreter\build\bin\Debug\nanoFramework.nanoCLR.dll - - \ No newline at end of file From fb3230c1876e4de52f92df4e9e5874bb52980a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 27 Apr 2023 18:21:57 +0100 Subject: [PATCH 10/70] Fix unit test project --- Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj b/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj index fcc118f7..8bb236a0 100644 --- a/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj +++ b/Tests/NFUnitTestBitConverter/NFUnitTestBitConverter.nfproj @@ -33,4 +33,5 @@ - \ No newline at end of file + + \ No newline at end of file From e0ceaab31937c4a5a9d2861da6ef02035d827352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 9 Jun 2023 01:20:17 +0100 Subject: [PATCH 11/70] Add unit tests to cover typeof (#205) ***NO_CI*** --- Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj | 3 +- Tests/NFUnitTestTypes/UnitTestTypes.cs | 89 ++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 Tests/NFUnitTestTypes/UnitTestTypes.cs diff --git a/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj b/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj index e5000da3..7ede25bb 100644 --- a/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj +++ b/Tests/NFUnitTestTypes/NFUnitTestTypes.nfproj @@ -33,6 +33,7 @@ + @@ -46,4 +47,4 @@ - \ No newline at end of file + diff --git a/Tests/NFUnitTestTypes/UnitTestTypes.cs b/Tests/NFUnitTestTypes/UnitTestTypes.cs new file mode 100644 index 00000000..12947d22 --- /dev/null +++ b/Tests/NFUnitTestTypes/UnitTestTypes.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestTypes +{ + [TestClass] + class UnitTestTypes + { + [TestMethod] + public void TypeTestsArrays_00() + { + ushort[] array = new ushort[10]; + var ushortArrayType = array.GetType(); + Assert.AreEqual(ushortArrayType.FullName, "System.UInt16[]"); + + short[] array2 = new short[10]; + var shortArrayType = array2.GetType(); + Assert.AreEqual(shortArrayType.FullName, "System.Int16[]"); + + int[] array3 = new int[10]; + var intArrayType = array3.GetType(); + Assert.AreEqual(intArrayType.FullName, "System.Int32[]"); + + uint[] array4 = new uint[10]; + var uintArrayType = array4.GetType(); + Assert.AreEqual(uintArrayType.FullName, "System.UInt32[]"); + + ulong[] array5 = new ulong[10]; + var ulongArrayType = array5.GetType(); + Assert.AreEqual(ulongArrayType.FullName, "System.UInt64[]"); + + long[] array6 = new long[10]; + var longArrayType = array6.GetType(); + Assert.AreEqual(longArrayType.FullName, "System.Int64[]"); + + float[] array7 = new float[10]; + var floatArrayType = array7.GetType(); + Assert.AreEqual(floatArrayType.FullName, "System.Single[]"); + + double[] array8 = new double[10]; + var doubleArrayType = array8.GetType(); + Assert.AreEqual(doubleArrayType.FullName, "System.Double[]"); + } + + [TestMethod] + public void TypeTestsArrays_01() + { + Assert.AreEqual(typeof(short[]).FullName, "System.Int16[]"); + Assert.AreEqual(typeof(ushort[]).FullName, "System.UInt16[]"); + Assert.AreEqual(typeof(int[]).FullName, "System.Int32[]"); + Assert.AreEqual(typeof(uint[]).FullName, "System.UInt32[]"); + Assert.AreEqual(typeof(long[]).FullName, "System.Int64[]"); + Assert.AreEqual(typeof(ulong[]).FullName, "System.UInt64[]"); + Assert.AreEqual(typeof(float[]).FullName, "System.Single[]"); + Assert.AreEqual(typeof(double[]).FullName, "System.Double[]"); + Assert.AreEqual(typeof(char[]).FullName, "System.Char[]"); + Assert.AreEqual(typeof(byte[]).FullName, "System.Byte[]"); + Assert.AreEqual(typeof(sbyte[]).FullName, "System.SByte[]"); + Assert.AreEqual(typeof(bool[]).FullName, "System.Boolean[]"); + Assert.AreEqual(typeof(string[]).FullName, "System.String[]"); + Assert.AreEqual(typeof(object[]).FullName, "System.Object[]"); + } + + [TestMethod] + public void TypeTestsBaseTypes() + { + Assert.AreEqual(typeof(short).FullName, "System.Int16"); + Assert.AreEqual(typeof(ushort).FullName, "System.UInt16"); + Assert.AreEqual(typeof(int).FullName, "System.Int32"); + Assert.AreEqual(typeof(uint).FullName, "System.UInt32"); + Assert.AreEqual(typeof(long).FullName, "System.Int64"); + Assert.AreEqual(typeof(ulong).FullName, "System.UInt64"); + Assert.AreEqual(typeof(float).FullName, "System.Single"); + Assert.AreEqual(typeof(double).FullName, "System.Double"); + Assert.AreEqual(typeof(char).FullName, "System.Char"); + Assert.AreEqual(typeof(byte).FullName, "System.Byte"); + Assert.AreEqual(typeof(sbyte).FullName, "System.SByte"); + Assert.AreEqual(typeof(bool).FullName, "System.Boolean"); + Assert.AreEqual(typeof(string).FullName, "System.String"); + Assert.AreEqual(typeof(object).FullName, "System.Object"); + } + } +} From 5a6ebe1d5f902c625bb47bef428a0edfc5238bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 20 Oct 2023 10:35:31 +0100 Subject: [PATCH 12/70] Add Unit Tests for GC (#206) ***NO_CI*** --- Tests/NFUnitTestGC/NFUnitTestGC.nfproj | 49 ++++ Tests/NFUnitTestGC/Properties/AssemblyInfo.cs | 31 +++ Tests/NFUnitTestGC/TestGC.cs | 48 ++++ Tests/NFUnitTestGC/TestGCWithByteArrays.cs | 89 ++++++++ .../NFUnitTestGC/TestGCWithDateTimeArrays.cs | 214 ++++++++++++++++++ Tests/NFUnitTestGC/TestGCWithObjectArrays.cs | 89 ++++++++ .../NFUnitTestGC/TestGCWithTimeSpanArrays.cs | 109 +++++++++ Tests/NFUnitTestGC/packages.config | 5 + nanoFramework.CoreLibrary.sln | 9 + 9 files changed, 643 insertions(+) create mode 100644 Tests/NFUnitTestGC/NFUnitTestGC.nfproj create mode 100644 Tests/NFUnitTestGC/Properties/AssemblyInfo.cs create mode 100644 Tests/NFUnitTestGC/TestGC.cs create mode 100644 Tests/NFUnitTestGC/TestGCWithByteArrays.cs create mode 100644 Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs create mode 100644 Tests/NFUnitTestGC/TestGCWithObjectArrays.cs create mode 100644 Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs create mode 100644 Tests/NFUnitTestGC/packages.config diff --git a/Tests/NFUnitTestGC/NFUnitTestGC.nfproj b/Tests/NFUnitTestGC/NFUnitTestGC.nfproj new file mode 100644 index 00000000..31f73663 --- /dev/null +++ b/Tests/NFUnitTestGC/NFUnitTestGC.nfproj @@ -0,0 +1,49 @@ + + + + $(MSBuildExtensionsPath)\nanoFramework\v1.0\ + + + + + + + Debug + AnyCPU + {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 768be3b6-41c6-4dfb-8a2d-443b2113f5ad + Library + Properties + 512 + NFUnitTestGC + NFUnitTest + False + true + UnitTest + v1.0 + + + + + + + + + + + + + ..\..\packages\nanoFramework.CoreLibrary.1.14.2\lib\mscorlib.dll + + + ..\..\packages\nanoFramework.TestFramework.2.1.85\lib\nanoFramework.TestFramework.dll + + + ..\..\packages\nanoFramework.TestFramework.2.1.85\lib\nanoFramework.UnitTestLauncher.exe + + + + + + + \ No newline at end of file diff --git a/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs b/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..a3735af6 --- /dev/null +++ b/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyCopyright("Copyright (c) 2021 nanoFramework contributors")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/NFUnitTestGC/TestGC.cs b/Tests/NFUnitTestGC/TestGC.cs new file mode 100644 index 00000000..0ea02bba --- /dev/null +++ b/Tests/NFUnitTestGC/TestGC.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestGC +{ + [TestClass] + public class TestGC + { + [TestMethod] + public void TestGCStress() + { + int maxArraySize = 1024 * 32; + object[] arrays = new object[600]; + + OutputHelper.WriteLine("Starting TestGCStress"); + + for (int loop = 0; loop < 100; loop++) + { + OutputHelper.WriteLine($"Running iteration {loop}"); + + for (int i = 0; i < arrays.Length - 1;) + { + OutputHelper.WriteLine($"Alloc array of {maxArraySize} bytes @ pos {i}"); + arrays[i++] = new byte[maxArraySize]; ; + + OutputHelper.WriteLine($"Alloc array of 64 bytes @ pos {i}"); + arrays[i++] = new byte[64]; + } + + arrays[0] = new byte[maxArraySize]; + + for (int i = 0; i < arrays.Length; i++) + { + arrays[i] = null; + } + } + + OutputHelper.WriteLine("Completed TestGCStress"); + } + } +} diff --git a/Tests/NFUnitTestGC/TestGCWithByteArrays.cs b/Tests/NFUnitTestGC/TestGCWithByteArrays.cs new file mode 100644 index 00000000..579d7ca8 --- /dev/null +++ b/Tests/NFUnitTestGC/TestGCWithByteArrays.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestGC +{ + [TestClass] + public class TestGCWithByteArrays + { + [TestMethod] + public void TestCompactionForNotFixedArray() + { + OutputHelper.WriteLine("Starting TestCompactionForNotFixedArray"); + + for (int loop = 0; loop < 10; loop++) + { + OutputHelper.WriteLine($"Starting iteration {loop}"); + + // First we create byte and holes that keeps some space that could be used by compaction + + // Small count so compaction does not happen + byte[] arrayOfArrays = new byte[10]; + + RunAllocations(arrayOfArrays); + + // This is the array that we expect to move in during compaction. + byte[] testNativeBuffer = new byte[100]; + + // Fill it, so it is not optimized out + Random random = new(); + var baseValue = random.Next(2); + + for (int i = 0; i < testNativeBuffer.Length; i++) + { + testNativeBuffer[i] = (byte)(i * baseValue); + } + + // trigger compaction + InitiateCompaction(); + + int index = 0; + + // Check that array content is not corrupted + foreach (var item in testNativeBuffer) + { + Assert.AreEqual(index * baseValue, item, $"Array content comparison failed at position {index}. Expecting {(index * baseValue)}, found {item}"); + index++; + } + + OutputHelper.WriteLine("No corruption detected in array"); + } + + OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + } + + void RunAllocations(byte[] arrObj) + { + for (int i = 1; i < arrObj.Length; i++) + { + // Creates referenced byte, which stays in memory until InitiateCompaction exits + arrObj[i] = new byte(); + + // Tries to create larger object that would be later hole . + // This object could be garbage collected on each "i" cycle. + byte[] arr = new byte[50 * i]; + + // Creates some usage for arr, so it is not optimized out. + arr[0] = 1; + arr[1] = 2; + + OutputHelper.WriteLine($"On Cycle {i:D3} Array of {arr[1]} was allocated"); + } + } + + // This method causes compaction to occur. + // It is not so trivial as it need to fragment heap with referenced byte array. + void InitiateCompaction() + { + // large count, so compaction happens during call to RunAllocations + byte[] arrayOfArrays = new byte[1500]; + RunAllocations(arrayOfArrays); + } + } +} diff --git a/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs b/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs new file mode 100644 index 00000000..e78cd0c5 --- /dev/null +++ b/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs @@ -0,0 +1,214 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestGC +{ + [TestClass] + public class TestGCWithDateTimeArrays + { + [TestMethod] + public void TestCompactionForNotFixedDateTimeArray() + { + OutputHelper.WriteLine("Starting TestCompactionForNotFixedDateTimeArray"); + + for (int loop = 0; loop < 10; loop++) + { + OutputHelper.WriteLine($"Starting iteration {loop}"); + // First we create objects and holes that keeps some space that could be used by compaction. + // Small count so compaction does not happen. + HolderForDateTime[] arrayOfArrays = new HolderForDateTime[10]; + RunDateTimeAllocations(arrayOfArrays); + + // This is the array that we expect to move in during compaction. + HolderForDateTime[] testNativeBuffer = new HolderForDateTime[100]; + // Fill it, so it is not optimized out + for (int i = 0; i < testNativeBuffer.Length; i++) + { + testNativeBuffer[i] = new HolderForDateTime(GetRandomDateTime()); + } + + OutputHelper.WriteLine("Large HolderForDateTime array created"); + OutputHelper.WriteLine("Forcing compaction to occurr"); + + // Causes compaction + InitiateDateTimeCompaction(); + + OutputHelper.WriteLine("Compaction occurred"); + OutputHelper.WriteLine("Checking arrays for corrupted data..."); + + int index = 0; + + // Check that array content is not corrupted + foreach (HolderForDateTime holder in testNativeBuffer) + { + Assert.AreEqual(holder.StoredTicks, holder.DtValue.Ticks, $"Array content comparison failed at position {index}. Expecting {holder.StoredTicks}, found {holder.DtValue.Ticks}"); + index++; + } + + OutputHelper.WriteLine("No corruption detected in array"); + } + + OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + } + + // This function cause compaction to occur. + // It is not so trivial as it need to fragment heap with referenced objects. + void InitiateDateTimeCompaction() + { + // Large count, so compaction happens during RunAllocations. + HolderForDateTime[] arrayOfArrays = new HolderForDateTime[500]; + RunDateTimeAllocations(arrayOfArrays); + } + + private void RunDateTimeAllocations(HolderForDateTime[] arrObj) + { + for (int i = 1; i < arrObj.Length; i++) + { + // Creates referenced object, which stays in memory until InitiateCompaction exits + arrObj[i] = new HolderForDateTime(DateTime_btwn_1801_And_2801()); + + // Tries to create larger object that would be later hole + // This object could be garbage collected on each "i" cycle + HolderForDateTime[] arr = new HolderForDateTime[50 * i]; + + // Creates some usage for array elements, so it is not optimized out + arr[0] = new HolderForDateTime(DateTime.MinValue); + arr[1] = new HolderForDateTime(DateTime.MaxValue); + + Console.WriteLine($"On Cycle {i:D3} DateTime holder allocated"); + } + } + + private class HolderForDateTime + { + public long StoredTicks { get; } + public DateTime DtValue { get; } + + public HolderForDateTime(DateTime dt) + { + StoredTicks = dt.Ticks; + DtValue = dt; + } + } + + static int year, month, day, hour, minute, second, millisec; + static long ticks; + + static int[] leapYear = new int[] {2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, + 2052, 2056, 2060, 2064, 2068, 2072, 2076, 2080, 2084, 2088, 2092, 2096}; + + // computing our constants here, as these are not accessible + // equivalent to DateTime.TicksPerSecond + const int _TicksPerSecond = 10000 * 1000; + + private DateTime[] Get_ArrayOfRandomDateTimes() + { + OutputHelper.WriteLine(DateTime_btwn_1801_And_2801().ToString()); + OutputHelper.WriteLine(GetLeapYearDateTime().ToString()); + DateTime[] _dateTimeArr = new DateTime[] {DateTime.UtcNow, + DateTime_btwn_1801_And_2801(), DateTime_btwn_1801_And_2801(), DateTime_btwn_1801_And_2801(), + GetLeapYearDateTime(), GetLeapYearDateTime() , GetLeapYearDateTime(), + DateTime_btwn_1801_And_2801(), DateTime_btwn_1801_And_2801(), DateTime_btwn_1801_And_2801(), + GetLeapYearDateTime(), GetLeapYearDateTime(), GetLeapYearDateTime()}; + + return _dateTimeArr; + } + + private DateTime DateTime_btwn_1801_And_2801() + { + //Generates random DateTime b/n 1000 and 9000 + Random random = new Random(); + year = random.Next(999) + 1801; + month = random.Next(12) + 1; + if (month == 2 && IsLeapYear(year)) + day = random.Next(29) + 1; + else if (month == 2 && (!IsLeapYear(year))) + day = random.Next(28) + 1; + else if (((month <= 7) && ((month + 1) % 2 == 0)) || + ((month > 7) && ((month % 2) == 0))) + day = random.Next(31) + 1; + else + day = random.Next(30) + 1; + hour = random.Next(24); + minute = random.Next(60); + second = random.Next(60); + millisec = random.Next(1000); + + return new DateTime(year, month, day, hour, minute, second, millisec); + } + + private DateTime GetRandomDateTime() + { + //Generates random DateTime + Random random = new Random(); + year = random.Next(1399) + 1601; + month = random.Next(12) + 1; + + if (month == 2 && IsLeapYear(year)) + { + day = random.Next(29) + 1; + } + else if (month == 2 && (!IsLeapYear(year))) + { + day = random.Next(28) + 1; + } + else if (((month <= 7) && ((month + 1) % 2 == 0)) + || ((month > 7) && ((month % 2) == 0))) + { + day = random.Next(31) + 1; + } + else + { + day = random.Next(30) + 1; + } + + hour = random.Next(24); + minute = random.Next(60); + second = random.Next(60); + millisec = random.Next(1000); + + DateTime dt = new(year, month, day, hour, minute, second, millisec); + + // fill in random ticks value so we can have a fully filled ticks value + ticks = dt.Ticks + random.Next(1000_000); + + dt = new(ticks); + + // need to update minutesm, millisec and second because it could have changed with new ticks value + millisec = dt.Millisecond; + second = dt.Second; + minute = dt.Minute; + + return dt; + } + + private DateTime GetLeapYearDateTime() + { + Random random = new Random(); + year = leapYear[random.Next(leapYear.Length)]; + month = random.Next(12) + 1; + day = random.Next(29) + 1; + hour = random.Next(24); + minute = random.Next(60); + second = random.Next(60); + millisec = random.Next(1000); + OutputHelper.WriteLine($"{year} {month} {day} {hour} {minute} {second} {millisec}"); + return new DateTime(year, month, day, hour, minute, second, millisec); + } + + private bool IsLeapYear(int yr) + { + if ((yr % 400 == 0) || ((yr % 100 != 0) && (yr % 4 == 0))) + return true; + else + return false; + } + + } +} diff --git a/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs b/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs new file mode 100644 index 00000000..df0b9a3d --- /dev/null +++ b/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestGC +{ + [TestClass] + public class TestGCWithObjectArrays + { + [TestMethod] + public void TestCompactionForNotFixedArray() + { + OutputHelper.WriteLine("Starting TestCompactionForNotFixedArray"); + + for (int loop = 0; loop < 10; loop++) + { + OutputHelper.WriteLine($"Starting iteration {loop}"); + + // First we create objects and holes that keeps some space that could be used by compaction + + // Small count so compaction does not happen + object[] arrayOfArrays = new object[10]; + + RunAllocations(arrayOfArrays); + + // This is the array that we expect to move in during compaction. + int[] testNativeBuffer = new int[100]; + + // Fill it, so it is not optimized out + Random random = new Random(); + var baseValue = random.Next(); + + for (int i = 0; i < testNativeBuffer.Length; i++) + { + testNativeBuffer[i] = i * baseValue; + } + + // trigger compaction + InitiateCompaction(); + + int index = 0; + + // Check that array content is not corrupted + foreach (var item in testNativeBuffer) + { + Assert.AreEqual(index * baseValue, item, $"Array content comparison failed at position {index}. Expecting {(index * baseValue)}, found {item}"); + index++; + } + + OutputHelper.WriteLine("No corruption detected in array"); + } + + OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + } + + void RunAllocations(object[] arrObj) + { + for (int i = 1; i < arrObj.Length; i++) + { + // Creates referenced interger object, which stays in memory until InitiateCompaction exits + arrObj[i] = new int(); + + // Tries to create larger object that would be later hole . + // This object could be garbage collected on each "i" cycle. + int[] arr = new int[50 * i]; + + // Creates some usage for arr, so it is not optimized out. + arr[0] = i; + arr[1] = 50 * i; + + OutputHelper.WriteLine($"On Cycle {i:D3} Array of {arr[1]} was allocated"); + } + } + + // This method causes compaction to occur. + // It is not so trivial as it need to fragment heap with referenced objects. + void InitiateCompaction() + { + // large count, so compaction happens during call to RunAllocations + object[] arrayOfArrays = new object[1500]; + RunAllocations(arrayOfArrays); + } + } +} diff --git a/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs b/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs new file mode 100644 index 00000000..1294deda --- /dev/null +++ b/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestGC +{ + [TestClass] + public class TestGCWithTimeSpanArrays + { + [TestMethod] + public void TestCompactionForNotFixedTimeSpanArray() + { + OutputHelper.WriteLine("Starting TestCompactionForNotFixedTimeSpanArray"); + + for (int loop = 0; loop < 10; loop++) + { + OutputHelper.WriteLine($"Starting iteration {loop}"); + + // First we create objects and holes that keeps some space that could be used by compaction. + // Small count so compaction does not happen. + HolderForTimeSpan[] arrayOfArrays = new HolderForTimeSpan[10]; + RunTimeSpanAllocations(arrayOfArrays); + + // This is the array that we expect to move in during compaction. + HolderForTimeSpan[] testNativeBuffer = new HolderForTimeSpan[100]; + // Fill it, so it is not optimized out + for (int i = 0; i < testNativeBuffer.Length; i++) + { + testNativeBuffer[i] = new HolderForTimeSpan(GetRandomTimeSpan()); + } + + OutputHelper.WriteLine("Large HolderForTimeSpan array created"); + OutputHelper.WriteLine("Forcing compaction to occurr"); + + // Causes compaction + InitiateTimeSpanCompaction(); + + OutputHelper.WriteLine("Compaction occurred"); + OutputHelper.WriteLine("Checking arrays for corrupted data..."); + + int index = 0; + + // Check that array content is not corrupted + foreach (HolderForTimeSpan holder in testNativeBuffer) + { + Assert.AreEqual(holder.StoredTicks, holder.TsValue.Ticks, $"Array content comparison failed at position {index}. Expecting {holder.StoredTicks}, found {holder.TsValue.Ticks}"); + index++; + } + + OutputHelper.WriteLine("No corruption detected in array"); + } + + OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + } + + private TimeSpan GetRandomTimeSpan() + { + Random rand = new(); + + return TimeSpan.FromTicks(rand.Next() * 1000_000); + } + + // This function cause compaction to occur. + // It is not so trivial as it need to fragment heap with referenced objects. + void InitiateTimeSpanCompaction() + { + // Large count, so compaction happens during RunAllocations. + HolderForTimeSpan[] arrayOfArrays = new HolderForTimeSpan[500]; + RunTimeSpanAllocations(arrayOfArrays); + } + + private void RunTimeSpanAllocations(HolderForTimeSpan[] arrObj) + { + + for (int i = 1; i < arrObj.Length; i++) + { + // Creates referenced object, which stays in memory until InitiateCompaction exits + arrObj[i] = new HolderForTimeSpan(GetRandomTimeSpan()); + + // Tries to create larger object that would be later hole + // This object could be garbage collected on each "i" cycle + HolderForTimeSpan[] arr = new HolderForTimeSpan[50 * i]; + + // Creates some usage for array elements, so it is not optimized out + arr[0] = new HolderForTimeSpan(TimeSpan.MinValue); + arr[1] = new HolderForTimeSpan(TimeSpan.MaxValue); + + Console.WriteLine($"On Cycle {i:D3} DateTime holder allocated"); + } + } + + private class HolderForTimeSpan + { + public long StoredTicks { get; } + public TimeSpan TsValue { get; } + + public HolderForTimeSpan(TimeSpan ts) + { + StoredTicks = ts.Ticks; + TsValue = ts; + } + } + } +} diff --git a/Tests/NFUnitTestGC/packages.config b/Tests/NFUnitTestGC/packages.config new file mode 100644 index 00000000..7704bd8d --- /dev/null +++ b/Tests/NFUnitTestGC/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nanoFramework.CoreLibrary.sln b/nanoFramework.CoreLibrary.sln index a2a1bbe7..9e41b209 100644 --- a/nanoFramework.CoreLibrary.sln +++ b/nanoFramework.CoreLibrary.sln @@ -67,6 +67,8 @@ Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "NFUnitTestRecords", "Tests\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nanoFramework.TestAdapter", "nanoFramework.TestFramework\source\TestAdapter\nanoFramework.TestAdapter.csproj", "{6D740F0A-D435-4ACF-AD27-D702A599F229}" EndProject +Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "NFUnitTestGC", "Tests\NFUnitTestGC\NFUnitTestGC.nfproj", "{768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -221,6 +223,12 @@ Global {6D740F0A-D435-4ACF-AD27-D702A599F229}.Debug|Any CPU.Build.0 = Debug|Any CPU {6D740F0A-D435-4ACF-AD27-D702A599F229}.Release|Any CPU.ActiveCfg = Release|Any CPU {6D740F0A-D435-4ACF-AD27-D702A599F229}.Release|Any CPU.Build.0 = Release|Any CPU + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}.Release|Any CPU.Build.0 = Release|Any CPU + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -250,6 +258,7 @@ Global {55F048B5-6739-43C5-A93D-DB61DB8E912F} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {0BE498D1-CB3E-4D1E-BA4C-2C49AE30432D} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {6D740F0A-D435-4ACF-AD27-D702A599F229} = {0BAE286A-5434-4F56-A9F1-41B72056170E} + {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD} = {0BAE286A-5434-4F56-A9F1-41B72056170E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {8DE44407-9B41-4459-97D2-FCE54B1F4300} From 41507de1abed1531c93cd42583b1387a9618c0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 30 Oct 2023 18:12:32 +0000 Subject: [PATCH 13/70] Work CI-CD - Add new libraries to list of repos to update. ***NO_CI*** --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d739c3d3..410a8d1a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -183,8 +183,10 @@ jobs: System.Device.I2c System.Device.Pwm System.Device.Spi + System.IO.Hashing System.Math System.Text + System.Security.Cryptography # update dependents - template: azure-pipelines-templates/update-dependents.yml@templates From 0defde40f7a7b3354477af63d47d863b8ae4e71b Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Fri, 3 Nov 2023 10:33:07 -0700 Subject: [PATCH 14/70] Adding nanoFramework.Graphics and nanoFramework.Graphics.Core to friends (#207) ***NO_CI*** --- nanoFramework.CoreLibrary/Friends.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nanoFramework.CoreLibrary/Friends.cs b/nanoFramework.CoreLibrary/Friends.cs index 03434519..ffb1c951 100644 --- a/nanoFramework.CoreLibrary/Friends.cs +++ b/nanoFramework.CoreLibrary/Friends.cs @@ -13,3 +13,5 @@ [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.TestFramework, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.Logging, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("UnitTestLauncher, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.Graphics, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.Graphics.Core, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] \ No newline at end of file From 971ed700f72870121af481f1b87a3a1a19cfe7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 7 Nov 2023 18:19:25 +0000 Subject: [PATCH 15/70] Add Unit Tests for GC and strings (#209) ***NO_CI*** --- Tests/NFUnitTestGC/NFUnitTestGC.nfproj | 1 + Tests/NFUnitTestGC/TestGCWithStringArrays.cs | 103 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 Tests/NFUnitTestGC/TestGCWithStringArrays.cs diff --git a/Tests/NFUnitTestGC/NFUnitTestGC.nfproj b/Tests/NFUnitTestGC/NFUnitTestGC.nfproj index 31f73663..33dab399 100644 --- a/Tests/NFUnitTestGC/NFUnitTestGC.nfproj +++ b/Tests/NFUnitTestGC/NFUnitTestGC.nfproj @@ -25,6 +25,7 @@ + diff --git a/Tests/NFUnitTestGC/TestGCWithStringArrays.cs b/Tests/NFUnitTestGC/TestGCWithStringArrays.cs new file mode 100644 index 00000000..b4372b3c --- /dev/null +++ b/Tests/NFUnitTestGC/TestGCWithStringArrays.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; + +namespace NFUnitTestGC +{ + [TestClass] + public class TestGCWithStringArrays + { + [TestMethod] + public void TestCompactionForNotFixedStringArray() + { + OutputHelper.WriteLine("Starting TestCompactionForNotFixedStringArray"); + + for (int loop = 0; loop < 10; loop++) + { + OutputHelper.WriteLine($"Starting iteration {loop}"); + + // First we create objects and holes that keeps some space that could be used by compaction. + + // Small count so compaction does not happen. + HolderForString[] arrayOfStrings = new HolderForString[10]; + RunStringAllocations(arrayOfStrings); + + // This is the array that we expect to move in during compaction. + HolderForString[] testNativeBuffer = new HolderForString[100]; + // Fill it, so it is not optimized out + for (int i = 0; i < testNativeBuffer.Length; i++) + { + testNativeBuffer[i] = new HolderForString(Guid.NewGuid().ToString()); + } + + OutputHelper.WriteLine("Large HolderForString array created"); + OutputHelper.WriteLine("Forcing compaction to occurr"); + + // Causes compaction + InitiateStringCompaction(); + + OutputHelper.WriteLine("Compaction occurred"); + OutputHelper.WriteLine("Checking arrays for corrupted data..."); + + int index = 0; + + // Check that array content is not corrupted + foreach (HolderForString holder in testNativeBuffer) + { + Assert.AreEqual( + holder.StringHash, + holder.StringContent.GetHashCode(), + $"Array content comparison failed at position {index}. Expecting {holder.StringHash}, found {holder.StringContent.GetHashCode()}"); + + index++; + } + + OutputHelper.WriteLine("No corruption detected in array"); + } + + OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + } + + // This function cause compaction to occur. + // It is not so trivial as it need to fragment heap with referenced objects. + void InitiateStringCompaction() + { + // Large count, so compaction happens during RunAllocations. + HolderForString[] arrayOfArrays = new HolderForString[400]; + RunStringAllocations(arrayOfArrays); + } + + private void RunStringAllocations(HolderForString[] arrObj) + { + for (int i = 1; i < arrObj.Length; i++) + { + // Creates referenced object, which stays in memory until InitiateCompaction exits + arrObj[i] = new HolderForString(Guid.NewGuid().ToString()); + + // Tries to create larger object that would be later hole + // This object could be garbage collected on each "i" cycle + HolderForString[] arr = new HolderForString[50 * i]; + + // Creates some usage for array elements, so it is not optimized out + arr[0] = new HolderForString(Guid.NewGuid().ToString()); + } + } + + private class HolderForString + { + public int StringHash { get; } + public string StringContent { get; } + + public HolderForString(string value) + { + StringContent = value; + StringHash = value.GetHashCode(); + } + } + } +} From 76efe86272f7c54ee7b739b0ba91c5e57e77363a Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Wed, 8 Nov 2023 18:32:05 -0800 Subject: [PATCH 16/70] Switching MathInternal.Min/Max to managed implementations (#208) ***NO_CI*** --- .../System/AssemblyInfo.cs | 2 +- nanoFramework.CoreLibrary/System/Math.cs | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/AssemblyInfo.cs b/nanoFramework.CoreLibrary/System/AssemblyInfo.cs index 59716426..fe2c5fcb 100644 --- a/nanoFramework.CoreLibrary/System/AssemblyInfo.cs +++ b/nanoFramework.CoreLibrary/System/AssemblyInfo.cs @@ -13,4 +13,4 @@ [assembly: AssemblyProduct(".NET nanoFramework mscorlib")] [assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")] -[assembly: AssemblyNativeVersion("100.5.0.18")] +[assembly: AssemblyNativeVersion("100.5.0.19")] diff --git a/nanoFramework.CoreLibrary/System/Math.cs b/nanoFramework.CoreLibrary/System/Math.cs index 31ebe42f..a5b4136b 100644 --- a/nanoFramework.CoreLibrary/System/Math.cs +++ b/nanoFramework.CoreLibrary/System/Math.cs @@ -13,10 +13,26 @@ internal static class MathInternal [MethodImpl(MethodImplOptions.InternalCall)] internal static extern int Abs(int val); - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern int Min(int val1, int val2); + /// + /// Returns the larger of two 32-bit signed integers. + /// + /// The first of two 32-bit signed integers to compare. + /// The second of two 32-bit signed integers to compare. + /// Parameter or , whichever is larger. + internal static int Max(int val1, int val2) + { + return (val1 >= val2) ? val1 : val2; + } - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern int Max(int val1, int val2); + /// + /// Returns the smaller of two 32-bit signed integers. + /// + /// The first of two 32-bit signed integers to compare. + /// The second of two 32-bit signed integers to compare. + /// Parameter or , whichever is smaller. + internal static int Min(int val1, int val2) + { + return (val2 >= val1) ? val1 : val2; + } } } From b971f34bfe709156217f58afb75499dc05151164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 8 Nov 2023 23:13:45 +0000 Subject: [PATCH 17/70] Work CI-CD - Add new class libraries to update list. ***NO_CI*** --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 410a8d1a..f7c2e20d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -178,9 +178,11 @@ jobs: nanoFramework.Networking.Sntp nanoFramework.TI.EasyLink nanoFramework.ResourceManager + nanoframework.System.Runtime System.Device.Adc System.Device.Dac System.Device.I2c + System.Device.I2c.Slave System.Device.Pwm System.Device.Spi System.IO.Hashing From 9341cb1c67e6c9237cd729e654dbda7d97df39b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 9 Nov 2023 03:13:33 +0000 Subject: [PATCH 18/70] Work CI-CD - Improve conditions for update dependents. ***NO_CI*** --- azure-pipelines.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f7c2e20d..8ec6c5ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -136,12 +136,12 @@ jobs: condition: >- or( and( - succeeded(), + not(or(failed(), canceled()), startsWith(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['StartReleaseCandidate'], 'false') ), and( - succeeded(), + not(or(failed(), canceled()), eq(variables['System.PullRequest.PullRequestId'], ''), contains(variables['Build.SourceVersionMessage'], '***UPDATE_DEPENDENTS***'), eq(variables['StartReleaseCandidate'], 'false') @@ -149,6 +149,9 @@ jobs: eq(variables['UPDATE_DEPENDENTS'], 'true') ) + dependsOn: + - Build_mscorlib + pool: vmImage: 'windows-latest' From 2a13f1645bc509e9f93257c0ca7367480b1353c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 9 Nov 2023 03:13:33 +0000 Subject: [PATCH 19/70] Work CI-CD - Improve conditions for update dependents. ***NO_CI*** --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8ec6c5ae..fbe43d39 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -136,12 +136,12 @@ jobs: condition: >- or( and( - not(or(failed(), canceled()), + not(or(failed(), canceled())), startsWith(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['StartReleaseCandidate'], 'false') ), and( - not(or(failed(), canceled()), + not(or(failed(), canceled())), eq(variables['System.PullRequest.PullRequestId'], ''), contains(variables['Build.SourceVersionMessage'], '***UPDATE_DEPENDENTS***'), eq(variables['StartReleaseCandidate'], 'false') From bfce1d7b642925257628e844ae503120037094f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 9 Nov 2023 03:55:15 +0000 Subject: [PATCH 20/70] Fix GC Unit Tests project (#210) --- Tests/NFUnitTestGC/NFUnitTestGC.nfproj | 15 +++------------ Tests/NFUnitTestGC/packages.config | 5 ----- 2 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 Tests/NFUnitTestGC/packages.config diff --git a/Tests/NFUnitTestGC/NFUnitTestGC.nfproj b/Tests/NFUnitTestGC/NFUnitTestGC.nfproj index 33dab399..bcc3357e 100644 --- a/Tests/NFUnitTestGC/NFUnitTestGC.nfproj +++ b/Tests/NFUnitTestGC/NFUnitTestGC.nfproj @@ -33,18 +33,9 @@ - - ..\..\packages\nanoFramework.CoreLibrary.1.14.2\lib\mscorlib.dll - - - ..\..\packages\nanoFramework.TestFramework.2.1.85\lib\nanoFramework.TestFramework.dll - - - ..\..\packages\nanoFramework.TestFramework.2.1.85\lib\nanoFramework.UnitTestLauncher.exe - - - - + + + \ No newline at end of file diff --git a/Tests/NFUnitTestGC/packages.config b/Tests/NFUnitTestGC/packages.config deleted file mode 100644 index 7704bd8d..00000000 --- a/Tests/NFUnitTestGC/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file From e862eb6ac88adf311bdcea91af70cf51d8500098 Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Fri, 10 Nov 2023 16:04:41 -0800 Subject: [PATCH 21/70] Adding some unit tests for `string` (#211) ***NO_CI*** --- .../UnitTestStringTests.cs | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs index 1bfb4b9f..b088bf2f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs @@ -967,6 +967,81 @@ public static void EndsWithNoMatchNonOrdinal_StringComparison() Assert.IsFalse(s.EndsWith(value)); } + [TestMethod] + public void IndexOf_should_return_first_index_of_value() + { + // TODO: Check docs to confirm constraints on "count". Currently ArgumentOutOfRangeException is thrown if start + count exceeds string.Length + var source = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + + Assert.AreEqual(0, source.IndexOf('a'), "Case 1"); + Assert.AreEqual(26, source.IndexOf('a', 1), "Case 2"); + Assert.AreEqual(26, source.IndexOf('a', 1, source.Length - 1), "Case 3"); + Assert.AreEqual(0, source.IndexOf("a"), "Case 4"); + Assert.AreEqual(26, source.IndexOf("a", 1), "Case 5"); + Assert.AreEqual(26, source.IndexOf("a", 1, source.Length - 1), "Case 6"); + } + + [TestMethod] + public void IndexOf_should_return_negative_one_if_source_is_empty_string() + { + Assert.AreEqual(-1, string.Empty.IndexOf('.'), "Case 1"); + Assert.AreEqual(-1, string.Empty.IndexOf('.', 1), "Case 2"); + Assert.AreEqual(-1, string.Empty.IndexOf('.', 1, 2), "Case 3"); + Assert.AreEqual(-1, string.Empty.IndexOf("."), "Case 4"); + Assert.AreEqual(-1, string.Empty.IndexOf(".", 1), "Case 5"); + Assert.AreEqual(-1, string.Empty.IndexOf(".", 1, 2), "Case 6"); + } + + [TestMethod] + public void IndexOf_should_return_negative_one_if_value_is_not_found() + { + var source = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + + Assert.AreEqual(-1, source.IndexOf('.'), "Case 1"); + Assert.AreEqual(-1, source.IndexOf('.', 1), "Case 2"); + Assert.AreEqual(-1, source.IndexOf('.', 1, 2), "Case 3"); + Assert.AreEqual(-1, source.IndexOf("."), "Case 4"); + Assert.AreEqual(-1, source.IndexOf(".", 1), "Case 5"); + Assert.AreEqual(-1, source.IndexOf(".", 1, 2), "Case 6"); + } + + [TestMethod] + public void LastIndexOf_should_return_last_index_of_value() + { + var source = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + + Assert.AreEqual(26, source.LastIndexOf('a'), "Case 1"); + Assert.AreEqual(0, source.LastIndexOf('a', 1), "Case 2"); + Assert.AreEqual(0, source.LastIndexOf('a', 1, 2), "Case 3"); + Assert.AreEqual(26, source.LastIndexOf("a"), "Case 4"); + Assert.AreEqual(0, source.LastIndexOf("a", 1), "Case 5"); + Assert.AreEqual(0, source.LastIndexOf("a", 1, 2), "Case 6"); + } + + [TestMethod] + public void LastIndexOf_should_return_negative_one_if_source_is_empty_string() + { + Assert.AreEqual(-1, string.Empty.LastIndexOf('.'), "Case 1"); + Assert.AreEqual(-1, string.Empty.LastIndexOf('.', 1), "Case 2"); + Assert.AreEqual(-1, string.Empty.LastIndexOf('.', 1, 2), "Case 3"); + Assert.AreEqual(-1, string.Empty.LastIndexOf("."), "Case 4"); + Assert.AreEqual(-1, string.Empty.LastIndexOf(".", 1), "Case 5"); + Assert.AreEqual(-1, string.Empty.LastIndexOf(".", 1, 2), "Case 6"); + } + + [TestMethod] + public void LastIndexOf_should_return_negative_one_if_value_is_not_found() + { + var source = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + + Assert.AreEqual(-1, source.LastIndexOf('.'), "Case 1"); + Assert.AreEqual(-1, source.LastIndexOf('.', 1), "Case 2"); + Assert.AreEqual(-1, source.LastIndexOf('.', 1, 2), "Case 3"); + Assert.AreEqual(-1, source.LastIndexOf("."), "Case 4"); + Assert.AreEqual(-1, source.LastIndexOf(".", 1), "Case 5"); + Assert.AreEqual(-1, source.LastIndexOf(".", 1, 2), "Case 6"); + } + /// /// A class whose ToString method return null /// From bc3b3023b150ab337aebfdf16b34c8e5ce1d644a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 7 Dec 2023 03:51:09 +0000 Subject: [PATCH 22/70] Add unit test for hash code of class objects (#212) ***NO_CI*** --- .../NFUnitTestClasses.nfproj | 1 + .../UnitTestHashCodeTests.cs | 88 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs diff --git a/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj b/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj index ea326cb8..117e5aca 100644 --- a/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj +++ b/Tests/NFUnitTestClasses/NFUnitTestClasses.nfproj @@ -36,6 +36,7 @@ + diff --git a/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs b/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs new file mode 100644 index 00000000..05ee5af9 --- /dev/null +++ b/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System.Diagnostics; + +namespace NFUnitTestClasses +{ + [TestClass] + class UnitTestHashCodeTests + { + [TestMethod] + public void HashCode_Test_01() + { + // generate a hash code for a class with fields + SomeKey key = new(42); + + int hashCode = key.GetHashCode(); + + OutputHelper.WriteLine($"Hash code for SomeKey(42) is {hashCode}"); + OutputHelper.WriteLine($"Hash code for SomeKey(42) is {key.GetHashCode()}"); + + Assert.AreNotEqual(0, key.GetHashCode(), "Hash code for a class should not be 0"); + Assert.AreEqual($"{key.GetHashCode()}".GetHashCode(), $"{hashCode}".GetHashCode()); + } + + [TestMethod] + public void HashCode_Test_02() + { + // generate a hash code for a class without fields + SomeOtherKey key = new(); + + int hashCode = key.GetHashCode(); + + OutputHelper.WriteLine($"Hash code for SomeOtherKey is {hashCode}"); + OutputHelper.WriteLine($"Hash code for SomeOtherKey is {key.GetHashCode()}"); + + Assert.AreNotEqual(0, key.GetHashCode(), "Hash code for a class should not be 0"); + Assert.AreEqual($"{key.GetHashCode()}".GetHashCode(), $"{hashCode}".GetHashCode()); + } + + [TestMethod] + public void HashCode_Test_03() + { + // generate a hash code for a class with fields with different types + SomeOtherFunnyKey key = new(); + + int hashCode = key.GetHashCode(); + + OutputHelper.WriteLine($"Hash code for SomeOtherFunnyKey is {hashCode}"); + OutputHelper.WriteLine($"Hash code for SomeOtherFunnyKey is {key.GetHashCode()}"); + + Assert.AreNotEqual(0, key.GetHashCode(), "Hash code for a class should not be 0"); + Assert.AreEqual($"{key.GetHashCode()}".GetHashCode(), $"{hashCode}".GetHashCode()); + } + + public class SomeKey + { + public SomeKey(int value) + { + Value = value; + } + public int Value { get; } + } + + public class SomeOtherKey + { + public SomeOtherKey() + { + } + } + + public class SomeOtherFunnyKey + { + public string Name { get; set; } + + public int GetValue { get; set; } + + public SomeOtherFunnyKey() + { + } + } + + } +} From 4e0f337007d229410cf722eefbb01db6cabe386a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 29 Jan 2024 15:15:50 +0000 Subject: [PATCH 23/70] Work CI-CD - Rework variable declaration to include sign group. ***NO_CI*** --- azure-pipelines.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fbe43d39..1b7d4f3a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -48,11 +48,17 @@ jobs: vmImage: 'windows-latest' variables: - DOTNET_NOLOGO: true - solution: 'nanoFramework.CoreLibrary.sln' - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - nugetPackageName: 'nanoFramework.CoreLibrary' + - group: sign-client-credentials + - name: DOTNET_NOLOGO + value: true + - name: buildPlatform + value: 'Any CPU' + - name: buildConfiguration + value: 'Release' + - name: solution + value: 'nanoFramework.CoreLibrary.sln' + - name: nugetPackageName + value: 'nanoFramework.CoreLibrary' steps: From 05c5f5e03bdb7f13ff01a20003ef73892e547f69 Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Thu, 13 Jun 2024 02:17:54 -0700 Subject: [PATCH 24/70] Rework Unit Tests and Test Framework (#213) ***NO_CI*** --- .../UnitTestArithmeticTest1.cs | 158 +- .../UnitTestArithmeticTest2.cs | 200 +- .../UnitTestExpressionTests.cs | 862 ++++----- Tests/NFUnitTestArithmetic/UnitTestFormat.cs | 4 - .../UnitTestOtherArithmeticTests.cs | 1244 ++++++------- Tests/NFUnitTestArray/UnitTestOtherTests.cs | 58 +- Tests/NFUnitTestArray/UnitTestSimpleTests.cs | 554 +++--- .../UnitTestAttributesTest1.cs | 154 +- .../UnitTestBasicConceptsTests.cs | 1652 ++++++++--------- Tests/NFUnitTestBitConverter/BitConverter.cs | 4 +- .../UnitTestConstructorTest.cs | 154 +- .../NFUnitTestClasses/UnitTestConstsTests.cs | 428 ++--- .../UnitTestDeclarationTests.cs | 114 +- .../UnitTestDestructorTests.cs | 46 +- Tests/NFUnitTestClasses/UnitTestEventTests.cs | 2 +- Tests/NFUnitTestClasses/UnitTestFieldTests.cs | 362 ++-- .../NFUnitTestClasses/UnitTestIndexerTests.cs | 216 +-- .../NFUnitTestClasses/UnitTestMembersTests.cs | 634 +++---- .../NFUnitTestClasses/UnitTestMethodsTests.cs | 1292 ++++++------- .../UnitTestOperatorTests.cs | 82 +- .../UnitTestPropertiesTests.cs | 410 ++-- .../NFUnitTestClasses/UnitTestStaticTests.cs | 90 +- .../UnitTestExprefTests.cs | 54 +- .../UnitTestDelegatesTests.cs | 450 ++--- Tests/NFUnitTestEnum/UnitTestEnumTests.cs | 387 ++-- .../UnitTestExceptionTests.cs | 334 ++-- Tests/NFUnitTestGC/TestGC.cs | 4 +- Tests/NFUnitTestGC/TestGCWithByteArrays.cs | 6 +- .../NFUnitTestGC/TestGCWithDateTimeArrays.cs | 14 +- Tests/NFUnitTestGC/TestGCWithObjectArrays.cs | 6 +- Tests/NFUnitTestGC/TestGCWithStringArrays.cs | 14 +- .../NFUnitTestGC/TestGCWithTimeSpanArrays.cs | 14 +- .../UnitTestInterfaceTests.cs | 480 ++--- .../NFUnitTestLexical/UnitTestLExicalTest1.cs | 464 ++--- .../NFUnitTestLexical/UnitTestLexicalTest2.cs | 184 +- .../UnitTestNamespaceTests.cs | 204 +- .../UnitTestStatementTests.cs | 744 ++++---- Tests/NFUnitTestStruct/UnitTestStructs.cs | 56 +- Tests/NFUnitTestSystemLib/UnitTestDateTime.cs | 288 +-- Tests/NFUnitTestSystemLib/UnitTestGCTest.cs | 36 +- Tests/NFUnitTestSystemLib/UnitTestGuid.cs | 10 +- .../UnitTestInitLocalTests.cs | 4 +- .../UnitTestStringTests.cs | 138 +- Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs | 92 +- .../NFUnitTestSystemLib/UnitTestTypeTests.cs | 82 +- .../UnitTestWeakReferenceTests.cs | 16 +- .../UnitTestAutoResetEvents.cs | 100 +- .../NFUnitTestThread/UnitTestInterlocTests.cs | 50 +- .../NFUnitTestThread/UnitTestMonitorTests.cs | 50 +- Tests/NFUnitTestThread/UnitTestThreadTest.cs | 216 +-- Tests/NFUnitTestThread/UnitTestTimeTests.cs | 150 +- .../NFUnitTestThread/UnitTestTimeoutTests.cs | 22 +- .../UnitTestWaitHandleTests.cs | 45 +- .../UnitTestObjectTypeTests.cs | 14 +- .../UnitTestValueArrayTypess.cs | 50 +- .../UnitTestValueDefultConstTests.cs | 28 +- .../UnitTestValueFloatTests.cs | 54 +- .../UnitTestValueIntegralTests.cs | 446 ++--- .../UnitTestValueSimpleTests.cs | 58 +- Tests/NFUnitTestVariables/CategoryTests.cs | 552 +++--- Tests/NFUnitTestVariables/VariableTests.cs | 172 +- Tests/TestFramework/TestFramework.nfproj | 7 +- nanoFramework.TestFramework | 2 +- 63 files changed, 7296 insertions(+), 7521 deletions(-) diff --git a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs index 5776214d..ce80ef06 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs @@ -14,307 +14,307 @@ public class UnitTestArithmeticTest1 [TestMethod] public void Arith_arith001_Test() { - OutputHelper.WriteLine("Section 7.4 "); - OutputHelper.WriteLine("This code tests basic literal integral arthimetic additive expressions."); + // Section 7.4 + // This code tests basic literal integral arthimetic additive expressions. Assert.IsTrue(Arith_TestClass_arith001.testMethod()); } [TestMethod] public void Arith_arith003_Test() { - OutputHelper.WriteLine("Section 7.4 "); - OutputHelper.WriteLine("This code tests basic literal integral arthimetic multiplicative expressions."); + // Section 7.4 + // This code tests basic literal integral arthimetic multiplicative expressions. Assert.IsTrue(Arith_TestClass_arith003.testMethod()); } [TestMethod] public void Arith_arith005_Test() { - OutputHelper.WriteLine("Section 7.4 "); - OutputHelper.WriteLine("This code tests basic integral arthimetic additive expressions using variables."); + // Section 7.4 + // This code tests basic integral arthimetic additive expressions using variables. Assert.IsTrue(Arith_TestClass_arith005.testMethod()); } [TestMethod] public void Arith_arith007_Test() { - OutputHelper.WriteLine("Section 7.4 "); - OutputHelper.WriteLine("This code tests basic integral arthimetic multiplicative expressions with variables."); + // Section 7.4 + // This code tests basic integral arthimetic multiplicative expressions with variables. Assert.IsTrue(Arith_TestClass_arith007.testMethod()); } [TestMethod] public void Arith_arith023_Test() { - OutputHelper.WriteLine("Section 7.4 "); - OutputHelper.WriteLine("This code tests enum additive expressions."); + // Section 7.4 + // This code tests enum additive expressions. Assert.IsTrue(Arith_TestClass_arith023.testMethod()); } [TestMethod] public void Arith_arith024_Test() { - OutputHelper.WriteLine("Section 7.4 "); - OutputHelper.WriteLine("This code tests enum additive expressions."); + // Section 7.4 + // This code tests enum additive expressions. Assert.IsTrue(Arith_TestClass_arith024.testMethod()); } [TestMethod] public void Arith_arith028_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith028.testMethod()); } [TestMethod] public void Arith_arith029_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith029.testMethod()); } [TestMethod] public void Arith_arith030_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith030.testMethod()); } [TestMethod] public void Arith_arith031_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith031.testMethod()); } [TestMethod] public void Arith_arith032_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith032.testMethod()); } [TestMethod] public void Arith_arith033_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith033.testMethod()); } [TestMethod] public void Arith_arith034_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith034.testMethod()); } [TestMethod] public void Arith_arith035_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith035.testMethod()); } [TestMethod] public void Arith_arith036_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith036.testMethod()); } [TestMethod] public void Arith_arith037_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith037.testMethod()); } [TestMethod] public void Arith_arith038_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith038.testMethod()); } [TestMethod] public void Arith_arith039_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith039.testMethod()); } [TestMethod] public void Arith_arith040_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith040.testMethod()); } [TestMethod] public void Arith_arith041_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith041.testMethod()); } [TestMethod] public void Arith_arith042_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith042.testMethod()); } [TestMethod] public void Arith_arith043_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith043.testMethod()); } [TestMethod] public void Arith_arith044_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith044.testMethod()); } [TestMethod] public void Arith_arith045_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith045.testMethod()); } [TestMethod] public void Arith_arith046_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith046.testMethod()); } [TestMethod] public void Arith_arith047_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith047.testMethod()); } [TestMethod] public void Arith_arith048_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith048.testMethod()); } [TestMethod] public void Arith_arith049_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith049.testMethod()); } [TestMethod] public void Arith_arith050_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith050.testMethod()); } [TestMethod] public void Arith_arith051_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith051.testMethod()); } [TestMethod] public void Arith_arith052_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith052.testMethod()); } [TestMethod] public void Arith_arith053_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith053.testMethod()); } [TestMethod] public void Arith_arith054_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith054.testMethod()); } [TestMethod] public void Arith_arith055_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith055.testMethod()); } [TestMethod] public void Arith_arith056_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith056.testMethod()); } [TestMethod] public void Arith_arith057_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith057.testMethod()); } [TestMethod] public void Arith_arith058_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith058.testMethod()); } [TestMethod] public void Arith_arith059_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith059.testMethod()); } [TestMethod] public void Arith_arith060_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith060.testMethod()); } [TestMethod] public void Arith_arith061_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith061.testMethod()); } [TestMethod] public void Arith_arith062_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith062.testMethod()); } [TestMethod] public void Arith_arith064_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith064.testMethod()); } [TestMethod] public void Arith_arith065_Test() { - OutputHelper.WriteLine("Section 7.7"); + // Section 7.7 Assert.IsTrue(Arith_TestClass_arith065.testMethod()); } @@ -328,25 +328,25 @@ public static int Main_old() if (5 != (3 + 2)) { intRet = 1; - OutputHelper.WriteLine("Failure at Scenario 1"); + // Failure at Scenario 1 } //Scenario 2: type int if (4 != (9 - 5)) { - OutputHelper.WriteLine("Failure at Scenario 2"); + // Failure at Scenario 2 intRet = 1; } //Scenario 7: type long if (1047L != (999L + 48L)) { - OutputHelper.WriteLine("Failure at Scenario 7"); + // Failure at Scenario 7 intRet = 1; } //Scenario 8: type long if (441L != (786L - 345L)) { - OutputHelper.WriteLine("Failure at Scenario 8"); + // Failure at Scenario 8 intRet = 1; } return intRet; @@ -364,38 +364,38 @@ public static int Main_old() //Scenario 1: type int if (12 != (4 * 3)) { - OutputHelper.WriteLine("Failure at Scenario 1"); + // Failure at Scenario 1 intRet = 1; } //Scenario 2: type int if (4 != (8 / 2)) { - OutputHelper.WriteLine("Failure at Scenario 2"); + // Failure at Scenario 2 intRet = 1; } //Scenario 3; type int if (14 != (64 % 25)) { - OutputHelper.WriteLine("Failure at Scenario 3"); + // Failure at Scenario 3 intRet = 1; } //Scenario 10: type long if (361362L != (458L * 789L)) { - OutputHelper.WriteLine("Failure at Scenario 10"); + // Failure at Scenario 10 intRet = 1; } //Scenario 11: type long if (36L != (32004L / 889L)) { - OutputHelper.WriteLine("Failure at Scenario 11"); + // Failure at Scenario 11 intRet = 1; } //Scenario 12: type long if (29L != (985013L % 56L)) { - OutputHelper.WriteLine("Failure at Scenario 12"); + // Failure at Scenario 12 intRet = 1; } return intRet; @@ -429,7 +429,7 @@ public static int Main_old() i3 = 5; if (i1 != (i2 + i3)) { - OutputHelper.WriteLine("Failure at Scenario 1"); + // Failure at Scenario 1 intRet = 1; } //Scenario 2: type int @@ -438,7 +438,7 @@ public static int Main_old() i3 = 3; if (i1 != (i2 - i3)) { - OutputHelper.WriteLine("Failure at Scenario 2"); + // Failure at Scenario 2 intRet = 1; } //Scenario 3: type byte @@ -447,7 +447,7 @@ public static int Main_old() b3 = 2; if (b1 != (b2 + b3)) { - OutputHelper.WriteLine("Failure at Scenario 3"); + // Failure at Scenario 3 intRet = 1; } //Scenario 4: type byte @@ -456,7 +456,7 @@ public static int Main_old() b3 = 39; if (b1 != (b2 - b3)) { - OutputHelper.WriteLine("Failure at Scenario 4"); + // Failure at Scenario 4 intRet = 1; } //Scenario 5: type short @@ -465,7 +465,7 @@ public static int Main_old() s3 = 22; if (s1 != (s2 + s3)) { - OutputHelper.WriteLine("Failure at Scenario 5"); + // Failure at Scenario 5 intRet = 1; } //Scenario 6: type short @@ -474,7 +474,7 @@ public static int Main_old() s3 = 14; if (s1 != (s2 - s3)) { - OutputHelper.WriteLine("Failure at Scenario 6"); + // Failure at Scenario 6 intRet = 1; } //Scenario 7: type long @@ -483,7 +483,7 @@ public static int Main_old() l3 = 855L; if (l1 != (l2 + l3)) { - OutputHelper.WriteLine("Failure at Scenario 7"); + // Failure at Scenario 7 intRet = 1; } //Scenario 8: type long @@ -492,7 +492,7 @@ public static int Main_old() l3 = 136920L; if (l1 != (l2 - l3)) { - OutputHelper.WriteLine("Failure at Scenario 8"); + // Failure at Scenario 8 intRet = 1; } return intRet; @@ -526,7 +526,7 @@ public static int Main_old() i3 = 6; if (i1 != (i2 * i3)) { - OutputHelper.WriteLine("Failure at Scenario 1"); + // Failure at Scenario 1 intRet = 1; } //Scenario 2: type int @@ -535,7 +535,7 @@ public static int Main_old() i3 = 14; if (i1 != (i2 / i3)) { - OutputHelper.WriteLine("Failure at Scenario 2"); + // Failure at Scenario 2 intRet = 1; } //Scenario 3; type int @@ -544,7 +544,7 @@ public static int Main_old() i3 = 31; if (i1 != (i2 % i3)) { - OutputHelper.WriteLine("Failure at Scenario 3"); + // Failure at Scenario 3 intRet = 1; } //Scenario 4: type byte @@ -553,7 +553,7 @@ public static int Main_old() b3 = 47; if (b1 != (b2 * b3)) { - OutputHelper.WriteLine("Failure at Scenario 4"); + // Failure at Scenario 4 intRet = 1; } //Scenario 5: type byte @@ -562,7 +562,7 @@ public static int Main_old() b3 = 6; if (b1 != (b2 / b3)) { - OutputHelper.WriteLine("Failure at Scenario 5"); + // Failure at Scenario 5 intRet = 1; } //Scenario 6: type byte @@ -571,7 +571,7 @@ public static int Main_old() b3 = 86; if (b1 != (b2 % b3)) { - OutputHelper.WriteLine("Failure at Scenario 6"); + // Failure at Scenario 6 intRet = 1; } //Scenario 7: type short @@ -580,7 +580,7 @@ public static int Main_old() s3 = 35; if (s1 != (s2 * s3)) { - OutputHelper.WriteLine("Failure at Scenario 7"); + // Failure at Scenario 7 intRet = 1; } //Scenario 8: type short @@ -589,7 +589,7 @@ public static int Main_old() s3 = 26; if (s1 != (s2 / s3)) { - OutputHelper.WriteLine("Failure at Scenario 8"); + // Failure at Scenario 8 intRet = 1; } //Scenario 9: type short @@ -598,7 +598,7 @@ public static int Main_old() s3 = 90; if (s1 != (s2 % s3)) { - OutputHelper.WriteLine("Failure at Scenario 9"); + // Failure at Scenario 9 intRet = 1; } //Scenario 10: type long @@ -607,7 +607,7 @@ public static int Main_old() l3 = 98L; if (l1 != (l2 * l3)) { - OutputHelper.WriteLine("Failure at Scenario 10"); + // Failure at Scenario 10 intRet = 1; } //Scenario 11: type long @@ -616,7 +616,7 @@ public static int Main_old() l3 = 7L; if (l1 != (l2 / l3)) { - OutputHelper.WriteLine("Failure at Scenario 11"); + // Failure at Scenario 11 intRet = 1; } //Scenario 12: type long @@ -625,7 +625,7 @@ public static int Main_old() l3 = 458L; if (l1 != (l2 % l3)) { - OutputHelper.WriteLine("Failure at Scenario 12"); + // Failure at Scenario 12 intRet = 1; } return intRet; diff --git a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs index f2c39ef5..4378a870 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs @@ -39,699 +39,699 @@ public void Arith_opt004_Test() [TestMethod] public void Arith_mult0001_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0001.testMethod()); } [TestMethod] public void Arith_mult0002_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0002.testMethod()); } [TestMethod] public void Arith_mult0003_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0003.testMethod()); } [TestMethod] public void Arith_mult0004_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0004.testMethod()); } [TestMethod] public void Arith_mult0008_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0008.testMethod()); } [TestMethod] public void Arith_mult0009_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0009.testMethod()); } [TestMethod] public void Arith_mult0010_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0010.testMethod()); } [TestMethod] public void Arith_mult0011_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0011.testMethod()); } [TestMethod] public void Arith_mult0015_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0015.testMethod()); } [TestMethod] public void Arith_mult0016_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0016.testMethod()); } [TestMethod] public void Arith_mult0017_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0017.testMethod()); } [TestMethod] public void Arith_mult0018_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0018.testMethod()); } [TestMethod] public void Arith_mult0022_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0022.testMethod()); } [TestMethod] public void Arith_mult0023_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0023.testMethod()); } [TestMethod] public void Arith_mult0024_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0024.testMethod()); } [TestMethod] public void Arith_mult0025_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0025.testMethod()); } [TestMethod] public void Arith_mult0050_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0050.testMethod()); } [TestMethod] public void Arith_mult0051_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0051.testMethod()); } [TestMethod] public void Arith_mult0052_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0052.testMethod()); } [TestMethod] public void Arith_mult0053_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0053.testMethod()); } [TestMethod] public void Arith_mult0057_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0057.testMethod()); } [TestMethod] public void Arith_mult0058_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0058.testMethod()); } [TestMethod] public void Arith_mult0059_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0059.testMethod()); } [TestMethod] public void Arith_mult0060_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0060.testMethod()); } [TestMethod] public void Arith_mult0064_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0064.testMethod()); } [TestMethod] public void Arith_mult0065_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0065.testMethod()); } [TestMethod] public void Arith_mult0066_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0066.testMethod()); } [TestMethod] public void Arith_mult0067_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0067.testMethod()); } [TestMethod] public void Arith_mult0071_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0071.testMethod()); } [TestMethod] public void Arith_mult0072_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0072.testMethod()); } [TestMethod] public void Arith_mult0073_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0073.testMethod()); } [TestMethod] public void Arith_mult0074_Test() { - OutputHelper.WriteLine("Section 7.7.1"); + // Section 7.7.1 Assert.IsTrue(Arith_TestClass_mult0074.testMethod()); } [TestMethod] public void Arith_div0001_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0001.testMethod()); } [TestMethod] public void Arith_div0002_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0002.testMethod()); } [TestMethod] public void Arith_div0008_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0008.testMethod()); } [TestMethod] public void Arith_div0009_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0009.testMethod()); } [TestMethod] public void Arith_div0015_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0015.testMethod()); } [TestMethod] public void Arith_div0016_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0016.testMethod()); } [TestMethod] public void Arith_div0022_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0022.testMethod()); } [TestMethod] public void Arith_div0023_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0023.testMethod()); } [TestMethod] public void Arith_div0050_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0050.testMethod()); } [TestMethod] public void Arith_div0051_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0051.testMethod()); } [TestMethod] public void Arith_div0057_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0057.testMethod()); } [TestMethod] public void Arith_div0058_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0058.testMethod()); } [TestMethod] public void Arith_div0064_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0064.testMethod()); } [TestMethod] public void Arith_div0065_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0065.testMethod()); } [TestMethod] public void Arith_div0071_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0071.testMethod()); } [TestMethod] public void Arith_div0072_Test() { - OutputHelper.WriteLine("Section 7.7.2"); + // Section 7.7.2 Assert.IsTrue(Arith_TestClass_div0072.testMethod()); } [TestMethod] public void Arith_rem0001_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0001.testMethod()); } [TestMethod] public void Arith_rem0002_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0002.testMethod()); } [TestMethod] public void Arith_rem0008_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0008.testMethod()); } [TestMethod] public void Arith_rem0009_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0009.testMethod()); } [TestMethod] public void Arith_rem0015_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0015.testMethod()); } [TestMethod] public void Arith_rem0016_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0016.testMethod()); } [TestMethod] public void Arith_rem0022_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0022.testMethod()); } [TestMethod] public void Arith_rem0023_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0023.testMethod()); } [TestMethod] public void Arith_rem0050_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0050.testMethod()); } [TestMethod] public void Arith_rem0051_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0051.testMethod()); } [TestMethod] public void Arith_rem0057_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0057.testMethod()); } [TestMethod] public void Arith_rem0058_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0058.testMethod()); } [TestMethod] public void Arith_rem0064_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0064.testMethod()); } [TestMethod] public void Arith_rem0065_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0065.testMethod()); } [TestMethod] public void Arith_rem0071_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0071.testMethod()); } [TestMethod] public void Arith_rem0072_Test() { - OutputHelper.WriteLine("Section 7.7.3"); + // Section 7.7.3 Assert.IsTrue(Arith_TestClass_rem0072.testMethod()); } [TestMethod] public void Arith_add0001_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0001.testMethod()); } [TestMethod] public void Arith_add0002_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0002.testMethod()); } [TestMethod] public void Arith_add0003_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0003.testMethod()); } [TestMethod] public void Arith_add0007_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0007.testMethod()); } [TestMethod] public void Arith_add0008_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0008.testMethod()); } [TestMethod] public void Arith_add0009_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0009.testMethod()); } [TestMethod] public void Arith_add0013_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0013.testMethod()); } [TestMethod] public void Arith_add0014_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0014.testMethod()); } [TestMethod] public void Arith_add0015_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0015.testMethod()); } [TestMethod] public void Arith_add0037_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0037.testMethod()); } [TestMethod] public void Arith_add0038_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0038.testMethod()); } [TestMethod] public void Arith_add0039_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0039.testMethod()); } [TestMethod] public void Arith_add0043_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0043.testMethod()); } [TestMethod] public void Arith_add0044_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0044.testMethod()); } [TestMethod] public void Arith_add0045_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0045.testMethod()); } [TestMethod] public void Arith_add0049_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0049.testMethod()); } [TestMethod] public void Arith_add0050_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0050.testMethod()); } [TestMethod] public void Arith_add0051_Test() { - OutputHelper.WriteLine("Section 7.7.4"); + // Section 7.7.4 Assert.IsTrue(Arith_TestClass_add0051.testMethod()); } [TestMethod] public void Arith_sub0001_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0001.testMethod()); } [TestMethod] public void Arith_sub0002_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0002.testMethod()); } [TestMethod] public void Arith_sub0003_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0003.testMethod()); } [TestMethod] public void Arith_sub0007_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0007.testMethod()); } [TestMethod] public void Arith_sub0008_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0008.testMethod()); } [TestMethod] public void Arith_sub0009_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0009.testMethod()); } [TestMethod] public void Arith_sub0013_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0013.testMethod()); } [TestMethod] public void Arith_sub0014_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0014.testMethod()); } [TestMethod] public void Arith_sub0015_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0015.testMethod()); } [TestMethod] public void Arith_sub0037_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0037.testMethod()); } [TestMethod] public void Arith_sub0038_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0038.testMethod()); } [TestMethod] public void Arith_sub0039_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0039.testMethod()); } [TestMethod] public void Arith_sub0043_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0043.testMethod()); } [TestMethod] public void Arith_sub0044_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0044.testMethod()); } [TestMethod] public void Arith_sub0045_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0045.testMethod()); } [TestMethod] public void Arith_sub0049_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0049.testMethod()); } [TestMethod] public void Arith_sub0050_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0050.testMethod()); } [TestMethod] public void Arith_sub0051_Test() { - OutputHelper.WriteLine("Section 7.7.5"); + // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0051.testMethod()); } diff --git a/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs b/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs index caf2ac18..ef83372f 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs @@ -16,394 +16,394 @@ class UnitTestExpressionTests [TestMethod] public void Exp_ident001_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within a block, and the block contains a local variable or parameter with the "); - OutputHelper.WriteLine("given name, then the primary-expression refers to that local variable."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within a block, and the block contains a local variable or parameter with the + // given name, then the primary-expression refers to that local variable. Assert.IsTrue(ident001.testMethod()); } [TestMethod] public void Exp_ident002_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within a block, and the block contains a local variable or parameter with the "); - OutputHelper.WriteLine("given name, then the primary-expression refers to that local variable."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within a block, and the block contains a local variable or parameter with the + // given name, then the primary-expression refers to that local variable. Assert.IsTrue(ident002.testMethod()); } [TestMethod] public void Exp_ident003_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within a block, and the block contains a local variable or parameter with the "); - OutputHelper.WriteLine("given name, then the primary-expression refers to that local variable."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within a block, and the block contains a local variable or parameter with the + // given name, then the primary-expression refers to that local variable. Assert.IsTrue(ident003.testMethod()); } [TestMethod] public void Exp_ident004_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within a block, and the block contains a local variable or parameter with the "); - OutputHelper.WriteLine("given name, then the primary-expression refers to that local variable."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within a block, and the block contains a local variable or parameter with the + // given name, then the primary-expression refers to that local variable. Assert.IsTrue(ident004.testMethod()); } [TestMethod] public void Exp_ident007_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies one or more accessible methods of the immediately enclosing"); - OutputHelper.WriteLine("class, then the primary expression refers to that method."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies one or more accessible methods of the immediately enclosing + // class, then the primary expression refers to that method. Assert.IsTrue(ident007.testMethod()); } [TestMethod] public void Exp_ident008_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies one or more accessible methods of the immediately enclosing"); - OutputHelper.WriteLine("class, then the primary expression refers to that method."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies one or more accessible methods of the immediately enclosing + // class, then the primary expression refers to that method. Assert.IsTrue(ident008.testMethod()); } [TestMethod] public void Exp_ident009_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies one or more accessible methods of the immediately enclosing"); - OutputHelper.WriteLine("class, then the primary expression refers to that method."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies one or more accessible methods of the immediately enclosing + // class, then the primary expression refers to that method. Assert.IsTrue(ident009.testMethod()); } [TestMethod] public void Exp_ident010_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies one or more accessible methods of the immediately enclosing"); - OutputHelper.WriteLine("class, then the primary expression refers to that method."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies one or more accessible methods of the immediately enclosing + // class, then the primary expression refers to that method. Assert.IsTrue(ident010.testMethod()); } [TestMethod] public void Exp_ident011_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies an accessible, non-static field or property of the immediately"); - OutputHelper.WriteLine("enclosing class, then the primary expression refers to that field or property."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies an accessible, non-static field or property of the immediately + // enclosing class, then the primary expression refers to that field or property. Assert.IsTrue(ident011.testMethod()); } [TestMethod] public void Exp_ident012_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies an accessible, non-static field or property of the immediately"); - OutputHelper.WriteLine("enclosing class, then the primary expression refers to that field or property."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies an accessible, non-static field or property of the immediately + // enclosing class, then the primary expression refers to that field or property. Assert.IsTrue(ident012.testMethod()); } [TestMethod] public void Exp_ident013_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of a single identifier "); - OutputHelper.WriteLine("is within the block of a constructor, instance method, or instance property accessor,"); - OutputHelper.WriteLine("and the name identifies an accessible, non-static field or property of the immediately"); - OutputHelper.WriteLine("enclosing class, then the primary expression refers to that field or property."); + // Section 7.2.2 + // This code tests that if the primary expression consisting of a single identifier + // is within the block of a constructor, instance method, or instance property accessor, + // and the name identifies an accessible, non-static field or property of the immediately + // enclosing class, then the primary expression refers to that field or property. Assert.IsTrue(ident013.testMethod()); } [TestMethod] public void Exp_ident014_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident014.testMethod()); } [TestMethod] public void Exp_ident015_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident015.testMethod()); } [TestMethod] public void Exp_ident016_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident016.testMethod()); } [TestMethod] public void Exp_ident017_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident017.testMethod()); } [TestMethod] public void Exp_ident018_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident018.testMethod()); } [TestMethod] public void Exp_ident019_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident019_Top.ident019.testMethod()); } [TestMethod] public void Exp_ident020_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident020_Top.ident020.testMethod()); } [TestMethod] public void Exp_ident021_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident021_Top.ident021.testMethod()); } [TestMethod] public void Exp_ident022_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident022_Top.ident022.testMethod()); } [TestMethod] public void Exp_ident023_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident023_Top.ident023.testMethod()); } [TestMethod] public void Exp_ident024_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident024_Top.ident024.testMethod()); } [TestMethod] public void Exp_ident025_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident025_Top.ident025_Next.ident025.testMethod()); } [TestMethod] public void Exp_ident026_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident026_Top.ident026_Next.ident026.testMethod()); } [TestMethod] public void Exp_ident027_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident027_Top.ident027_Next.ident027.testMethod()); } [TestMethod] public void Exp_ident028_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if the primary expression appears within the body of a class, "); - OutputHelper.WriteLine("struct, or enumeration declaration, and continuing with each enclosing class or struct"); - OutputHelper.WriteLine("declaration, if the name identifies one or more accessible members of that class, "); - OutputHelper.WriteLine("struct, or enumeration, then the primary expression is evaluated exactly as if it was "); - OutputHelper.WriteLine("a member access of the form T.E where T is the type in which the member was found and "); - OutputHelper.WriteLine("E is the primary expression."); + // Section 7.2.2 + // This code tests that if the primary expression appears within the body of a class, + // struct, or enumeration declaration, and continuing with each enclosing class or struct + // declaration, if the name identifies one or more accessible members of that class, + // struct, or enumeration, then the primary expression is evaluated exactly as if it was + // a member access of the form T.E where T is the type in which the member was found and + // E is the primary expression. Assert.IsTrue(ident028_Top.ident028_Next.ident028.testMethod()); } [TestMethod] public void Exp_ident029_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to a member in an enclosing namespace, then the primary expression is evaluated "); - OutputHelper.WriteLine("to that member and classified as a namespace or a type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to a member in an enclosing namespace, then the primary expression is evaluated + // to that member and classified as a namespace or a type. Assert.IsTrue(ident029.testMethod()); } [TestMethod] public void Exp_ident030_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to a member in an enclosing namespace, then the primary expression is evaluated "); - OutputHelper.WriteLine("to that member and classified as a namespace or a type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to a member in an enclosing namespace, then the primary expression is evaluated + // to that member and classified as a namespace or a type. Assert.IsTrue(ident030.testMethod()); } [TestMethod] public void Exp_ident031_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to a member in an enclosing namespace, then the primary expression is evaluated "); - OutputHelper.WriteLine("to that member and classified as a namespace or a type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to a member in an enclosing namespace, then the primary expression is evaluated + // to that member and classified as a namespace or a type. Assert.IsTrue(NS_ident031_I.ident031.testMethod()) ; } [TestMethod] public void Exp_ident032_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to an imported type, then the primary expression refers to that type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to an imported type, then the primary expression refers to that type. Assert.IsTrue(NS_ident032_I.ident032.testMethod()) ; } [TestMethod] public void Exp_ident033_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to an imported type, then the primary expression refers to that type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to an imported type, then the primary expression refers to that type. Assert.IsTrue(NS_ident033_O.NS_ident033_I.ident033.testMethod()) ; } [TestMethod] public void Exp_ident034_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to a single type in an imported namespace, then the primary expression refers to that "); - OutputHelper.WriteLine("type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to a single type in an imported namespace, then the primary expression refers to that + // type. Assert.IsTrue(NS_ident034_I.ident034.testMethod()) ; } [TestMethod] public void Exp_ident035_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to a single type in an imported namespace, then the primary expression refers to that "); - OutputHelper.WriteLine("type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to a single type in an imported namespace, then the primary expression refers to that + // type. Assert.IsTrue(NS_ident035_O.NS_ident035_I.ident035.testMethod()) ; } [TestMethod] public void Exp_ident038_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to an imported type, then the primary expression refers to that type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to an imported type, then the primary expression refers to that type. Assert.IsTrue(NS_ident038_I.ident038.testMethod()) ; } [TestMethod] public void Exp_ident039_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to an imported type, then the primary expression refers to that type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to an imported type, then the primary expression refers to that type. Assert.IsTrue(NS_ident039_O.NS_ident039_I.ident039.testMethod()) ; } [TestMethod] public void Exp_ident040_Test() { - OutputHelper.WriteLine("Section 7.2.2 "); - OutputHelper.WriteLine("This code tests that if a primary expression consisting of a single identifier refers "); - OutputHelper.WriteLine("to an imported type, then the primary expression refers to that type."); + // Section 7.2.2 + // This code tests that if a primary expression consisting of a single identifier refers + // to an imported type, then the primary expression refers to that type. Assert.IsTrue(NS_ident040_I.ident040.testMethod()) ; } [TestMethod] public void Exp_mem001_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a namespace and I is the name of an accessible member of that namespace, then the "); - OutputHelper.WriteLine("result is the member, either a namespace or a type."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a namespace and I is the name of an accessible member of that namespace, then the + // result is the member, either a namespace or a type. Assert.IsTrue(mem001.testMethod()) ; } /* [TestMethod] public void Exp_mem002_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a namespace and I is the name of an accessible member of that namespace, then the "); - OutputHelper.WriteLine("result is the member, either a namespace or a type."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a namespace and I is the name of an accessible member of that namespace, then the + // result is the member, either a namespace or a type. Assert.IsTrue(mem002.testMethod()) { return MFTestResults.Pass; @@ -414,563 +414,563 @@ public void Exp_mem002_Test() [TestMethod] public void Exp_mem003_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is also a type, then the result of the member is that type."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is also a type, then the result of the member is that type. Assert.IsTrue(mem003.testMethod()) ; } [TestMethod] public void Exp_mem004_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is also a type, then the result of the member is that type."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is also a type, then the result of the member is that type. Assert.IsTrue(mem004.testMethod()) ; } [TestMethod] public void Exp_mem005_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I identifies one or more methods, then the result is a method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I identifies one or more methods, then the result is a method group. Assert.IsTrue(mem005.testMethod()); } [TestMethod] public void Exp_mem006_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I identifies one or more methods, then the result is a method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I identifies one or more methods, then the result is a method group. Assert.IsTrue(mem006.testMethod()); } [TestMethod] public void Exp_mem007_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I identifies one or more methods, then the result is a method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I identifies one or more methods, then the result is a method group. Assert.IsTrue(mem007.testMethod()); } [TestMethod] public void Exp_mem008_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I identifies one or more methods, then the result is a method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I identifies one or more methods, then the result is a method group. Assert.IsTrue(mem008.testMethod()); } [TestMethod] public void Exp_mem011_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a static property, then the result is that static property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a static property, then the result is that static property. Assert.IsTrue(mem011.testMethod()); } [TestMethod] public void Exp_mem012_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a static property, then the result is that static property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a static property, then the result is that static property. Assert.IsTrue(mem012.testMethod()); } [TestMethod] public void Exp_mem013_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a static read only field, then the result is a value of the "); - OutputHelper.WriteLine("static field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a static read only field, then the result is a value of the + // static field I. Assert.IsTrue(mem013.testMethod()); } [TestMethod] public void Exp_mem014_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a static read only field, then the result is a value of the "); - OutputHelper.WriteLine("static field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a static read only field, then the result is a value of the + // static field I. Assert.IsTrue(mem014.testMethod()); } [TestMethod] public void Exp_mem015_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a static field, then the result is the static field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a static field, then the result is the static field I. Assert.IsTrue(mem015.testMethod()); } [TestMethod] public void Exp_mem016_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a static field, then the result is the static field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a static field, then the result is the static field I. Assert.IsTrue(mem016.testMethod()); } [TestMethod] public void Exp_mem017_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a constant, then the result is the value of that constant."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a constant, then the result is the value of that constant. Assert.IsTrue(mem017.testMethod()); } [TestMethod] public void Exp_mem018_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I is a constant, then the result is the value of that constant."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I is a constant, then the result is the value of that constant. Assert.IsTrue(mem018.testMethod()); } [TestMethod] public void Exp_mem019_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a type and I identifies an enumeration member, then the result is the value of"); - OutputHelper.WriteLine("that enumeration member."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a type and I identifies an enumeration member, then the result is the value of + // that enumeration member. Assert.IsTrue(mem019.testMethod()); } [TestMethod] public void Exp_mem021_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies one or "); - OutputHelper.WriteLine("more method groups, then the result is the method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies one or + // more method groups, then the result is the method group. Assert.IsTrue(mem021.testMethod()); } [TestMethod] public void Exp_mem022_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies one or "); - OutputHelper.WriteLine("more method groups, then the result is the method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies one or + // more method groups, then the result is the method group. Assert.IsTrue(mem022.testMethod()); } [TestMethod] public void Exp_mem023_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies one or "); - OutputHelper.WriteLine("more method groups, then the result is the method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies one or + // more method groups, then the result is the method group. Assert.IsTrue(mem023.testMethod()); } [TestMethod] public void Exp_mem025_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies one or "); - OutputHelper.WriteLine("more method groups, then the result is the method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies one or + // more method groups, then the result is the method group. Assert.IsTrue(mem025.testMethod()); } [TestMethod] public void Exp_mem026_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies one or "); - OutputHelper.WriteLine("more method groups, then the result is the method group."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies one or + // more method groups, then the result is the method group. Assert.IsTrue(mem026.testMethod()); } [TestMethod] public void Exp_mem027_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies an "); - OutputHelper.WriteLine("instance property, then the result is that instance property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies an + // instance property, then the result is that instance property. Assert.IsTrue(mem027.testMethod()); } [TestMethod] public void Exp_mem028_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies an "); - OutputHelper.WriteLine("instance property, then the result is that instance property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies an + // instance property, then the result is that instance property. Assert.IsTrue(mem028.testMethod()); } [TestMethod] public void Exp_mem029_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies an "); - OutputHelper.WriteLine("instance property, then the result is that instance property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies an + // instance property, then the result is that instance property. Assert.IsTrue(mem029.testMethod()); } [TestMethod] public void Exp_mem031_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies an "); - OutputHelper.WriteLine("instance property, then the result is that instance property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies an + // instance property, then the result is that instance property. Assert.IsTrue(mem031.testMethod()); } [TestMethod] public void Exp_mem032_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the type of which is T, and I identifies an "); - OutputHelper.WriteLine("instance property, then the result is that instance property."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the type of which is T, and I identifies an + // instance property, then the result is that instance property. Assert.IsTrue(mem032.testMethod()); } [TestMethod] public void Exp_mem034_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field, then if the value of E is null, a System.Exception is "); - OutputHelper.WriteLine("thrown."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field, then if the value of E is null, a System.Exception is + // thrown. Assert.IsTrue(mem034.testMethod()); } [TestMethod] public void Exp_mem035_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field, then if the value of E is null, a System.Exception is "); - OutputHelper.WriteLine("thrown."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field, then if the value of E is null, a System.Exception is + // thrown. Assert.IsTrue(mem035.testMethod()); } [TestMethod] public void Exp_mem036_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("a read only instance field outside the class declaration, then the result is a value"); - OutputHelper.WriteLine("of the field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // a read only instance field outside the class declaration, then the result is a value + // of the field I. Assert.IsTrue(mem036.testMethod()); } [TestMethod] public void Exp_mem038_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("a read only instance field outside the class declaration, then the result is a value"); - OutputHelper.WriteLine("of the field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // a read only instance field outside the class declaration, then the result is a value + // of the field I. Assert.IsTrue(mem038.testMethod()); } [TestMethod] public void Exp_mem040_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("a read only instance field outside the class declaration, then the result is a value"); - OutputHelper.WriteLine("of the field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // a read only instance field outside the class declaration, then the result is a value + // of the field I. Assert.IsTrue(mem040.testMethod()); } [TestMethod] public void Exp_mem042_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem042.testMethod()); } [TestMethod] public void Exp_mem043_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem043.testMethod()); } [TestMethod] public void Exp_mem044_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem044.testMethod()); } [TestMethod] public void Exp_mem045_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem045.testMethod()); } [TestMethod] public void Exp_mem046_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem046.testMethod()); } [TestMethod] public void Exp_mem047_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the class type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the class type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem047.testMethod()); } [TestMethod] public void Exp_mem048_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("a read only instance field outside the class declaration, then the result is a value"); - OutputHelper.WriteLine("of the field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // a read only instance field outside the class declaration, then the result is a value + // of the field I. Assert.IsTrue(mem048.testMethod()); } [TestMethod] public void Exp_mem050_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("a read only instance field outside the class declaration, then the result is a value"); - OutputHelper.WriteLine("of the field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // a read only instance field outside the class declaration, then the result is a value + // of the field I. Assert.IsTrue(mem050.testMethod()); } [TestMethod] public void Exp_mem052_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests that if the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("a read only instance field outside the class declaration, then the result is a value"); - OutputHelper.WriteLine("of the field I."); + // Section 7.2.7 + // This code tests that if the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // a read only instance field outside the class declaration, then the result is a value + // of the field I. Assert.IsTrue(mem052.testMethod()); } [TestMethod] public void Exp_mem054_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem054.testMethod()); } [TestMethod] public void Exp_mem055_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem055.testMethod()); } [TestMethod] public void Exp_mem056_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem056.testMethod()); } [TestMethod] public void Exp_mem058_Test() { - OutputHelper.WriteLine("Section 7.2.7 "); - OutputHelper.WriteLine("This code tests the primary expression consisting of the form E.I, where E "); - OutputHelper.WriteLine("is a variable, property, or value, the struct type of which is T, and I identifies"); - OutputHelper.WriteLine("an instance field of class type T."); + // Section 7.2.7 + // This code tests the primary expression consisting of the form E.I, where E + // is a variable, property, or value, the struct type of which is T, and I identifies + // an instance field of class type T. Assert.IsTrue(mem058.testMethod()); } [TestMethod] public void Exp_lit001_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a boolean-literal is of type bool."); + // Section 7.2.1 + // This code tests that a boolean-literal is of type bool. Assert.IsTrue(lit001.testMethod()) ; } [TestMethod] public void Exp_lit004_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that an int-literal is of type int."); + // Section 7.2.1 + // This code tests that an int-literal is of type int. Assert.IsTrue(lit004.testMethod()) ; } [TestMethod] public void Exp_lit005_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a long-literal is of type long."); + // Section 7.2.1 + // This code tests that a long-literal is of type long. Assert.IsTrue(lit005.testMethod()) ; } [TestMethod] public void Exp_lit006_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a float-literal is of type float."); + // Section 7.2.1 + // This code tests that a float-literal is of type float. Assert.IsTrue(lit006.testMethod()) ; } [TestMethod] public void Exp_lit007_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a double-literal is of type double."); + // Section 7.2.1 + // This code tests that a double-literal is of type double. Assert.IsTrue(lit007.testMethod()) ; } [TestMethod] public void Exp_lit008_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a double-literal is of type double."); + // Section 7.2.1 + // This code tests that a double-literal is of type double. Assert.IsTrue(lit008.testMethod()); } [TestMethod] public void Exp_lit009_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a character-literal is of type char."); + // Section 7.2.1 + // This code tests that a character-literal is of type char. Assert.IsTrue(lit009.testMethod()); } [TestMethod] public void Exp_lit010_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("This code tests that a string-literal is of type string."); + // Section 7.2.1 + // This code tests that a string-literal is of type string. Assert.IsTrue(lit010.testMethod()); } [TestMethod] public void Exp_lit011_Test() { - OutputHelper.WriteLine("Section 7.2.1 "); - OutputHelper.WriteLine("string compare with with its base type."); + // Section 7.2.1 + // string compare with with its base type. Assert.IsTrue(lit011.testMethod()); } [TestMethod] public void Exp_base006_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base006.testMethod()) ; } [TestMethod] public void Exp_base007_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base007.testMethod()) ; } [TestMethod] public void Exp_base009_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base009.testMethod()) ; } [TestMethod] public void Exp_base010_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base010.testMethod()) ; } [TestMethod] public void Exp_base011_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base011.testMethod()); } [TestMethod] public void Exp_base012_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base012.testMethod()); } [TestMethod] public void Exp_base013_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base013.testMethod()); } [TestMethod] public void Exp_base014_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base014.testMethod()); } [TestMethod] public void Exp_base015_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base015.testMethod()); } [TestMethod] public void Exp_base016_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. Assert.IsTrue(base016.testMethod()); } [TestMethod] public void Exp_base017_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); - OutputHelper.WriteLine("Expected Fail"); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. + // Expected Fail Assert.IsTrue(base017.testMethod()); } [TestMethod] public void Exp_base018_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); - OutputHelper.WriteLine("Expected Fail"); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. + // Expected Fail Assert.IsTrue(base018.testMethod()); } [TestMethod] public void Exp_base019_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); - OutputHelper.WriteLine("Expected Fail"); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. + // Expected Fail Assert.IsTrue(base019.testMethod()); } [TestMethod] public void Exp_base020_Test() { - OutputHelper.WriteLine("Section 7.2.8 "); - OutputHelper.WriteLine("A base class access is permitted only in the block of a constructor,"); - OutputHelper.WriteLine("an instance method, or an instance property accessor."); - OutputHelper.WriteLine("Expected Fail"); + // Section 7.2.8 + // A base class access is permitted only in the block of a constructor, + // an instance method, or an instance property accessor. + // Expected Fail Assert.IsTrue(base020.testMethod()); } diff --git a/Tests/NFUnitTestArithmetic/UnitTestFormat.cs b/Tests/NFUnitTestArithmetic/UnitTestFormat.cs index 49b4b2a0..8e2b9af7 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestFormat.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestFormat.cs @@ -593,7 +593,6 @@ public void WriteOutput() OutputHelper.Write(GetColumnInfo((ColumnType)i).ColumnHeader.PadLeft(GetColumnInfo((ColumnType)i).LargestLength + 1)); // +1 for an extra space between columns } } - OutputHelper.WriteLine(""); // complete the line // now write out the row data for (int i = 0; i < m_rows.Count; i++) @@ -616,11 +615,8 @@ public void WriteOutput() OutputHelper.Write(rd.ColumnData[j].PadLeft(GetColumnInfo((ColumnType)j).LargestLength + 1)); // +1 for an extra space between columns } } - OutputHelper.WriteLine(""); // complete the line } - } - } #endregion } diff --git a/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs b/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs index b86770fe..dec31183 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs @@ -16,223 +16,223 @@ class UnitTestOtherArithmeticTests [TestMethod] public void Other_unary068_Test() { - OutputHelper.WriteLine(" 7.6.5 Operator Overloading - Unary operator"); + // 7.6.5 Operator Overloading - Unary operator Assert.IsTrue(Other_TestClass_unary068.testMethod()); } [TestMethod] public void Other_relat001_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat001.testMethod()); } [TestMethod] public void Other_relat002_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat002.testMethod()); } [TestMethod] public void Other_relat003_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat003.testMethod()); } [TestMethod] public void Other_relat004_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat004.testMethod()); } [TestMethod] public void Other_relat005_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat005.testMethod()); } [TestMethod] public void Other_relat006_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat006.testMethod()); } [TestMethod] public void Other_relat007_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat007.testMethod()); } [TestMethod] public void Other_relat008_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat008.testMethod()); } [TestMethod] public void Other_relat009_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat009.testMethod()); } [TestMethod] public void Other_relat010_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat010.testMethod()); } [TestMethod] public void Other_relat011_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat011.testMethod()); } [TestMethod] public void Other_relat012_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat012.testMethod()); } [TestMethod] public void Other_relat013_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat013.testMethod()); } [TestMethod] public void Other_relat014_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat014.testMethod()); } [TestMethod] public void Other_relat015_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat015.testMethod()); } [TestMethod] public void Other_relat016_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat016.testMethod()); } [TestMethod] public void Other_relat017_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat017.testMethod()); } [TestMethod] public void Other_relat018_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat018.testMethod()); } [TestMethod] public void Other_relat019_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat019.testMethod()); } [TestMethod] public void Other_relat020_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat020.testMethod()); } [TestMethod] public void Other_relat021_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat021.testMethod()); } [TestMethod] public void Other_relat022_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat022.testMethod()); } [TestMethod] public void Other_relat023_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat023.testMethod()); } [TestMethod] public void Other_relat024_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat024.testMethod()); } [TestMethod] public void Other_relat025_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat025.testMethod()); } [TestMethod] public void Other_relat026_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat026.testMethod()); } [TestMethod] public void Other_relat027_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat027.testMethod()); } [TestMethod] public void Other_relat028_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat028.testMethod()); } [TestMethod] public void Other_relat029_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat029.testMethod()); } [TestMethod] public void Other_relat030_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat030.testMethod()); } [TestMethod] public void Other_relat031_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat031.testMethod()); } [TestMethod] public void Other_relat032_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat032.testMethod()); } [TestMethod] public void Other_relat033_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat033.testMethod()); } [TestMethod] public void Other_relat034_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat034.testMethod()); } [TestMethod] public void Other_relat035_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat035.testMethod()); } [TestMethod] public void Other_relat036_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat036.testMethod()); } @@ -241,10 +241,10 @@ public void Other_relat036_Test() [TestMethod] public void Other_relat037_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("If either operand is NaN, the result is false"); - OutputHelper.WriteLine("for all operators except !=, and true for !="); - OutputHelper.WriteLine("operator."); + // Section 7.9 + // If either operand is NaN, the result is false + // for all operators except !=, and true for != + // operator. Assert.IsTrue(Other_TestClass_relat037.testMethod()) { return MFTestResults.Pass; @@ -254,10 +254,10 @@ public void Other_relat037_Test() [TestMethod] public void Other_relat038_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("If either operand is NaN, the result is false"); - OutputHelper.WriteLine("for all operators except !=, and true for !="); - OutputHelper.WriteLine("operator."); + // Section 7.9 + // If either operand is NaN, the result is false + // for all operators except !=, and true for != + // operator. Assert.IsTrue(Other_TestClass_relat038.testMethod()) { return MFTestResults.Pass; @@ -267,10 +267,10 @@ public void Other_relat038_Test() [TestMethod] public void Other_relat039_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("If either operand is NaN, the result is false"); - OutputHelper.WriteLine("for all operators except !=, and true for !="); - OutputHelper.WriteLine("operator."); + // Section 7.9 + // If either operand is NaN, the result is false + // for all operators except !=, and true for != + // operator. Assert.IsTrue(Other_TestClass_relat039.testMethod()) { return MFTestResults.Pass; @@ -280,10 +280,10 @@ public void Other_relat039_Test() [TestMethod] public void Other_relat040_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("If either operand is NaN, the result is false"); - OutputHelper.WriteLine("for all operators except !=, and true for !="); - OutputHelper.WriteLine("operator."); + // Section 7.9 + // If either operand is NaN, the result is false + // for all operators except !=, and true for != + // operator. Assert.IsTrue(Other_TestClass_relat040.testMethod()) { return MFTestResults.Pass; @@ -293,10 +293,10 @@ public void Other_relat040_Test() [TestMethod] public void Other_relat041_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("If either operand is NaN, the result is false"); - OutputHelper.WriteLine("for all operators except !=, and true for !="); - OutputHelper.WriteLine("operator."); + // Section 7.9 + // If either operand is NaN, the result is false + // for all operators except !=, and true for != + // operator. Assert.IsTrue(Other_TestClass_relat041.testMethod()) { return MFTestResults.Pass; @@ -306,10 +306,10 @@ public void Other_relat041_Test() [TestMethod] public void Other_relat042_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("If either operand is NaN, the result is false"); - OutputHelper.WriteLine("for all operators except !=, and true for !="); - OutputHelper.WriteLine("operator."); + // Section 7.9 + // If either operand is NaN, the result is false + // for all operators except !=, and true for != + // operator. Assert.IsTrue(Other_TestClass_relat042.testMethod()) { return MFTestResults.Pass; @@ -319,9 +319,9 @@ public void Other_relat042_Test() [TestMethod] public void Other_relat043_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("Negative and positive zero is considered"); - OutputHelper.WriteLine("equal."); + // Section 7.9 + // Negative and positive zero is considered + // equal. Assert.IsTrue(Other_TestClass_relat043.testMethod()) { return MFTestResults.Pass; @@ -331,9 +331,9 @@ public void Other_relat043_Test() [TestMethod] public void Other_relat044_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("Negative and positive zero is considered"); - OutputHelper.WriteLine("equal."); + // Section 7.9 + // Negative and positive zero is considered + // equal. Assert.IsTrue(Other_TestClass_relat044.testMethod()) { return MFTestResults.Pass; @@ -343,10 +343,10 @@ public void Other_relat044_Test() [TestMethod] public void Other_relat045_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("Other_TestClass_?_A negative infinity is considered less than"); - OutputHelper.WriteLine("all other values, but equal to another negative"); - OutputHelper.WriteLine("infinity."); + // Section 7.9 + // Other_TestClass_?_A negative infinity is considered less than + // all other values, but equal to another negative + // infinity. Assert.IsTrue(Other_TestClass_relat045.testMethod()) { return MFTestResults.Pass; @@ -356,10 +356,10 @@ public void Other_relat045_Test() [TestMethod] public void Other_relat046_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("Other_TestClass_?_A negative infinity is considered less than"); - OutputHelper.WriteLine("all other values, but equal to another negative"); - OutputHelper.WriteLine("infinity."); + // Section 7.9 + // Other_TestClass_?_A negative infinity is considered less than + // all other values, but equal to another negative + // infinity. Assert.IsTrue(Other_TestClass_relat046.testMethod()) { return MFTestResults.Pass; @@ -369,9 +369,9 @@ public void Other_relat046_Test() [TestMethod] public void Other_relat047_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("Other_TestClass_?_A positive infinity is considered greater than all"); - OutputHelper.WriteLine("other values, but equal to positive infinity."); + // Section 7.9 + // Other_TestClass_?_A positive infinity is considered greater than all + // other values, but equal to positive infinity. Assert.IsTrue(Other_TestClass_relat047.testMethod()) { return MFTestResults.Pass; @@ -381,9 +381,9 @@ public void Other_relat047_Test() [TestMethod] public void Other_relat048_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("Other_TestClass_?_A positive infinity is considered greater than all"); - OutputHelper.WriteLine("other values, but equal to positive infinity."); + // Section 7.9 + // Other_TestClass_?_A positive infinity is considered greater than all + // other values, but equal to positive infinity. Assert.IsTrue(Other_TestClass_relat048.testMethod()) { return MFTestResults.Pass; @@ -394,180 +394,180 @@ public void Other_relat048_Test() [TestMethod] public void Other_relat055_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat055.testMethod()); } [TestMethod] public void Other_relat056_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat056.testMethod()); } [TestMethod] public void Other_relat057_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat057.testMethod()); } [TestMethod] public void Other_relat058_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat058.testMethod()); } [TestMethod] public void Other_relat059_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat059.testMethod()); } [TestMethod] public void Other_relat060_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat060.testMethod()); } [TestMethod] public void Other_relat061_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat061.testMethod()); } [TestMethod] public void Other_relat062_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat062.testMethod()); } [TestMethod] public void Other_relat063_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("since the predefined reference type equality"); - OutputHelper.WriteLine("operators accept operands of type object, they"); - OutputHelper.WriteLine("apply to all types that do not declare applicable"); - OutputHelper.WriteLine("operator == and != members. Conversely, any "); - OutputHelper.WriteLine("applicable user-defined equality operators"); - OutputHelper.WriteLine("effectively hide the predefined reference type"); - OutputHelper.WriteLine("equality operators."); + // Section 7.9 + // since the predefined reference type equality + // operators accept operands of type object, they + // apply to all types that do not declare applicable + // operator == and != members. Conversely, any + // applicable user-defined equality operators + // effectively hide the predefined reference type + // equality operators. Assert.IsTrue(Other_TestClass_relat063.testMethod()); } [TestMethod] public void Other_relat064_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("since the predefined reference type equality"); - OutputHelper.WriteLine("operators accept operands of type object, they"); - OutputHelper.WriteLine("apply to all types that do not declare applicable"); - OutputHelper.WriteLine("operator == and != members. Conversely, any "); - OutputHelper.WriteLine("applicable user-defined equality operators"); - OutputHelper.WriteLine("effectively hide the predefined reference type"); - OutputHelper.WriteLine("equality operators."); + // Section 7.9 + // since the predefined reference type equality + // operators accept operands of type object, they + // apply to all types that do not declare applicable + // operator == and != members. Conversely, any + // applicable user-defined equality operators + // effectively hide the predefined reference type + // equality operators. Assert.IsTrue(Other_TestClass_relat064.testMethod()); } [TestMethod] public void Other_relat065_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("since the predefined reference type equality"); - OutputHelper.WriteLine("operators accept operands of type object, they"); - OutputHelper.WriteLine("apply to all types that do not declare applicable"); - OutputHelper.WriteLine("operator == and != members. Conversely, any "); - OutputHelper.WriteLine("applicable user-defined equality operators"); - OutputHelper.WriteLine("effectively hide the predefined reference type"); - OutputHelper.WriteLine("equality operators."); + // Section 7.9 + // since the predefined reference type equality + // operators accept operands of type object, they + // apply to all types that do not declare applicable + // operator == and != members. Conversely, any + // applicable user-defined equality operators + // effectively hide the predefined reference type + // equality operators. Assert.IsTrue(Other_TestClass_relat065.testMethod()); } [TestMethod] public void Other_relat066_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("since the predefined reference type equality"); - OutputHelper.WriteLine("operators accept operands of type object, they"); - OutputHelper.WriteLine("apply to all types that do not declare applicable"); - OutputHelper.WriteLine("operator == and != members. Conversely, any "); - OutputHelper.WriteLine("applicable user-defined equality operators"); - OutputHelper.WriteLine("effectively hide the predefined reference type"); - OutputHelper.WriteLine("equality operators."); + // Section 7.9 + // since the predefined reference type equality + // operators accept operands of type object, they + // apply to all types that do not declare applicable + // operator == and != members. Conversely, any + // applicable user-defined equality operators + // effectively hide the predefined reference type + // equality operators. Assert.IsTrue(Other_TestClass_relat066.testMethod()); } [TestMethod] public void Other_relat069_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("It is an error to use the predefined reference"); - OutputHelper.WriteLine("type equality operators to compare two references"); - OutputHelper.WriteLine("that are known to be different at compile-time."); + // Section 7.9 + // It is an error to use the predefined reference + // type equality operators to compare two references + // that are known to be different at compile-time. Assert.IsTrue(Other_TestClass_relat069.testMethod()); } [TestMethod] public void Other_relat072_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("The predefined reference type equality operators"); - OutputHelper.WriteLine("do not permit value type operands to be compared."); - OutputHelper.WriteLine("Therefore, unless a struct type declares its own"); - OutputHelper.WriteLine("equality operators, it is not possible to compare"); - OutputHelper.WriteLine("values of that struct type."); + // Section 7.9 + // The predefined reference type equality operators + // do not permit value type operands to be compared. + // Therefore, unless a struct type declares its own + // equality operators, it is not possible to compare + // values of that struct type. Assert.IsTrue(Other_TestClass_relat072.testMethod()); } [TestMethod] public void Other_relat073_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("For an operation of the form x==y or x!=y, "); - OutputHelper.WriteLine("if any appicable operator == or != exists, the"); - OutputHelper.WriteLine("operator overload resolution rules will select"); - OutputHelper.WriteLine("that operator instead of the predefined reference"); - OutputHelper.WriteLine("type equality operator. However, it is always"); - OutputHelper.WriteLine("possible to select the reference type equality"); - OutputHelper.WriteLine("operator by explicitly casting one or both of"); - OutputHelper.WriteLine("the operands to type object."); + // Section 7.9 + // For an operation of the form x==y or x!=y, + // if any appicable operator == or != exists, the + // operator overload resolution rules will select + // that operator instead of the predefined reference + // type equality operator. However, it is always + // possible to select the reference type equality + // operator by explicitly casting one or both of + // the operands to type object. Assert.IsTrue(Other_TestClass_relat073.testMethod()); } [TestMethod] public void Other_relat074_Test() { - OutputHelper.WriteLine("Section 7.9"); - OutputHelper.WriteLine("For an operation of the form x==y or x!=y, "); - OutputHelper.WriteLine("if any appicable operator == or != exists, the"); - OutputHelper.WriteLine("operator overload resolution rules will select"); - OutputHelper.WriteLine("that operator instead of the predefined reference"); - OutputHelper.WriteLine("type equality operator. However, it is always"); - OutputHelper.WriteLine("possible to select the reference type equality"); - OutputHelper.WriteLine("operator by explicitly casting one or both of"); - OutputHelper.WriteLine("the operands to type object."); + // Section 7.9 + // For an operation of the form x==y or x!=y, + // if any appicable operator == or != exists, the + // operator overload resolution rules will select + // that operator instead of the predefined reference + // type equality operator. However, it is always + // possible to select the reference type equality + // operator by explicitly casting one or both of + // the operands to type object. Assert.IsTrue(Other_TestClass_relat074.testMethod()); } [TestMethod] public void Other_relat075_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat075.testMethod()); } [TestMethod] public void Other_relat076_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat076.testMethod()); } [TestMethod] public void Other_relat077_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat077.testMethod()); } [TestMethod] public void Other_relat078_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat078.testMethod()); } /* [TestMethod] public void Other_relat079_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat079.testMethod()) { return MFTestResults.Pass; @@ -578,198 +578,198 @@ public void Other_relat079_Test() [TestMethod] public void Other_relat080_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat080.testMethod()); } [TestMethod] public void Other_relat081_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat081.testMethod()); } [TestMethod] public void Other_relat083_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat083.testMethod()); } [TestMethod] public void Other_relat084_Test() { - OutputHelper.WriteLine("Section 7.9"); + // Section 7.9 Assert.IsTrue(Other_TestClass_relat084.testMethod()); } [TestMethod] public void Other_relat086_Test() { - OutputHelper.WriteLine("Making sure floating point relational operators are working correctly for negative"); - OutputHelper.WriteLine("vs. positive values."); + // Making sure floating point relational operators are working correctly for negative + // vs. positive values. Assert.IsTrue(Other_TestClass_relat086.testMethod()); } [TestMethod] public void Other_relat087_Test() { - OutputHelper.WriteLine("Making sure floating point relational operators are working correctly for negative"); - OutputHelper.WriteLine("vs. positive values."); + // Making sure floating point relational operators are working correctly for negative + // vs. positive values. Assert.IsTrue(Other_TestClass_relat087.testMethod()); } [TestMethod] public void Other_relat088_Test() { - OutputHelper.WriteLine("Making sure floating point relational operators are working correctly for negative"); - OutputHelper.WriteLine("vs. positive values."); + // Making sure floating point relational operators are working correctly for negative + // vs. positive values. Assert.IsTrue(Other_TestClass_relat088.testMethod()); } [TestMethod] public void Other_relat089_Test() { - OutputHelper.WriteLine("Making sure floating point relational operators are working correctly for negative"); - OutputHelper.WriteLine("vs. positive values."); + // Making sure floating point relational operators are working correctly for negative + // vs. positive values. Assert.IsTrue(Other_TestClass_relat089.testMethod()); } [TestMethod] public void Other_operators_logic001_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic001.testMethod()); } [TestMethod] public void Other_operators_logic002_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic002.testMethod()); } [TestMethod] public void Other_operators_logic003_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic003.testMethod()); } [TestMethod] public void Other_operators_logic004_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic004.testMethod()); } [TestMethod] public void Other_operators_logic005_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic005.testMethod()); } [TestMethod] public void Other_operators_logic006_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic006.testMethod()); } [TestMethod] public void Other_operators_logic007_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic007.testMethod()); } [TestMethod] public void Other_operators_logic008_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic008.testMethod()); } [TestMethod] public void Other_operators_logic009_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic009.testMethod()); } [TestMethod] public void Other_operators_logic010_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic010.testMethod()); } [TestMethod] public void Other_operators_logic011_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic011.testMethod()); } [TestMethod] public void Other_operators_logic012_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic012.testMethod()); } [TestMethod] public void Other_operators_logic013_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic013.testMethod()); } [TestMethod] public void Other_operators_logic014_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic014.testMethod()); } [TestMethod] public void Other_operators_logic015_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_operators_logic015.testMethod()); } [TestMethod] public void Other_operators_logic016_Test() { - OutputHelper.WriteLine("Section 7.11"); - OutputHelper.WriteLine("The operation x (double amp) y corresponds to the"); - OutputHelper.WriteLine("operation x (amp) y except that y is evaluated only"); - OutputHelper.WriteLine("if x is true."); + // Section 7.11 + // The operation x (double amp) y corresponds to the + // operation x (amp) y except that y is evaluated only + // if x is true. Assert.IsTrue(Other_TestClass_operators_logic016.testMethod()); } [TestMethod] public void Other_operators_logic017_Test() { - OutputHelper.WriteLine("Section 7.11"); - OutputHelper.WriteLine("The operation x (double amp) y corresponds to the"); - OutputHelper.WriteLine("operation x (amp) y except that y is evaluated only"); - OutputHelper.WriteLine("if x is true."); + // Section 7.11 + // The operation x (double amp) y corresponds to the + // operation x (amp) y except that y is evaluated only + // if x is true. Assert.IsTrue(Other_TestClass_operators_logic017.testMethod()); } [TestMethod] public void Other_operators_logic018_Test() { - OutputHelper.WriteLine("Section 7.11"); - OutputHelper.WriteLine("The operation x || y corresponds to the"); - OutputHelper.WriteLine("operation x (amp) y except that y is evaluated only"); - OutputHelper.WriteLine("if x is false."); + // Section 7.11 + // The operation x || y corresponds to the + // operation x (amp) y except that y is evaluated only + // if x is false. Assert.IsTrue(Other_TestClass_operators_logic018.testMethod()); } [TestMethod] public void Other_operators_logic019_Test() { - OutputHelper.WriteLine("Section 7.11"); - OutputHelper.WriteLine("The operation x || y corresponds to the"); - OutputHelper.WriteLine("operation x (amp) y except that y is evaluated only"); - OutputHelper.WriteLine("if x is false."); + // Section 7.11 + // The operation x || y corresponds to the + // operation x (amp) y except that y is evaluated only + // if x is false. Assert.IsTrue(Other_TestClass_operators_logic019.testMethod()); } /* [TestMethod] public void Other_operators_logic022_Test() { - OutputHelper.WriteLine("Section 7.11"); - OutputHelper.WriteLine("When the operands of && or || are of types"); - OutputHelper.WriteLine("that declare an applicable user-defined operator &"); - OutputHelper.WriteLine("or operator |, both of the following must be true,"); - OutputHelper.WriteLine("where T is the type in which the selected operand"); - OutputHelper.WriteLine("is declared:"); - OutputHelper.WriteLine("The return type and the type of each parameter of "); - OutputHelper.WriteLine("the selected operator must be T. In other words, "); - OutputHelper.WriteLine("the operator must compute the logical AND or the"); - OutputHelper.WriteLine("logical OR of the two operands of type T, and must"); - OutputHelper.WriteLine("return a result of type T."); - OutputHelper.WriteLine("T must contain declarations of operator true and"); - OutputHelper.WriteLine("operator false."); + // Section 7.11 + // When the operands of && or || are of types + // that declare an applicable user-defined operator & + // or operator |, both of the following must be true, + // where T is the type in which the selected operand + // is declared: + // The return type and the type of each parameter of + // the selected operator must be T. In other words, + // the operator must compute the logical AND or the + // logical OR of the two operands of type T, and must + // return a result of type T. + // T must contain declarations of operator true and + // operator false. Assert.IsTrue(Other_TestClass_operators_logic022.testMethod()) { return MFTestResults.Pass; @@ -779,19 +779,19 @@ public void Other_operators_logic022_Test() [TestMethod] public void Other_operators_logic023_Test() { - OutputHelper.WriteLine("Section 7.11"); - OutputHelper.WriteLine("When the operands of && or || are of types"); - OutputHelper.WriteLine("that declare an applicable user-defined operator &"); - OutputHelper.WriteLine("or operator |, both of the following must be true,"); - OutputHelper.WriteLine("where T is the type in which the selected operand"); - OutputHelper.WriteLine("is declared:"); - OutputHelper.WriteLine("The return type and the type of each parameter of "); - OutputHelper.WriteLine("the selected operator must be T. In other words, "); - OutputHelper.WriteLine("the operator must compute the logical AND or the"); - OutputHelper.WriteLine("logical OR of the two operands of type T, and must"); - OutputHelper.WriteLine("return a result of type T."); - OutputHelper.WriteLine("T must contain declarations of operator true and"); - OutputHelper.WriteLine("operator false."); + // Section 7.11 + // When the operands of && or || are of types + // that declare an applicable user-defined operator & + // or operator |, both of the following must be true, + // where T is the type in which the selected operand + // is declared: + // The return type and the type of each parameter of + // the selected operator must be T. In other words, + // the operator must compute the logical AND or the + // logical OR of the two operands of type T, and must + // return a result of type T. + // T must contain declarations of operator true and + // operator false. Assert.IsTrue(Other_TestClass_operators_logic023.testMethod()) { return MFTestResults.Pass; @@ -801,7 +801,7 @@ public void Other_operators_logic023_Test() [TestMethod] public void Other_operators_logic032_Test() { - OutputHelper.WriteLine("Section 7.11"); + // Section 7.11 Assert.IsTrue(Other_TestClass_operators_logic032.testMethod()) { return MFTestResults.Pass; @@ -812,886 +812,886 @@ public void Other_operators_logic032_Test() [TestMethod] public void Other_operators_logic033_Test() { - OutputHelper.WriteLine("Section 7.11"); + // Section 7.11 Assert.IsTrue(Other_TestClass_operators_logic033.testMethod()); } [TestMethod] public void Other_cond001_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("Other_TestClass_?_A conditional expression of the form b(question) x(colon)y"); - OutputHelper.WriteLine("first evaluates the condition b. Then, if b"); - OutputHelper.WriteLine("is true, x is evaluated and becomes the result"); - OutputHelper.WriteLine("of the operation. Otherwise, y is evaluated"); - OutputHelper.WriteLine("and becomes the result of the operation. Other_TestClass_?_A"); - OutputHelper.WriteLine("conditional expression never evaluates both x"); - OutputHelper.WriteLine("and y."); + // Section 7.12 + // Other_TestClass_?_A conditional expression of the form b(question) x(colon)y + // first evaluates the condition b. Then, if b + // is true, x is evaluated and becomes the result + // of the operation. Otherwise, y is evaluated + // and becomes the result of the operation. Other_TestClass_?_A + // conditional expression never evaluates both x + // and y. Assert.IsTrue(Other_TestClass_cond001.testMethod()); } [TestMethod] public void Other_cond002_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("Other_TestClass_?_A conditional expression of the form b(question) x(colon)y"); - OutputHelper.WriteLine("first evaluates the condition b. Then, if b"); - OutputHelper.WriteLine("is true, x is evaluated and becomes the result"); - OutputHelper.WriteLine("of the operation. Otherwise, y is evaluated"); - OutputHelper.WriteLine("and becomes the result of the operation. Other_TestClass_?_A"); - OutputHelper.WriteLine("conditional expression never evaluates both x"); - OutputHelper.WriteLine("and y."); + // Section 7.12 + // Other_TestClass_?_A conditional expression of the form b(question) x(colon)y + // first evaluates the condition b. Then, if b + // is true, x is evaluated and becomes the result + // of the operation. Otherwise, y is evaluated + // and becomes the result of the operation. Other_TestClass_?_A + // conditional expression never evaluates both x + // and y. Assert.IsTrue(Other_TestClass_cond002.testMethod()); } [TestMethod] public void Other_cond003_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("Other_TestClass_?_A conditional expression of the form b(question) x(colon)y"); - OutputHelper.WriteLine("first evaluates the condition b. Then, if b"); - OutputHelper.WriteLine("is true, x is evaluated and becomes the result"); - OutputHelper.WriteLine("of the operation. Otherwise, y is evaluated"); - OutputHelper.WriteLine("and becomes the result of the operation. Other_TestClass_?_A"); - OutputHelper.WriteLine("conditional expression never evaluates both x"); - OutputHelper.WriteLine("and y."); + // Section 7.12 + // Other_TestClass_?_A conditional expression of the form b(question) x(colon)y + // first evaluates the condition b. Then, if b + // is true, x is evaluated and becomes the result + // of the operation. Otherwise, y is evaluated + // and becomes the result of the operation. Other_TestClass_?_A + // conditional expression never evaluates both x + // and y. Assert.IsTrue(Other_TestClass_cond003.testMethod()); } [TestMethod] public void Other_cond004_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("Other_TestClass_?_A conditional expression of the form b(question) x(colon)y"); - OutputHelper.WriteLine("first evaluates the condition b. Then, if b"); - OutputHelper.WriteLine("is true, x is evaluated and becomes the result"); - OutputHelper.WriteLine("of the operation. Otherwise, y is evaluated"); - OutputHelper.WriteLine("and becomes the result of the operation. Other_TestClass_?_A"); - OutputHelper.WriteLine("conditional expression never evaluates both x"); - OutputHelper.WriteLine("and y."); + // Section 7.12 + // Other_TestClass_?_A conditional expression of the form b(question) x(colon)y + // first evaluates the condition b. Then, if b + // is true, x is evaluated and becomes the result + // of the operation. Otherwise, y is evaluated + // and becomes the result of the operation. Other_TestClass_?_A + // conditional expression never evaluates both x + // and y. Assert.IsTrue(Other_TestClass_cond004.testMethod()); } [TestMethod] public void Other_cond005_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("The conditional operator is right-associative, meaning"); - OutputHelper.WriteLine("that operations are grouped from right to left. For example,"); - OutputHelper.WriteLine("an expression of the form a?b:c?d:e is evaluated as a?b:(c?d:e)."); + // Section 7.12 + // The conditional operator is right-associative, meaning + // that operations are grouped from right to left. For example, + // an expression of the form a?b:c?d:e is evaluated as a?b:(c?d:e). Assert.IsTrue(Other_TestClass_cond005.testMethod()); } [TestMethod] public void Other_cond006_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("The first operand of the ?: operator must"); - OutputHelper.WriteLine("be an expression of a type that can be "); - OutputHelper.WriteLine("implicitly converted to bool, or an expression"); - OutputHelper.WriteLine("of a type that implements operator true. If neither"); - OutputHelper.WriteLine("of these requirements are satisfied, a compile-time"); - OutputHelper.WriteLine("error occurs."); + // Section 7.12 + // The first operand of the ?: operator must + // be an expression of a type that can be + // implicitly converted to bool, or an expression + // of a type that implements operator true. If neither + // of these requirements are satisfied, a compile-time + // error occurs. Assert.IsTrue(Other_TestClass_cond006.testMethod()); } [TestMethod] public void Other_cond008_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("The first operand of the ?: operator must"); - OutputHelper.WriteLine("be an expression of a type that can be "); - OutputHelper.WriteLine("implicitly converted to bool, or an expression"); - OutputHelper.WriteLine("of a type that implements operator true. If neither"); - OutputHelper.WriteLine("of these requirements are satisfied, a compile-time"); - OutputHelper.WriteLine("error occurs."); + // Section 7.12 + // The first operand of the ?: operator must + // be an expression of a type that can be + // implicitly converted to bool, or an expression + // of a type that implements operator true. If neither + // of these requirements are satisfied, a compile-time + // error occurs. Assert.IsTrue(Other_TestClass_cond008.testMethod()); } [TestMethod] public void Other_cond010_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("Let X and Y be the types of the second and"); - OutputHelper.WriteLine("third operands. Then,"); - OutputHelper.WriteLine("If X and Y are the same types, then this is"); - OutputHelper.WriteLine("the type of the conditional expression."); - OutputHelper.WriteLine("Otherwise, if an implicit conversion exists"); - OutputHelper.WriteLine("from X to Y, but not from Y to X, then Y"); - OutputHelper.WriteLine("is the type of the conditional expression."); - OutputHelper.WriteLine("Otherwise, if an implicit conversion exists"); - OutputHelper.WriteLine("from Y to X, but not from X to Y, then X"); - OutputHelper.WriteLine("is the type of the conditional expression."); - OutputHelper.WriteLine("Otherwise, no expression type can be "); - OutputHelper.WriteLine("determined, and a compile time error occurs. "); + // Section 7.12 + // Let X and Y be the types of the second and + // third operands. Then, + // If X and Y are the same types, then this is + // the type of the conditional expression. + // Otherwise, if an implicit conversion exists + // from X to Y, but not from Y to X, then Y + // is the type of the conditional expression. + // Otherwise, if an implicit conversion exists + // from Y to X, but not from X to Y, then X + // is the type of the conditional expression. + // Otherwise, no expression type can be + // determined, and a compile time error occurs. Assert.IsTrue(Other_TestClass_cond010.testMethod()); } [TestMethod] public void Other_cond011_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("Let X and Y be the types of the second and"); - OutputHelper.WriteLine("third operands. Then,"); - OutputHelper.WriteLine("If X and Y are the same types, then this is"); - OutputHelper.WriteLine("the type of the conditional expression."); - OutputHelper.WriteLine("Otherwise, if an implicit conversion exists"); - OutputHelper.WriteLine("from X to Y, but not from Y to X, then Y"); - OutputHelper.WriteLine("is the type of the conditional expression."); - OutputHelper.WriteLine("Otherwise, if an implicit conversion exists"); - OutputHelper.WriteLine("from Y to X, but not from X to Y, then X"); - OutputHelper.WriteLine("is the type of the conditional expression."); - OutputHelper.WriteLine("Otherwise, no expression type can be "); - OutputHelper.WriteLine("determined, and a compile time error occurs. "); + // Section 7.12 + // Let X and Y be the types of the second and + // third operands. Then, + // If X and Y are the same types, then this is + // the type of the conditional expression. + // Otherwise, if an implicit conversion exists + // from X to Y, but not from Y to X, then Y + // is the type of the conditional expression. + // Otherwise, if an implicit conversion exists + // from Y to X, but not from X to Y, then X + // is the type of the conditional expression. + // Otherwise, no expression type can be + // determined, and a compile time error occurs. Assert.IsTrue(Other_TestClass_cond011.testMethod()); } [TestMethod] public void Other_cond014_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("The run-time processing of a conditional expression of"); - OutputHelper.WriteLine("the form b? x: y consists of the following steps:"); - OutputHelper.WriteLine("If an implicit conversion from type b to bool exists,"); - OutputHelper.WriteLine("then this implicit conversion is performed to produce"); - OutputHelper.WriteLine("a bool value."); - OutputHelper.WriteLine("Otherwise, the operator true defined by the type of"); - OutputHelper.WriteLine("b is invoked to produce a bool value."); + // Section 7.12 + // The run-time processing of a conditional expression of + // the form b? x: y consists of the following steps: + // If an implicit conversion from type b to bool exists, + // then this implicit conversion is performed to produce + // a bool value. + // Otherwise, the operator true defined by the type of + // b is invoked to produce a bool value. Assert.IsTrue(Other_TestClass_cond014.testMethod()); } [TestMethod] public void Other_cond015_Test() { - OutputHelper.WriteLine("Section 7.12"); - OutputHelper.WriteLine("The run-time processing of a conditional expression of"); - OutputHelper.WriteLine("the form b? x: y consists of the following steps:"); - OutputHelper.WriteLine("If an implicit conversion from type b to bool exists,"); - OutputHelper.WriteLine("then this implicit conversion is performed to produce"); - OutputHelper.WriteLine("a bool value."); - OutputHelper.WriteLine("Otherwise, the operator true defined by the type of"); - OutputHelper.WriteLine("b is invoked to produce a bool value."); + // Section 7.12 + // The run-time processing of a conditional expression of + // the form b? x: y consists of the following steps: + // If an implicit conversion from type b to bool exists, + // then this implicit conversion is performed to produce + // a bool value. + // Otherwise, the operator true defined by the type of + // b is invoked to produce a bool value. Assert.IsTrue(Other_TestClass_cond015.testMethod()); } [TestMethod] public void Other_is005_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The is operator is used to check whether the run-time type"); - OutputHelper.WriteLine("of an ojbect is compatible with a given type. In an operation"); - OutputHelper.WriteLine("of the form e is T, e must be an expression of a reference-type"); - OutputHelper.WriteLine("and T must be a reference-type. If this is not the case, a compile"); - OutputHelper.WriteLine("time error occurs."); + // Section 7.9.9 + // The is operator is used to check whether the run-time type + // of an ojbect is compatible with a given type. In an operation + // of the form e is T, e must be an expression of a reference-type + // and T must be a reference-type. If this is not the case, a compile + // time error occurs. Assert.IsTrue(Other_TestClass_is005.testMethod()); } [TestMethod] public void Other_is006_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The is operator is used to check whether the run-time type"); - OutputHelper.WriteLine("of an ojbect is compatible with a given type. In an operation"); - OutputHelper.WriteLine("of the form e is T, e must be an expression of a reference-type"); - OutputHelper.WriteLine("and T must be a reference-type. If this is not the case, a compile"); - OutputHelper.WriteLine("time error occurs."); + // Section 7.9.9 + // The is operator is used to check whether the run-time type + // of an ojbect is compatible with a given type. In an operation + // of the form e is T, e must be an expression of a reference-type + // and T must be a reference-type. If this is not the case, a compile + // time error occurs. Assert.IsTrue(Other_TestClass_is006.testMethod()); } [TestMethod] public void Other_is007_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is007.testMethod()); } [TestMethod] public void Other_is008_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is008.testMethod()); } [TestMethod] public void Other_is009_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is009.testMethod()); } [TestMethod] public void Other_is010_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is010.testMethod()); } [TestMethod] public void Other_is011_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is011.testMethod()); } [TestMethod] public void Other_is012_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is012.testMethod()); } [TestMethod] public void Other_is013_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is013.testMethod()); } [TestMethod] public void Other_is014_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is014.testMethod()); } [TestMethod] public void Other_is015_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is015.testMethod()); } [TestMethod] public void Other_is016_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is016.testMethod()); } [TestMethod] public void Other_is017_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is017.testMethod()); } [TestMethod] public void Other_is018_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is018.testMethod()); } [TestMethod] public void Other_is019_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is019.testMethod()); } [TestMethod] public void Other_is020_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is020.testMethod()); } [TestMethod] public void Other_is021_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is021.testMethod()); } [TestMethod] public void Other_is022_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("The operation e is T returns true if not null"); - OutputHelper.WriteLine("and if an implicit reference conversion from the "); - OutputHelper.WriteLine("run-time type of the instance referenced by e to "); - OutputHelper.WriteLine("the type given by T exists. In other words, e is T"); - OutputHelper.WriteLine("checks that e is not null and that a cast-expression"); - OutputHelper.WriteLine("of the form (T)(e) will complete without throwing an "); - OutputHelper.WriteLine("System.Exception."); + // Section 7.9.9 + // The operation e is T returns true if not null + // and if an implicit reference conversion from the + // run-time type of the instance referenced by e to + // the type given by T exists. In other words, e is T + // checks that e is not null and that a cast-expression + // of the form (T)(e) will complete without throwing an + // System.Exception. Assert.IsTrue(Other_TestClass_is022.testMethod()); } [TestMethod] public void Other_is023_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is023.testMethod()); } [TestMethod] public void Other_is024_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is024.testMethod()); } [TestMethod] public void Other_is025_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is025.testMethod()); } [TestMethod] public void Other_is026_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is026.testMethod()); } [TestMethod] public void Other_is027_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is027.testMethod()); } [TestMethod] public void Other_is028_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is028.testMethod()); } [TestMethod] public void Other_is029_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is029.testMethod()); } [TestMethod] public void Other_is030_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is030.testMethod()); } [TestMethod] public void Other_is031_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is031.testMethod()); } [TestMethod] public void Other_is032_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is032.testMethod()); } [TestMethod] public void Other_is033_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is033.testMethod()); } [TestMethod] public void Other_is034_Test() { - OutputHelper.WriteLine("Section 7.9.9"); - OutputHelper.WriteLine("If e is T is known at compile-time to always be"); - OutputHelper.WriteLine("true or always be false, a compile-time error"); - OutputHelper.WriteLine("occurs. The operation is known to always be "); - OutputHelper.WriteLine("true if an implicit reference conversion exists from"); - OutputHelper.WriteLine("the compile-time type of e to T. The operation is known"); - OutputHelper.WriteLine("to always be false if no implicit or explicit reference"); - OutputHelper.WriteLine("conversion exists from the compile-time type of e to t."); + // Section 7.9.9 + // If e is T is known at compile-time to always be + // true or always be false, a compile-time error + // occurs. The operation is known to always be + // true if an implicit reference conversion exists from + // the compile-time type of e to T. The operation is known + // to always be false if no implicit or explicit reference + // conversion exists from the compile-time type of e to t. Assert.IsTrue(Other_TestClass_is034.testMethod()); } [TestMethod] public void Other_as001_Test() { - OutputHelper.WriteLine("Section 7.9.10"); + // Section 7.9.10 Assert.IsTrue(Other_TestClass_as001.testMethod()); } [TestMethod] public void Other_as002_Test() { - OutputHelper.WriteLine("Section 7.9.10"); + // Section 7.9.10 Assert.IsTrue(Other_TestClass_as002.testMethod()); } [TestMethod] public void Other_as003_Test() { - OutputHelper.WriteLine("Section 7.9.10"); - OutputHelper.WriteLine("string->object->array "); + // Section 7.9.10 + // string->object->array Assert.IsTrue(Other_TestClass_as003.testMethod()); } [TestMethod] public void Other_as004_Test() { - OutputHelper.WriteLine("Section 7.9.10"); - OutputHelper.WriteLine("string->object->array "); + // Section 7.9.10 + // string->object->array Assert.IsTrue(Other_TestClass_as004.testMethod()); } [TestMethod] public void Other_as007_Test() { - OutputHelper.WriteLine("Section 7.9.10"); - OutputHelper.WriteLine("string->object->array "); + // Section 7.9.10 + // string->object->array Assert.IsTrue(Other_TestClass_as007.testMethod()); } [TestMethod] public void Other_as008_Test() { - OutputHelper.WriteLine("Section 7.9.10"); - OutputHelper.WriteLine("exp as object "); + // Section 7.9.10 + // exp as object Assert.IsTrue(Other_TestClass_as008.testMethod()); } [TestMethod] public void Other_as011_Test() { - OutputHelper.WriteLine("Section 7.9.10"); - OutputHelper.WriteLine("expression as for a deep inheritance"); + // Section 7.9.10 + // expression as for a deep inheritance Assert.IsTrue(Other_TestClass_as011.testMethod()); } [TestMethod] public void Other_as012_Test() { - OutputHelper.WriteLine("Section 7.9.10"); - OutputHelper.WriteLine("expression as non-type through interface (check at runtime)"); + // Section 7.9.10 + // expression as non-type through interface (check at runtime) Assert.IsTrue(Other_TestClass_as012.testMethod()); } [TestMethod] public void Other_add001_Test() { - OutputHelper.WriteLine("Section 7.7.4"); - OutputHelper.WriteLine("When one or both operands are of type string, the"); - OutputHelper.WriteLine("predefined addition operators concatenate the string"); - OutputHelper.WriteLine("representation of the operands."); + // Section 7.7.4 + // When one or both operands are of type string, the + // predefined addition operators concatenate the string + // representation of the operands. Assert.IsTrue(Other_TestClass_add001.testMethod()); } [TestMethod] public void Other_add002_Test() { - OutputHelper.WriteLine("Section 7.7.4"); - OutputHelper.WriteLine("When one or both operands are of type string, the"); - OutputHelper.WriteLine("predefined addition operators concatenate the string"); - OutputHelper.WriteLine("representation of the operands."); + // Section 7.7.4 + // When one or both operands are of type string, the + // predefined addition operators concatenate the string + // representation of the operands. Assert.IsTrue(Other_TestClass_add002.testMethod()); } [TestMethod] public void Other_add003_Test() { - OutputHelper.WriteLine("Section 7.7.4"); - OutputHelper.WriteLine("When one or both operands are of type string, the"); - OutputHelper.WriteLine("predefined addition operators concatenate the string"); - OutputHelper.WriteLine("representation of the operands."); + // Section 7.7.4 + // When one or both operands are of type string, the + // predefined addition operators concatenate the string + // representation of the operands. Assert.IsTrue(Other_TestClass_add003.testMethod()); } [TestMethod] public void Other_add004_Test() { - OutputHelper.WriteLine("Section 7.7.4"); - OutputHelper.WriteLine("When one or both operands are of type string, the"); - OutputHelper.WriteLine("predefined addition operators concatenate the string"); - OutputHelper.WriteLine("representation of the operands."); + // Section 7.7.4 + // When one or both operands are of type string, the + // predefined addition operators concatenate the string + // representation of the operands. Assert.IsTrue(Other_TestClass_add004.testMethod()); } [TestMethod] public void Other_add005_Test() { - OutputHelper.WriteLine("Section 7.7.4"); - OutputHelper.WriteLine("When one or both operands are of type string, the"); - OutputHelper.WriteLine("predefined addition operators concatenate the string"); - OutputHelper.WriteLine("representation of the operands."); + // Section 7.7.4 + // When one or both operands are of type string, the + // predefined addition operators concatenate the string + // representation of the operands. Assert.IsTrue(Other_TestClass_add005.testMethod()); } [TestMethod] public void Other_add006_Test() { - OutputHelper.WriteLine("Section 7.7.4"); - OutputHelper.WriteLine("When one or both operands are of type string, the"); - OutputHelper.WriteLine("predefined addition operators concatenate the string"); - OutputHelper.WriteLine("representation of the operands."); + // Section 7.7.4 + // When one or both operands are of type string, the + // predefined addition operators concatenate the string + // representation of the operands. Assert.IsTrue(Other_TestClass_add006.testMethod()); } [TestMethod] public void Other_logic001_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic001.testMethod()); } [TestMethod] public void Other_logic002_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic002.testMethod()); } [TestMethod] public void Other_logic003_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic003.testMethod()); } [TestMethod] public void Other_logic004_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic004.testMethod()); } [TestMethod] public void Other_logic005_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic005.testMethod()); } [TestMethod] public void Other_logic006_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic006.testMethod()); } [TestMethod] public void Other_logic007_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic007.testMethod()); } [TestMethod] public void Other_logic008_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic008.testMethod()); } [TestMethod] public void Other_logic009_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic009.testMethod()); } [TestMethod] public void Other_logic010_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic010.testMethod()); } [TestMethod] public void Other_logic011_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic011.testMethod()); } [TestMethod] public void Other_logic012_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic012.testMethod()); } [TestMethod] public void Other_logic013_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic013.testMethod()); } [TestMethod] public void Other_logic014_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic014.testMethod()); } [TestMethod] public void Other_logic015_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic015.testMethod()); } [TestMethod] public void Other_logic016_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic016.testMethod()); } [TestMethod] public void Other_logic017_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic017.testMethod()); } [TestMethod] public void Other_logic018_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic018.testMethod()); } [TestMethod] public void Other_logic019_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic019.testMethod()); } [TestMethod] public void Other_logic020_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic020.testMethod()); } [TestMethod] public void Other_logic021_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic021.testMethod()); } [TestMethod] public void Other_logic022_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic022.testMethod()); } [TestMethod] public void Other_logic023_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic023.testMethod()); } [TestMethod] public void Other_logic024_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic024.testMethod()); } [TestMethod] public void Other_logic025_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic025.testMethod()); } [TestMethod] public void Other_logic026_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic026.testMethod()); } [TestMethod] public void Other_logic027_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic027.testMethod()); } [TestMethod] public void Other_logic028_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic028.testMethod()); } [TestMethod] public void Other_logic029_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic029.testMethod()); } [TestMethod] public void Other_logic030_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic030.testMethod()); } [TestMethod] public void Other_logic032_Test() { - OutputHelper.WriteLine("Section 7.10"); + // Section 7.10 Assert.IsTrue(Other_TestClass_logic032.testMethod()); } diff --git a/Tests/NFUnitTestArray/UnitTestOtherTests.cs b/Tests/NFUnitTestArray/UnitTestOtherTests.cs index afea51ce..50ed78ee 100644 --- a/Tests/NFUnitTestArray/UnitTestOtherTests.cs +++ b/Tests/NFUnitTestArray/UnitTestOtherTests.cs @@ -16,24 +16,24 @@ public class UnitTestOtherTests [TestMethod] public void Othersystemarrays_conversion_01_Test() { - OutputHelper.WriteLine("System.Array Type - Conversions "); - OutputHelper.WriteLine("Verify that an implicit reference conversion from T[D] to System.Array exists"); + // System.Array Type - Conversions + // Verify that an implicit reference conversion from T[D] to System.Array exists Assert.IsTrue(Other_TestClass_systemarrays_conversion_01.testMethod()); } [TestMethod] public void Othersystemarrays_conversion_02_Test() { - OutputHelper.WriteLine("System.Array Type - Conversions "); - OutputHelper.WriteLine("Verify that an explicit reference conversion from System.Array to T[D] exists"); + // System.Array Type - Conversions + // Verify that an explicit reference conversion from System.Array to T[D] exists Assert.IsTrue(Other_TestClass_systemarrays_conversion_02.testMethod()); } [TestMethod] public void Othersystemarrays_nullvalue_01_Test() { - OutputHelper.WriteLine("System.Array Type - Null Values"); - OutputHelper.WriteLine("Verify that a System.Array array can be set to null"); + // System.Array Type - Null Values + // Verify that a System.Array array can be set to null Assert.IsTrue(Other_TestClass_systemarrays_nullvalue_01.testMethod()); } @@ -46,87 +46,87 @@ public void Othercovariance_exception_01_Test() [TestMethod] public void Othercovariance_exception_02_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify an System.Exception is thrown when incompatible types are assigned to array elements"); + // Array Covariance + // Verify an System.Exception is thrown when incompatible types are assigned to array elements Assert.IsTrue(Other_TestClass_covariance_exception_02.testMethod()); } [TestMethod] public void Othercovariance_explicit_01_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from object to any reference-type (class)"); + // Array Covariance + // Verify covariance from object to any reference-type (class) Assert.IsTrue(Other_TestClass_covariance_explicit_01.testMethod()); } [TestMethod] public void Othercovariance_explicit_02_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any reference-type (interface) to object"); + // Array Covariance + // Verify covariance from any reference-type (interface) to object Assert.IsTrue(Other_TestClass_covariance_explicit_02.testMethod()); } [TestMethod] public void Othercovariance_explicit_03_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any class-type S to any class-type T, provided S is base class of T"); + // Array Covariance + // Verify covariance from any class-type S to any class-type T, provided S is base class of T Assert.IsTrue(Other_TestClass_covariance_explicit_03.testMethod()); } [TestMethod] public void Othercovariance_explicit_04_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any interface-type S to any interface-type T, provided S is not derived from T"); + // Array Covariance + // Verify covariance from any interface-type S to any interface-type T, provided S is not derived from T Assert.IsTrue(Other_TestClass_covariance_explicit_04.testMethod()); } [TestMethod] public void Othercovariance_implicit_01_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any reference-type (class) to object"); + // Array Covariance + // Verify covariance from any reference-type (class) to object Assert.IsTrue(Other_TestClass_covariance_implicit_01.testMethod()); } [TestMethod] public void Othercovariance_implicit_02_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any reference-type (interface) to object"); + // Array Covariance + // Verify covariance from any reference-type (interface) to object Assert.IsTrue(Other_TestClass_covariance_implicit_02.testMethod()); } [TestMethod] public void Othercovariance_implicit_03_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any class-type S to any class-type T, provided S is derived from T"); + // Array Covariance + // Verify covariance from any class-type S to any class-type T, provided S is derived from T Assert.IsTrue(Other_TestClass_covariance_implicit_03.testMethod()); } [TestMethod] public void Othercovariance_implicit_04_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any class-type S to any interface-type T, provided S implements T"); + // Array Covariance + // Verify covariance from any class-type S to any interface-type T, provided S implements T Assert.IsTrue(Other_TestClass_covariance_implicit_04.testMethod()); } [TestMethod] public void Othercovariance_implicit_05_Test() { - OutputHelper.WriteLine("Array Covariance"); - OutputHelper.WriteLine("Verify covariance from any interface-type S to any interface-type T, provided S is derived from T"); + // Array Covariance + // Verify covariance from any interface-type S to any interface-type T, provided S is derived from T Assert.IsTrue(Other_TestClass_covariance_implicit_05.testMethod()); } [TestMethod] public void BinarySearch_Test() { - OutputHelper.WriteLine("Array.BinarySearch"); + // Array.BinarySearch var objects = new MyClass[6]; for (int i = 0; i < 6; i++) @@ -312,7 +312,7 @@ class Other_TestClass_covariance_explicit_02_Imp : Other_TestClass_covariance_ex { public int testmethod() { - OutputHelper.WriteLine("Other_TestClass_covariance_explicit_02_Imp::testmethod()"); + // Other_TestClass_covariance_explicit_02_Imp::testmethod() return 0; } } @@ -437,7 +437,7 @@ class Other_TestClass_covariance_implicit_02_Imp : Other_TestClass_covariance_im { public int testmethod() { - OutputHelper.WriteLine("Other_TestClass_covariance_implicit_02_Imp::testmethod()"); + // Other_TestClass_covariance_implicit_02_Imp::testmethod() return 0; } } diff --git a/Tests/NFUnitTestArray/UnitTestSimpleTests.cs b/Tests/NFUnitTestArray/UnitTestSimpleTests.cs index bc9c082f..770b43b7 100644 --- a/Tests/NFUnitTestArray/UnitTestSimpleTests.cs +++ b/Tests/NFUnitTestArray/UnitTestSimpleTests.cs @@ -16,961 +16,961 @@ class UnitTestSimpleTests [TestMethod] public void Simple_decl_decl_01_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type int"); + // Arrays - Declarations + // Declare a simple array of type int Assert.IsTrue(Simple_TestClass_decl_decl_01.testMethod()); } [TestMethod] public void Simple_decl_decl_02_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type byte"); + // Arrays - Declarations + // Declare a simple array of type byte Assert.IsTrue(Simple_TestClass_decl_decl_02.testMethod()); } [TestMethod] public void Simple_decl_decl_03_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type short"); + // Arrays - Declarations + // Declare a simple array of type short Assert.IsTrue(Simple_TestClass_decl_decl_03.testMethod()); } [TestMethod] public void Simple_decl_decl_04_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type long"); + // Arrays - Declarations + // Declare a simple array of type long Assert.IsTrue(Simple_TestClass_decl_decl_04.testMethod()); } [TestMethod] public void Simple_decl_decl_05_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type char"); + // Arrays - Declarations + // Declare a simple array of type char Assert.IsTrue(Simple_TestClass_decl_decl_05.testMethod()); } [TestMethod] public void Simple_decl_decl_06_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type double"); + // Arrays - Declarations + // Declare a simple array of type double Assert.IsTrue(Simple_TestClass_decl_decl_06.testMethod()); } [TestMethod] public void Simple_decl_decl_07_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type float"); + // Arrays - Declarations + // Declare a simple array of type float Assert.IsTrue(Simple_TestClass_decl_decl_07.testMethod()); } [TestMethod] public void Simple_decl_decl_08_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type double"); + // Arrays - Declarations + // Declare a simple array of type double Assert.IsTrue(Simple_TestClass_decl_decl_08.testMethod()); } [TestMethod] public void Simple_decl_decl_09_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type bool"); + // Arrays - Declarations + // Declare a simple array of type bool Assert.IsTrue(Simple_TestClass_decl_decl_09.testMethod()); } [TestMethod] public void Simple_decl_decl_10_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of a user-defined struct"); + // Arrays - Declarations + // Declare a simple array of a user-defined struct Assert.IsTrue(Simple_TestClass_decl_decl_10.testMethod()); } [TestMethod] public void Simple_decl_decl_11_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of a user-defined class"); + // Arrays - Declarations + // Declare a simple array of a user-defined class Assert.IsTrue(Simple_TestClass_decl_decl_11.testMethod()); } [TestMethod] public void Simple_decl_decl_12_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of a user-defined interface"); + // Arrays - Declarations + // Declare a simple array of a user-defined interface Assert.IsTrue(Simple_TestClass_decl_decl_12.testMethod()); } [TestMethod] public void Simple_decl_decl_13_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type object"); + // Arrays - Declarations + // Declare a simple array of type object Assert.IsTrue(Simple_TestClass_decl_decl_13.testMethod()); } [TestMethod] public void Simple_decl_decl_14_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of delegates"); + // Arrays - Declarations + // Declare a simple array of delegates Assert.IsTrue(Simple_TestClass_decl_decl_14.testMethod()); } [TestMethod] public void Simple_decl_decl_15_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Declare a simple array of type System.Array"); + // Arrays - Declarations + // Declare a simple array of type System.Array Assert.IsTrue(Simple_TestClass_decl_decl_15.testMethod()); } [TestMethod] public void Simple_decl_bounds_01_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" An array created as array[0] compiles successfully"); + // Arrays - Declarations + // An array created as array[0] compiles successfully Assert.IsTrue(Simple_TestClass_decl_bounds_01.testMethod()); } [TestMethod] public void Simple_decl_bounds_02_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" An array created as array[maxint] compiles successfully"); - OutputHelper.WriteLine("This test is expected to generate"); - OutputHelper.WriteLine("Out Of Memory System.Exception"); + // Arrays - Declarations + // An array created as array[maxint] compiles successfully + // This test is expected to generate + // Out Of Memory System.Exception Assert.IsFalse(Simple_TestClass_decl_bounds_02.testMethod()); - OutputHelper.WriteLine(" This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine(" It previously marked as known failure because of bug # 16823"); - OutputHelper.WriteLine(" The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 16823 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Simple_decl_bounds_03_Test() { - OutputHelper.WriteLine(" decl_bounds_03 "); - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" An array created as array[maxint+1] compiles successfully"); + // decl_bounds_03 + // Arrays - Declarations + // An array created as array[maxint+1] compiles successfully Assert.IsFalse(Simple_TestClass_decl_bounds_03.testMethod()); - OutputHelper.WriteLine(" This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine(" It previously marked as known failure because of bug # 16823"); - OutputHelper.WriteLine(" The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 16823 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Simple_decl_index_01_Test() { - OutputHelper.WriteLine(" decl_index_01 "); - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A char variable as an array index should work"); + // decl_index_01 + // Arrays - Declarations + // A char variable as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_01.testMethod()); } [TestMethod] public void Simple_decl_index_02_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A byte variable as an array index should work"); + // Arrays - Declarations + // A byte variable as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_02.testMethod()); } [TestMethod] public void Simple_decl_index_03_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A short variable as an array index should work"); + // Arrays - Declarations + // A short variable as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_03.testMethod()); } [TestMethod] public void Simple_decl_index_04_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A short literal as an array index should work"); + // Arrays - Declarations + // A short literal as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_04.testMethod()); } [TestMethod] public void Simple_decl_index_05_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A byte literal as an array index should work"); + // Arrays - Declarations + // A byte literal as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_05.testMethod()); } [TestMethod] public void Simple_decl_index_06_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A char literal as an array index should work"); + // Arrays - Declarations + // A char literal as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_06.testMethod()); } [TestMethod] public void Simple_decl_index_07_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A uint variable as an array index should work"); + // Arrays - Declarations + // A uint variable as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_07.testMethod()); } [TestMethod] public void Simple_decl_index_08_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A long variable as an array index should work"); + // Arrays - Declarations + // A long variable as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_08.testMethod()); } [TestMethod] public void Simple_decl_index_09_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A ulong variable as an array index should work"); + // Arrays - Declarations + // A ulong variable as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_09.testMethod()); } [TestMethod] public void Simple_decl_index_10_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A uint literal as an array index should work"); + // Arrays - Declarations + // A uint literal as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_10.testMethod()); } [TestMethod] public void Simple_decl_index_11_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A long literal as an array index should work"); + // Arrays - Declarations + // A long literal as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_11.testMethod()); } [TestMethod] public void Simple_decl_index_12_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" A ulong literal as an array index should work"); + // Arrays - Declarations + // A ulong literal as an array index should work Assert.IsTrue(Simple_TestClass_decl_index_12.testMethod()); } [TestMethod] public void Simple_decl_syntax_03_Test() { - OutputHelper.WriteLine(" Arrays - Declarations"); - OutputHelper.WriteLine(" Spaces after type and between brackets and comments do not affect arrays"); + // Arrays - Declarations + // Spaces after type and between brackets and comments do not affect arrays Assert.IsTrue(Simple_TestClass_decl_syntax_03.testMethod()); } [TestMethod] public void Simple_init_init_a_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type int using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type int using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_01.testMethod()); } [TestMethod] public void Simple_init_init_a_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type short using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type short using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_02.testMethod()); } [TestMethod] public void Simple_init_init_a_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type byte using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type byte using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_03.testMethod()); } [TestMethod] public void Simple_init_init_a_04_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type long using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type long using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_04.testMethod()); } [TestMethod] public void Simple_init_init_a_05_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type double using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type double using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_05.testMethod()); } [TestMethod] public void Simple_init_init_a_06_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type float using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type float using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_06.testMethod()); } [TestMethod] public void Simple_init_init_a_08_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type String using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type String using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_08.testMethod()); } [TestMethod] public void Simple_init_init_a_09_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type char using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type char using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_09.testMethod()); } [TestMethod] public void Simple_init_init_a_10_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type bool using new (longhand)"); + // Arrays - Initialization + // Initialization of arrays of type bool using new (longhand) Assert.IsTrue(Simple_TestClass_init_init_a_10.testMethod()); } [TestMethod] public void Simple_init_init_b_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type int using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type int using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_01.testMethod()); } [TestMethod] public void Simple_init_init_b_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type short using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type short using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_02.testMethod()); } [TestMethod] public void Simple_init_init_b_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type byte using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type byte using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_03.testMethod()); } [TestMethod] public void Simple_init_init_b_04_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type long using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type long using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_04.testMethod()); } [TestMethod] public void Simple_init_init_b_05_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type double using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type double using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_05.testMethod()); } [TestMethod] public void Simple_init_init_b_06_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type float using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type float using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_06.testMethod()); } [TestMethod] public void Simple_init_init_b_08_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type String using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type String using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_08.testMethod()); } [TestMethod] public void Simple_init_init_b_09_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type char using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type char using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_09.testMethod()); } [TestMethod] public void Simple_init_init_b_10_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type bool using new (shorthand)"); + // Arrays - Initialization + // Initialization of arrays of type bool using new (shorthand) Assert.IsTrue(Simple_TestClass_init_init_b_10.testMethod()); } [TestMethod] public void Simple_init_init_c_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type int using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type int using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_01.testMethod()); } [TestMethod] public void Simple_init_init_c_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type short using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type short using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_02.testMethod()); } [TestMethod] public void Simple_init_init_c_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type byte using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type byte using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_03.testMethod()); } [TestMethod] public void Simple_init_init_c_04_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type long using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type long using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_04.testMethod()); } [TestMethod] public void Simple_init_init_c_05_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type double using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type double using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_05.testMethod()); } [TestMethod] public void Simple_init_init_c_06_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type float using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type float using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_06.testMethod()); } [TestMethod] public void Simple_init_init_c_08_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type String using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type String using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_08.testMethod()); } [TestMethod] public void Simple_init_init_c_09_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type char using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type char using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_09.testMethod()); } [TestMethod] public void Simple_init_init_c_10_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type bool using new (# init values sets array size)"); + // Arrays - Initialization + // Initialization of arrays of type bool using new (# init values sets array size) Assert.IsTrue(Simple_TestClass_init_init_c_10.testMethod()); } [TestMethod] public void Simple_init_init_d_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type int using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type int using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_01.testMethod()); } [TestMethod] public void Simple_init_init_d_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type short using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type short using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_02.testMethod()); } [TestMethod] public void Simple_init_init_d_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type byte using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type byte using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_03.testMethod()); } [TestMethod] public void Simple_init_init_d_04_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type long using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type long using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_04.testMethod()); } [TestMethod] public void Simple_init_init_d_05_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type double using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type double using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_05.testMethod()); } [TestMethod] public void Simple_init_init_d_06_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type float using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type float using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_06.testMethod()); } [TestMethod] public void Simple_init_init_d_08_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type String using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type String using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_08.testMethod()); } [TestMethod] public void Simple_init_init_d_09_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type char using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type char using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_09.testMethod()); } [TestMethod] public void Simple_init_init_d_10_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type bool using new (longhand) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type bool using new (longhand) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_d_10.testMethod()); } [TestMethod] public void Simple_init_init_e_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type int using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type int using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_01.testMethod()); } [TestMethod] public void Simple_init_init_e_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type short using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type short using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_02.testMethod()); } [TestMethod] public void Simple_init_init_e_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type byte using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type byte using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_03.testMethod()); } [TestMethod] public void Simple_init_init_e_04_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type long using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type long using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_04.testMethod()); } [TestMethod] public void Simple_init_init_e_05_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type double using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type double using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_05.testMethod()); } [TestMethod] public void Simple_init_init_e_06_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type float using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type float using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_06.testMethod()); } [TestMethod] public void Simple_init_init_e_08_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type String using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type String using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_08.testMethod()); } [TestMethod] public void Simple_init_init_e_09_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type char using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type char using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_09.testMethod()); } [TestMethod] public void Simple_init_init_e_10_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type bool using new (# init values sets array size) separate from decl statement"); + // Arrays - Initialization + // Initialization of arrays of type bool using new (# init values sets array size) separate from decl statement Assert.IsTrue(Simple_TestClass_init_init_e_10.testMethod()); } [TestMethod] public void Simple_init_syntax_09_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Syntax - Whitespace and comments in braces should not affect anything"); + // Arrays - Initialization + // Syntax - Whitespace and comments in braces should not affect anything Assert.IsTrue(Simple_TestClass_init_syntax_09.testMethod()); } [TestMethod] public void Simple_init_syntax_11_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Syntax - zero elements in initializer should create zero length array"); + // Arrays - Initialization + // Syntax - zero elements in initializer should create zero length array Assert.IsTrue(Simple_TestClass_init_syntax_11.testMethod()); } [TestMethod] public void Simple_init_syntax_12_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Syntax - zero elements in initializer should be allowed for 0-length array"); + // Arrays - Initialization + // Syntax - zero elements in initializer should be allowed for 0-length array Assert.IsTrue(Simple_TestClass_init_syntax_12.testMethod()); } [TestMethod] public void Simple_init_decl_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Declaration - if initializer is used, a provided index can be a const"); + // Arrays - Initialization + // Declaration - if initializer is used, a provided index can be a const Assert.IsTrue(Simple_TestClass_init_decl_02.testMethod()); } [TestMethod] public void Simple_init_decl_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Declaration - if initializer is used, a provided index can be a const short"); + // Arrays - Initialization + // Declaration - if initializer is used, a provided index can be a const short Assert.IsTrue(Simple_TestClass_init_decl_03.testMethod()); } [TestMethod] public void Simple_init_decl_04_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Declaration - if initializer is used, a provided index can be a const byte"); + // Arrays - Initialization + // Declaration - if initializer is used, a provided index can be a const byte Assert.IsTrue(Simple_TestClass_init_decl_04.testMethod()); } [TestMethod] public void Simple_init_decl_05_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Declaration - if initializer is used, a provided index can be a const long casted to an int"); + // Arrays - Initialization + // Declaration - if initializer is used, a provided index can be a const long casted to an int Assert.IsTrue(Simple_TestClass_init_decl_05.testMethod()); } [TestMethod] public void Simple_init_shorthand_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Initialization of arrays of type int using new (shorthand)"); - OutputHelper.WriteLine(" This is to verify bug #52958 doesn't regress"); + // Arrays - Initialization + // Initialization of arrays of type int using new (shorthand) + // This is to verify bug #52958 doesn't regress Assert.IsTrue(Simple_TestClass_init_shorthand_01.testMethod()); } [TestMethod] public void Simple_init_constinit_01_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Ensure all constant init optimization code paths are covered: all constants (VS7:124565 for more info)"); + // Arrays - Initialization + // Ensure all constant init optimization code paths are covered: all constants (VS7:124565 for more info) Assert.IsTrue(Simple_TestClass_init_constinit_01.testMethod()); } [TestMethod] public void Simple_init_constinit_02_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Ensure all constant init optimization code paths are covered: all variables (VS7:124565 for more info)"); + // Arrays - Initialization + // Ensure all constant init optimization code paths are covered: all variables (VS7:124565 for more info) Assert.IsTrue(Simple_TestClass_init_constinit_02.testMethod()); } [TestMethod] public void Simple_init_constinit_03_Test() { - OutputHelper.WriteLine(" Arrays - Initialization"); - OutputHelper.WriteLine(" Ensure all constant init optimization code paths are covered: half variables and half constants (VS7:124565 for more info)"); + // Arrays - Initialization + // Ensure all constant init optimization code paths are covered: half variables and half constants (VS7:124565 for more info) Assert.IsTrue(Simple_TestClass_init_constinit_03.testMethod()); } [TestMethod] public void Simple_acc_iter_length_01_Test() { - OutputHelper.WriteLine(" acc_iter_length_01 "); - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Declare simple arrays of various lengths and verify that array.Length is correct"); + // acc_iter_length_01 + // Arrays - Access and Iteration + // Declare simple arrays of various lengths and verify that array.Length is correct Assert.IsTrue(Simple_TestClass_acc_iter_length_01.testMethod()); } [TestMethod] public void Simple_acc_iter_bounds_01_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's 0th element should work fine"); + // Arrays - Access and Iteration + // Accessing an array's 0th element should work fine Assert.IsTrue(Simple_TestClass_acc_iter_bounds_01.testMethod()); } [TestMethod] public void Simple_acc_iter_bounds_02_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's maxlength element should work fine"); + // Arrays - Access and Iteration + // Accessing an array's maxlength element should work fine Assert.IsTrue(Simple_TestClass_acc_iter_bounds_02.testMethod()); } [TestMethod] public void Simple_acc_iter_bounds_03_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's -1 element should throw an System.Exception"); + // Arrays - Access and Iteration + // Accessing an array's -1 element should throw an System.Exception Assert.IsTrue(Simple_TestClass_acc_iter_bounds_03.testMethod()); } [TestMethod] public void Simple_acc_iter_bounds_04_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's maxlength+1 element should throw an System.Exception"); + // Arrays - Access and Iteration + // Accessing an array's maxlength+1 element should throw an System.Exception Assert.IsTrue(Simple_TestClass_acc_iter_bounds_04.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_a_01_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a variable of type int should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a variable of type int should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_a_01.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_a_02_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a variable of type short should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a variable of type short should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_a_02.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_a_03_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a variable of type byte should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a variable of type byte should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_a_03.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_a_04_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a variable of type char should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a variable of type char should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_a_04.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_a_06_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a variable of type long should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a variable of type long should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_a_06.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_b_01_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with an int literal should work"); + // Arrays - Access and Iteration + // Accessing an array's index with an int literal should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_b_01.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_b_02_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a short literal should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a short literal should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_b_02.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_b_03_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a byte literal should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a byte literal should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_b_03.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_b_04_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a char literal should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a char literal should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_b_04.testMethod()); } [TestMethod] public void Simple_acc_iter_idxtype_b_06_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Accessing an array's index with a variable of type long should work"); + // Arrays - Access and Iteration + // Accessing an array's index with a variable of type long should work Assert.IsTrue(Simple_TestClass_acc_iter_idxtype_b_06.testMethod()); } [TestMethod] public void Simple_acc_iter_iter_01_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Declare simple array of int, init it through iteration, verify values are correct"); + // Arrays - Access and Iteration + // Declare simple array of int, init it through iteration, verify values are correct Assert.IsTrue(Simple_TestClass_acc_iter_iter_01.testMethod()); } [TestMethod] public void Simple_acc_iter_iter_02_Test() { - OutputHelper.WriteLine(" Arrays - Access and Iteration"); - OutputHelper.WriteLine(" Declare simple array of char, init it through individual element assignments, verify correctness"); + // Arrays - Access and Iteration + // Declare simple array of char, init it through individual element assignments, verify correctness Assert.IsTrue(Simple_TestClass_acc_iter_iter_02.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_01_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning int type literals into array elements should work"); + // Arrays - Assignments + // Assigning int type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_01.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_02_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning byte type literals into array elements should work"); + // Arrays - Assignments + // Assigning byte type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_02.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_03_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning short type literals into array elements should work"); + // Arrays - Assignments + // Assigning short type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_03.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_04_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning long type literals into array elements should work"); + // Arrays - Assignments + // Assigning long type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_04.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_05_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning char type literals into array elements should work"); + // Arrays - Assignments + // Assigning char type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_05.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_06_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning double type literals into array elements should work"); + // Arrays - Assignments + // Assigning double type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_06.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_07_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning float type literals into array elements should work"); + // Arrays - Assignments + // Assigning float type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_07.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_08_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning double type literals into array elements should work"); + // Arrays - Assignments + // Assigning double type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_08.testMethod()); } [TestMethod] public void Simple_assign_smpass_a_09_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning bool type literals into array elements should work"); + // Arrays - Assignments + // Assigning bool type literals into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_a_09.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_01_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning int type variables into array elements should work"); + // Arrays - Assignments + // Assigning int type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_01.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_02_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning byte type variables into array elements should work"); + // Arrays - Assignments + // Assigning byte type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_02.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_03_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning short type variables into array elements should work"); + // Arrays - Assignments + // Assigning short type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_03.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_04_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning long type variables into array elements should work"); + // Arrays - Assignments + // Assigning long type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_04.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_05_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning char type variables into array elements should work"); + // Arrays - Assignments + // Assigning char type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_05.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_06_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning double type variables into array elements should work"); + // Arrays - Assignments + // Assigning double type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_06.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_07_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning float type variables into array elements should work"); + // Arrays - Assignments + // Assigning float type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_07.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_08_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning double type variables into array elements should work"); + // Arrays - Assignments + // Assigning double type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_08.testMethod()); } [TestMethod] public void Simple_assign_smpass_b_09_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning bool type variables into array elements should work"); + // Arrays - Assignments + // Assigning bool type variables into array elements should work Assert.IsTrue(Simple_TestClass_assign_smpass_b_09.testMethod()); } [TestMethod] public void Simple_assign_badass_01_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning null to an array variable should work"); + // Arrays - Assignments + // Assigning null to an array variable should work Assert.IsTrue(Simple_TestClass_assign_badass_01.testMethod()); } [TestMethod] public void Simple_assign_badass_03_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning a smaller array to a bigger array should work"); + // Arrays - Assignments + // Assigning a smaller array to a bigger array should work Assert.IsTrue(Simple_TestClass_assign_badass_03.testMethod()); } [TestMethod] public void Simple_assign_badass_04_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning a bigger array to a smaller array should work"); + // Arrays - Assignments + // Assigning a bigger array to a smaller array should work Assert.IsTrue(Simple_TestClass_assign_badass_04.testMethod()); } [TestMethod] public void Simple_assign_element_01_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning one element to another element of the same array should work"); + // Arrays - Assignments + // Assigning one element to another element of the same array should work Assert.IsTrue(Simple_TestClass_assign_element_01.testMethod()); } [TestMethod] public void Simple_assign_element_02_Test() { - OutputHelper.WriteLine(" Arrays - Assignments"); - OutputHelper.WriteLine(" Assigning one element to another element of a different array should work"); + // Arrays - Assignments + // Assigning one element to another element of a different array should work Assert.IsTrue(Simple_TestClass_assign_element_02.testMethod()); } [TestMethod] public void Simple_assign_argpass_01_Test() { - OutputHelper.WriteLine(" Arrays - Assignments - Passing elements to methods"); - OutputHelper.WriteLine(" Passing an element to a function should work"); + // Arrays - Assignments - Passing elements to methods + // Passing an element to a function should work Assert.IsTrue(Simple_TestClass_assign_argpass_01.testMethod()); } [TestMethod] public void Simple_assign_argpass_02_Test() { - OutputHelper.WriteLine(" Arrays - Assignments - Passing elements to methods"); - OutputHelper.WriteLine(" Passing an element to a function as a ref parameter should work"); + // Arrays - Assignments - Passing elements to methods + // Passing an element to a function as a ref parameter should work Assert.IsTrue(Simple_TestClass_assign_argpass_02.testMethod()); } [TestMethod] public void Simple_assign_argpass_03_Test() { - OutputHelper.WriteLine(" Arrays - Assignments - Passing elements to methods"); - OutputHelper.WriteLine(" Passing an element to a function as an out parameter should work"); + // Arrays - Assignments - Passing elements to methods + // Passing an element to a function as an out parameter should work Assert.IsTrue(Simple_TestClass_assign_argpass_03.testMethod()); } [TestMethod] public void Simple_object_sysarr_01_Test() { - OutputHelper.WriteLine(" Arrays - As Object and System.Array"); - OutputHelper.WriteLine(" Testing the System.Array methods and Properties: System.Array.Clear()"); + // Arrays - As Object and System.Array + // Testing the System.Array methods and Properties: System.Array.Clear() Assert.IsTrue(Simple_TestClass_object_sysarr_01.testMethod()); } [TestMethod] public void Simple_object_sysarr_02_Test() { - OutputHelper.WriteLine(" Arrays - As Object and System.Array"); - OutputHelper.WriteLine(" Testing the System.Array methods and Properties: Length property"); + // Arrays - As Object and System.Array + // Testing the System.Array methods and Properties: Length property Assert.IsTrue(Simple_TestClass_object_sysarr_02.testMethod()); } @@ -1192,7 +1192,7 @@ public static int Main_old() } catch (System.Exception) { - OutputHelper.WriteLine("Out Of Memory System.Exception"); + // Out Of Memory System.Exception } return 1; } diff --git a/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs b/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs index e22bf662..511f56fc 100644 --- a/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs +++ b/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs @@ -17,28 +17,28 @@ public class UnitTestAttributesTest1 [TestMethod] public void Attrib_attrib000_Test() { - OutputHelper.WriteLine("Declare a basic attribute class, example from C# Language reference, 1.1"); + // Declare a basic attribute class, example from C# Language reference, 1.1 Assert.IsTrue(Attrib_TestClass_attrib000.testMethod()); } [TestMethod] public void Attrib_attrib000_2_Test() { - OutputHelper.WriteLine("17.1 - A non-abstract attribute class must have public accessibility."); + // 17.1 - A non-abstract attribute class must have public accessibility. Assert.IsTrue(Attrib_TestClass_attrib000_2.testMethod()); } [TestMethod] public void Attrib_attrib001_Test() { - OutputHelper.WriteLine("Declare a basic attribute class, example from C# Language reference, 1.1"); + // Declare a basic attribute class, example from C# Language reference, 1.1 Assert.IsTrue(Attrib_TestClass_attrib001.testMethod()); } [TestMethod] public void Attrib_attrib002_Test() { - OutputHelper.WriteLine("Declare a basic attribute class, example from C# Language reference, 1.1"); + // Declare a basic attribute class, example from C# Language reference, 1.1 Assert.IsTrue(Attrib_TestClass_attrib002.testMethod()); } @@ -46,14 +46,14 @@ public void Attrib_attrib002_Test() //[TestMethod] //public void Attrib_attrib017_7a_Test() //{ - // OutputHelper.WriteLine("17.4.5 test of conditional when DEBUG is undefined"); + // // 17.4.5 test of conditional when DEBUG is undefined // Assert.IsTrue(Attrib_TestClass_attrib017_7a.testMethod()); //} [TestMethod] public void Attrib_attrib017_8c_Test() { - OutputHelper.WriteLine("17.4.5 - Example from CLR"); + // 17.4.5 - Example from CLR Assert.IsTrue(Attrib_TestClass_attrib017_8c.testMethod()); } @@ -61,70 +61,70 @@ public void Attrib_attrib017_8c_Test() [TestMethod] public void Attrib_attrib021_2_Test() { - OutputHelper.WriteLine("CLR 17.4.9 - guid Attribute"); + // CLR 17.4.9 - guid Attribute Assert.IsTrue(Attrib_TestClass_attrib021_2.testMethod()); } [TestMethod] public void Attrib_attrib021_4_Test() { - OutputHelper.WriteLine("CLR 17.4.9 - guid Attribute"); + // CLR 17.4.9 - guid Attribute Assert.IsTrue(Attrib_TestClass_attrib021_4.testMethod()); } [TestMethod] public void Attrib_attrib029_8_Test() { - OutputHelper.WriteLine("CLR 17.4.19 - obsolete"); - OutputHelper.WriteLine("obsolete can be used on any declaration, but should be able to call"); - OutputHelper.WriteLine("obsolete methods"); + // CLR 17.4.19 - obsolete + // obsolete can be used on any declaration, but should be able to call + // obsolete methods Assert.IsTrue(Attrib_TestClass_attrib029_8.testMethod()); } [TestMethod] public void Attrib_attrib029_9_Test() { - OutputHelper.WriteLine("CLR 17.4.19 - obsolete"); - OutputHelper.WriteLine("obsolete can be used on any declaration, but should be able to call"); - OutputHelper.WriteLine("obsolete methods"); + // CLR 17.4.19 - obsolete + // obsolete can be used on any declaration, but should be able to call + // obsolete methods Assert.IsTrue(Attrib_TestClass_attrib029_9.testMethod()); } [TestMethod] public void Attrib_attrib029_a_Test() { - OutputHelper.WriteLine("CLR 17.4.19 - obsolete"); - OutputHelper.WriteLine("obsolete can be used on any declaration, but should be able to call"); - OutputHelper.WriteLine("obsolete methods"); + // CLR 17.4.19 - obsolete + // obsolete can be used on any declaration, but should be able to call + // obsolete methods Assert.IsTrue(Attrib_TestClass_attrib029_a.testMethod()); } [TestMethod] public void Attrib_attrib029_b_Test() { - OutputHelper.WriteLine("CLR 17.4.19 - obsolete"); - OutputHelper.WriteLine("obsolete can be used on any declaration, but overrides should generate warning"); + // CLR 17.4.19 - obsolete + // obsolete can be used on any declaration, but overrides should generate warning Assert.IsTrue(Attrib_TestClass_attrib029_b.testMethod()); } [TestMethod] public void Attrib_attrib031_4_Test() { - OutputHelper.WriteLine("CLR 17.4.22 - serializable Attribute"); + // CLR 17.4.22 - serializable Attribute Assert.IsTrue(Attrib_TestClass_attrib031_4.testMethod()); } [TestMethod] public void Attrib_attrib032_2_Test() { - OutputHelper.WriteLine("CLR 17.4.23 - structlayout Attribute"); + // CLR 17.4.23 - structlayout Attribute Assert.IsTrue(Attrib_TestClass_attrib032_2.testMethod()); } [TestMethod] public void Attrib_attrib033_2_Test() { - OutputHelper.WriteLine("Attribute usage is inherited."); + // Attribute usage is inherited. Assert.IsTrue(Attrib_TestClass_attrib033_2.testMethod()); } @@ -134,7 +134,7 @@ public void Attrib_attrib033_2_Test() [TestMethod] public void Attrib_attrib035_12_Test() { - OutputHelper.WriteLine("Make sure that assembly level GuidAttribute appears in assembly"); + // Make sure that assembly level GuidAttribute appears in assembly Assert.IsTrue(Attrib_TestClass_attrib035_12.testMethod()) { return MFTestResults.Pass; @@ -144,7 +144,7 @@ public void Attrib_attrib035_12_Test() [TestMethod] public void Attrib_attrib035_22_Test() { - OutputHelper.WriteLine("Make sure that assembly level GuidAttribute appears in assembly"); + // Make sure that assembly level GuidAttribute appears in assembly Assert.IsTrue(Attrib_TestClass_attrib035_22.testMethod()) { return MFTestResults.Pass; @@ -156,64 +156,64 @@ public void Attrib_attrib035_22_Test() [TestMethod] public void Attrib_attrib036_1_Test() { - OutputHelper.WriteLine("17.1 - A top-level, non-abstract attribute class must have public or"); - OutputHelper.WriteLine("internal accessibility. Nested attribute classes may also be private,"); - OutputHelper.WriteLine("protected, or protected internal."); + // 17.1 - A top-level, non-abstract attribute class must have public or + // internal accessibility. Nested attribute classes may also be private, + // protected, or protected internal. Assert.IsTrue(Attrib_TestClass_attrib036_1.testMethod()); } [TestMethod] public void Attrib_attrib038_1_Test() { - OutputHelper.WriteLine("Verify params keyword"); + // Verify params keyword Assert.IsTrue(Attrib_TestClass_attrib038_1.testMethod()); } [TestMethod] public void Attrib_attrib047_4_Test() { - OutputHelper.WriteLine(" Make sure that ObsoleteAttribute works with following targets"); - OutputHelper.WriteLine("[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |"); - OutputHelper.WriteLine(" AttributeTargets.Enum | AttributeTargets.Constructor |"); - OutputHelper.WriteLine(" AttributeTargets.Method | AttributeTargets.Property |"); - OutputHelper.WriteLine(" AttributeTargets.Field | AttributeTargets.Event |"); - OutputHelper.WriteLine(" AttributeTargets.Interface | AttributeTargets.Delegate)]"); + // Make sure that ObsoleteAttribute works with following targets + // [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | + // AttributeTargets.Enum | AttributeTargets.Constructor | + // AttributeTargets.Method | AttributeTargets.Property | + // AttributeTargets.Field | AttributeTargets.Event | + // AttributeTargets.Interface | AttributeTargets.Delegate)] Assert.IsTrue(Attrib_TestClass_attrib047_4.testMethod()); } [TestMethod] public void Attrib_attrib047_5_Test() { - OutputHelper.WriteLine(" Make sure that ObsoleteAttribute works with following targets"); - OutputHelper.WriteLine("[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |"); - OutputHelper.WriteLine(" AttributeTargets.Enum | AttributeTargets.Constructor |"); - OutputHelper.WriteLine(" AttributeTargets.Method | AttributeTargets.Property |"); - OutputHelper.WriteLine(" AttributeTargets.Field | AttributeTargets.Event |"); - OutputHelper.WriteLine(" AttributeTargets.Interface | AttributeTargets.Delegate)]"); + // Make sure that ObsoleteAttribute works with following targets + // [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | + // AttributeTargets.Enum | AttributeTargets.Constructor | + // AttributeTargets.Method | AttributeTargets.Property | + // AttributeTargets.Field | AttributeTargets.Event | + // AttributeTargets.Interface | AttributeTargets.Delegate)] Assert.IsTrue(Attrib_TestClass_attrib047_5.testMethod()); } [TestMethod] public void Attrib_attrib049_4_Test() { - OutputHelper.WriteLine("Bad named attribute argumements should be an error"); + // Bad named attribute argumements should be an error Assert.IsTrue(Attrib_TestClass_attrib049_4.testMethod()); } [TestMethod] public void Attrib_attrib054_Test() { - OutputHelper.WriteLine("ECMA complaince: support special attribute name binding rules with @ identifier"); - OutputHelper.WriteLine("explictly specify attribute location with @"); + // ECMA complaince: support special attribute name binding rules with @ identifier + // explictly specify attribute location with @ Assert.IsTrue(Attrib_TestClass_attrib054.testMethod()); } [TestMethod] public void Attrib_attrib062_Test() { - OutputHelper.WriteLine("Declare a derived attribute after declaring its base."); - OutputHelper.WriteLine("Attributes can inherit from other attirubtes that have not yet been declared as long as there are no"); - OutputHelper.WriteLine("circular dependencies."); + // Declare a derived attribute after declaring its base. + // Attributes can inherit from other attirubtes that have not yet been declared as long as there are no + // circular dependencies. Assert.IsTrue(Attrib_TestClass_attrib062.testMethod()); } @@ -295,7 +295,7 @@ public class Attrib_TestClass_attrib017_7a_C1 public static void M() { Attrib_TestClass_attrib017_7a.retval++; - OutputHelper.WriteLine("Executed Attrib_TestClass_attrib017_7a_C1.M"); + // Executed Attrib_TestClass_attrib017_7a_C1.M } } public class Attrib_TestClass_attrib017_7a_C2 @@ -325,7 +325,7 @@ class Attrib_TestClass_attrib017_8c_C1 [Conditional("DEBUG")] public static void C1() { - OutputHelper.WriteLine("Executed Class1.C1()"); + // Executed Class1.C1() } } @@ -333,7 +333,7 @@ class Attrib_TestClass_attrib017_8c_C2 { public static void C2() { - OutputHelper.WriteLine("Executed Class2.C2()"); + // Executed Class2.C2() Attrib_TestClass_attrib017_8c_C1.C1(); // C1 is called } } @@ -342,7 +342,7 @@ class Attrib_TestClass_attrib017_8c_C3 { public static void C4() { - OutputHelper.WriteLine("Executed Attrib_TestClass_attrib017_8c_C3.C4()"); + // Executed Attrib_TestClass_attrib017_8c_C3.C4() Attrib_TestClass_attrib017_8c_C1.C1(); } } @@ -437,10 +437,17 @@ public static int Main_old() retval -= 2; Attrib_TestClass_attrib029_8_S1 s1 = new Attrib_TestClass_attrib029_8_S1(); s1.j = 10; + if (10 == s1.j) + { retval -= 4; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + + if (0 != retval) + { + OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + return retval; } public static bool testMethod() @@ -478,10 +485,17 @@ public static int Main_old() if (anInt == 5) retval -= 2; Attrib_TestClass_attrib029_9_S1 s1 = new Attrib_TestClass_attrib029_9_S1(); + if (10 == s1.S1Method(10)) + { retval -= 4; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + + if (0 != retval) + { + OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + return retval; } public static bool testMethod() @@ -519,10 +533,17 @@ public static int Main_old() retval -= 1; Attrib_TestClass_attrib029_a_S1 s1 = new Attrib_TestClass_attrib029_a_S1(); s1.j = 10; + if (10 == s1.j) + { retval -= 2; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + + if (0 != retval) + { + OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + return retval; } public static bool testMethod() @@ -554,10 +575,17 @@ public static int Main_old() { Attrib_TestClass_attrib029_b_C1 c1 = new Attrib_TestClass_attrib029_b_C1(); int anInt = c1.C1Method(5); + if (anInt == 5) + { retval -= 2; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + + if (0 == retval) + { + OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); + } + return retval; } public static bool testMethod() @@ -574,10 +602,10 @@ public static int Main_old() { if (typeof(Attrib_TestClass_attrib031_4_C1).IsSerializable) { - OutputHelper.WriteLine("PASS"); + // PASS return 0; } - OutputHelper.WriteLine("FAIL"); + // FAIL return 1; } public static bool testMethod() @@ -642,7 +670,7 @@ public static int Main_old() retval -= 2; } catch { } //Just keep the program from dying - if (retval == 0) OutputHelper.WriteLine("PASS"); + if (retval == 0) // PASS else OutputHelper.WriteLine("FAIL, retval == {0}", retval); return retval; } @@ -657,7 +685,7 @@ public static int Main_old() { Attrib_TestClass_attrib035_22_C5 x = new Attrib_TestClass_attrib035_22_C5(); int retval = x.MyMethod(); - if (retval == 0) OutputHelper.WriteLine("PASS"); + if (retval == 0) // PASS else OutputHelper.WriteLine("FAIL, retval == {0}", retval); return retval; } @@ -709,7 +737,7 @@ public class Attrib_TestClass_attrib038_1_C1 { public void Attrib_TestClass_attrib038_1(params int[] numbers) { - OutputHelper.WriteLine("Called with " + numbers.Length.ToString() + " args"); + // Called with " + numbers.Length.ToString() + " args } } public class Attrib_TestClass_attrib038_1 diff --git a/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs b/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs index 29d8ec60..54aa877a 100644 --- a/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs +++ b/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs @@ -16,1241 +16,1241 @@ public class UnitTestBasicConceptsTests [TestMethod] public void Basic_scope001_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a namespace member declared by"); - OutputHelper.WriteLine("a namespace-member-declaration with no enclosing"); - OutputHelper.WriteLine("namespace-declaration is the entire program text"); - OutputHelper.WriteLine("of each compilation unit."); + // Section 3.5 + // The scope of a namespace member declared by + // a namespace-member-declaration with no enclosing + // namespace-declaration is the entire program text + // of each compilation unit. Assert.IsTrue(Basic_TestClass_scope001.testMethod()); } [TestMethod] public void Basic_scope002_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a namespace member declared by a "); - OutputHelper.WriteLine("namespace-member-declaration within a "); - OutputHelper.WriteLine("namespace-declaration whose fully qualified name"); - OutputHelper.WriteLine("is N is the namespace-body of every namespace-declaration"); - OutputHelper.WriteLine("whose fully qualified name is N or starts with the same "); - OutputHelper.WriteLine("sequence of indentifiers as N."); + // Section 3.5 + // The scope of a namespace member declared by a + // namespace-member-declaration within a + // namespace-declaration whose fully qualified name + // is N is the namespace-body of every namespace-declaration + // whose fully qualified name is N or starts with the same + // sequence of indentifiers as N. Assert.IsTrue(NS_Basic_TestClass_scope002.Basic_TestClass_scope002.testMethod()); } [TestMethod] public void Basic_scope003_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a namespace member declared by a "); - OutputHelper.WriteLine("namespace-member-declaration within a "); - OutputHelper.WriteLine("namespace-declaration whose fully qualified name"); - OutputHelper.WriteLine("is N is the namespace-body of every namespace-declaration"); - OutputHelper.WriteLine("whose fully qualified name is N or starts with the same "); - OutputHelper.WriteLine("sequence of indentifiers as N."); + // Section 3.5 + // The scope of a namespace member declared by a + // namespace-member-declaration within a + // namespace-declaration whose fully qualified name + // is N is the namespace-body of every namespace-declaration + // whose fully qualified name is N or starts with the same + // sequence of indentifiers as N. Assert.IsTrue(NS_Basic_TestClass_scope003.Basic_TestClass_scope003.testMethod()); } [TestMethod] public void Basic_scope004_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a namespace member declared by a "); - OutputHelper.WriteLine("namespace-member-declaration within a "); - OutputHelper.WriteLine("namespace-declaration whose fully qualified name"); - OutputHelper.WriteLine("is N is the namespace-body of every namespace-declaration"); - OutputHelper.WriteLine("whose fully qualified name is N or starts with the same "); - OutputHelper.WriteLine("sequence of indentifiers as N."); + // Section 3.5 + // The scope of a namespace member declared by a + // namespace-member-declaration within a + // namespace-declaration whose fully qualified name + // is N is the namespace-body of every namespace-declaration + // whose fully qualified name is N or starts with the same + // sequence of indentifiers as N. Assert.IsTrue(NS_Basic_TestClass_scope004.NS_Basic_TestClass_scope004_2.Basic_TestClass_scope004.testMethod()); } [TestMethod] public void Basic_scope005_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a namespace member declared by a "); - OutputHelper.WriteLine("namespace-member-declaration within a "); - OutputHelper.WriteLine("namespace-declaration whose fully qualified name"); - OutputHelper.WriteLine("is N is the namespace-body of every namespace-declaration"); - OutputHelper.WriteLine("whose fully qualified name is N or starts with the same "); - OutputHelper.WriteLine("sequence of indentifiers as N."); + // Section 3.5 + // The scope of a namespace member declared by a + // namespace-member-declaration within a + // namespace-declaration whose fully qualified name + // is N is the namespace-body of every namespace-declaration + // whose fully qualified name is N or starts with the same + // sequence of indentifiers as N. Assert.IsTrue(NS_Basic_TestClass_scope005.NS_Basic_TestClass_scope005_2.Basic_TestClass_scope005.testMethod()); } [TestMethod] public void Basic_scope006_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a namespace member declared by a "); - OutputHelper.WriteLine("namespace-member-declaration within a "); - OutputHelper.WriteLine("namespace-declaration whose fully qualified name"); - OutputHelper.WriteLine("is N is the namespace-body of every namespace-declaration"); - OutputHelper.WriteLine("whose fully qualified name is N or starts with the same "); - OutputHelper.WriteLine("sequence of indentifiers as N."); + // Section 3.5 + // The scope of a namespace member declared by a + // namespace-member-declaration within a + // namespace-declaration whose fully qualified name + // is N is the namespace-body of every namespace-declaration + // whose fully qualified name is N or starts with the same + // sequence of indentifiers as N. Assert.IsTrue(NS_Basic_TestClass_scope006.NS_Basic_TestClass_scope006_2.Basic_TestClass_scope006.testMethod()); } [TestMethod] public void Basic_scope012_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a name defined or imported by a using-directive"); - OutputHelper.WriteLine("extends over the namespace-member-declarations of the"); - OutputHelper.WriteLine("compilation-unit or namespace-body in which the using-directive"); - OutputHelper.WriteLine("occurs."); + // Section 3.5 + // The scope of a name defined or imported by a using-directive + // extends over the namespace-member-declarations of the + // compilation-unit or namespace-body in which the using-directive + // occurs. Assert.IsTrue(NS_Basic_TestClass_scope012.Basic_TestClass_scope012.testMethod()); } [TestMethod] public void Basic_scope019_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a member declared by a class-member-declaration"); - OutputHelper.WriteLine("is the class body in which the declaration occurs."); + // Section 3.5 + // The scope of a member declared by a class-member-declaration + // is the class body in which the declaration occurs. Assert.IsTrue(Basic_TestClass_scope019.testMethod()); } [TestMethod] public void Basic_scope022_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a member declared by a class-member-declaration"); - OutputHelper.WriteLine("is the class body in which the declaration occurs. In addition,"); - OutputHelper.WriteLine("the scope of a class member extends to the class-body of those"); - OutputHelper.WriteLine("derived classes that are included in the accessibility domain"); - OutputHelper.WriteLine("of the member."); + // Section 3.5 + // The scope of a member declared by a class-member-declaration + // is the class body in which the declaration occurs. In addition, + // the scope of a class member extends to the class-body of those + // derived classes that are included in the accessibility domain + // of the member. Assert.IsTrue(Basic_TestClass_scope022.testMethod()); } [TestMethod] public void Basic_scope023_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a member declared by a class-member-declaration"); - OutputHelper.WriteLine("is the class body in which the declaration occurs. In addition,"); - OutputHelper.WriteLine("the scope of a class member extends to the class-body of those"); - OutputHelper.WriteLine("derived classes that are included in the accessibility domain"); - OutputHelper.WriteLine("of the member."); + // Section 3.5 + // The scope of a member declared by a class-member-declaration + // is the class body in which the declaration occurs. In addition, + // the scope of a class member extends to the class-body of those + // derived classes that are included in the accessibility domain + // of the member. Assert.IsTrue(Basic_TestClass_scope023.testMethod()); } [TestMethod] public void Basic_scope024_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a member declared by a class-member-declaration"); - OutputHelper.WriteLine("is the class body in which the declaration occurs. In addition,"); - OutputHelper.WriteLine("the scope of a class member extends to the class-body of those"); - OutputHelper.WriteLine("derived classes that are included in the accessibility domain"); - OutputHelper.WriteLine("of the member."); + // Section 3.5 + // The scope of a member declared by a class-member-declaration + // is the class body in which the declaration occurs. In addition, + // the scope of a class member extends to the class-body of those + // derived classes that are included in the accessibility domain + // of the member. Assert.IsTrue(Basic_TestClass_scope024.testMethod()); } [TestMethod] public void Basic_scope025_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a member declared by a struct-member-declaration"); - OutputHelper.WriteLine("is the struct-body in which the declaration occurs."); + // Section 3.5 + // The scope of a member declared by a struct-member-declaration + // is the struct-body in which the declaration occurs. Assert.IsTrue(Basic_TestClass_scope025.testMethod()); } [TestMethod] public void Basic_scope027_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a member declared by an enum-member-declaration"); - OutputHelper.WriteLine("is the enum-body in which the declaration occurs."); + // Section 3.5 + // The scope of a member declared by an enum-member-declaration + // is the enum-body in which the declaration occurs. Assert.IsTrue(Basic_TestClass_scope027.testMethod()); } [TestMethod] public void Basic_scope029_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a parameter declared in a constructor-declaration"); - OutputHelper.WriteLine("is the constructor-initializer and the block of that "); - OutputHelper.WriteLine("constructor-declaration."); + // Section 3.5 + // The scope of a parameter declared in a constructor-declaration + // is the constructor-initializer and the block of that + // constructor-declaration. Assert.IsTrue(Basic_TestClass_scope029.testMethod()); } [TestMethod] public void Basic_scope033_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a parameter declared in a method-declaration"); - OutputHelper.WriteLine("is the method-body of that method-declaration."); + // Section 3.5 + // The scope of a parameter declared in a method-declaration + // is the method-body of that method-declaration. Assert.IsTrue(Basic_TestClass_scope033.testMethod()); } [TestMethod] public void Basic_scope037_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a parameter declared in an indexer-declaration"); - OutputHelper.WriteLine("is the accessor-declarations of that indexer-declaration."); + // Section 3.5 + // The scope of a parameter declared in an indexer-declaration + // is the accessor-declarations of that indexer-declaration. Assert.IsTrue(Basic_TestClass_scope037.testMethod()); } [TestMethod] public void Basic_scope041_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a parameter declared in an operator-declaration"); - OutputHelper.WriteLine("is the block of that operator-declaration."); + // Section 3.5 + // The scope of a parameter declared in an operator-declaration + // is the block of that operator-declaration. Assert.IsTrue(Basic_TestClass_scope041.testMethod()); } [TestMethod] public void Basic_scope044_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a local variable declared in a local-variable-declaration"); - OutputHelper.WriteLine("is the block in which the declaration occurs. It is an error to refer to"); - OutputHelper.WriteLine("a lcaol variable in a textual position that precedes the variable-declaratior"); - OutputHelper.WriteLine("of the local variable."); + // Section 3.5 + // The scope of a local variable declared in a local-variable-declaration + // is the block in which the declaration occurs. It is an error to refer to + // a lcaol variable in a textual position that precedes the variable-declaratior + // of the local variable. Assert.IsTrue(Basic_TestClass_scope044.testMethod()); } [TestMethod] public void Basic_scope051_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a local variable in a for-initializer of a "); - OutputHelper.WriteLine("for statement is the for-initializer, the for-condition,"); - OutputHelper.WriteLine("the for-iterator, and the contained statement of the for"); - OutputHelper.WriteLine("statement."); + // Section 3.5 + // The scope of a local variable in a for-initializer of a + // for statement is the for-initializer, the for-condition, + // the for-iterator, and the contained statement of the for + // statement. Assert.IsTrue(Basic_TestClass_scope051.testMethod()); } [TestMethod] public void Basic_scope053_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a label declared in a label-statement"); - OutputHelper.WriteLine("is the block in which the declaration occurs."); + // Section 3.5 + // The scope of a label declared in a label-statement + // is the block in which the declaration occurs. Assert.IsTrue(Basic_TestClass_scope053.testMethod()); } [TestMethod] public void Basic_scope055_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a label declared in a label-statement"); - OutputHelper.WriteLine("is the block in which the declaration occurs."); + // Section 3.5 + // The scope of a label declared in a label-statement + // is the block in which the declaration occurs. Assert.IsTrue(Basic_TestClass_scope055.testMethod()); } [TestMethod] public void Basic_scope056_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("Within the scope of a namespace, class,"); - OutputHelper.WriteLine("struct, interface, or enumeration member "); - OutputHelper.WriteLine("it is possible to refer to the member in "); - OutputHelper.WriteLine("a textual position that precedes the "); - OutputHelper.WriteLine("declaration of the member."); + // Section 3.5 + // Within the scope of a namespace, class, + // struct, interface, or enumeration member + // it is possible to refer to the member in + // a textual position that precedes the + // declaration of the member. Assert.IsTrue(NS_Basic_TestClass_scope056.Basic_TestClass_scope056.testMethod()); } [TestMethod] public void Basic_scope057_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("Within the scope of a namespace, class,"); - OutputHelper.WriteLine("struct, interface, or enumeration member "); - OutputHelper.WriteLine("it is possible to refer to the member in "); - OutputHelper.WriteLine("a textual position that precedes the "); - OutputHelper.WriteLine("declaration of the member."); + // Section 3.5 + // Within the scope of a namespace, class, + // struct, interface, or enumeration member + // it is possible to refer to the member in + // a textual position that precedes the + // declaration of the member. Assert.IsTrue(Basic_TestClass_scope057.testMethod()); } [TestMethod] public void Basic_scope058_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("Within the scope of a namespace, class,"); - OutputHelper.WriteLine("struct, interface, or enumeration member "); - OutputHelper.WriteLine("it is possible to refer to the member in "); - OutputHelper.WriteLine("a textual position that precedes the "); - OutputHelper.WriteLine("declaration of the member."); + // Section 3.5 + // Within the scope of a namespace, class, + // struct, interface, or enumeration member + // it is possible to refer to the member in + // a textual position that precedes the + // declaration of the member. Assert.IsTrue(Basic_TestClass_scope058.testMethod()); } [TestMethod] public void Basic_scope059_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("Within the scope of a namespace, class,"); - OutputHelper.WriteLine("struct, interface, or enumeration member "); - OutputHelper.WriteLine("it is possible to refer to the member in "); - OutputHelper.WriteLine("a textual position that precedes the "); - OutputHelper.WriteLine("declaration of the member."); + // Section 3.5 + // Within the scope of a namespace, class, + // struct, interface, or enumeration member + // it is possible to refer to the member in + // a textual position that precedes the + // declaration of the member. Assert.IsTrue(Basic_TestClass_scope059.testMethod()); } [TestMethod] public void Basic_scope061_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("Witin the scope of a local variable, it is an"); - OutputHelper.WriteLine("error to refer to the local variable in a "); - OutputHelper.WriteLine("textual position that precedes the"); - OutputHelper.WriteLine("variable-declarator of the local variable."); + // Section 3.5 + // Witin the scope of a local variable, it is an + // error to refer to the local variable in a + // textual position that precedes the + // variable-declarator of the local variable. Assert.IsTrue(Basic_TestClass_scope061.testMethod()); } [TestMethod] public void Basic_scope062_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The meaning of a name within a block may differ"); - OutputHelper.WriteLine("based on the context in which the name is used."); + // Section 3.5 + // The meaning of a name within a block may differ + // based on the context in which the name is used. Assert.IsTrue(Basic_TestClass_scope062.testMethod()); } [TestMethod] public void Basic_scope063_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_scope063.testMethod()); } [TestMethod] public void Basic_scope064_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_scope064.testMethod()); } [TestMethod] public void Basic_scope067_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_scope067.testMethod()); } [TestMethod] public void Basic_scope068_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_scope068.testMethod()); } [TestMethod] public void Basic_scope069_Test() { - OutputHelper.WriteLine("Section 3"); + // Section 3 Assert.IsTrue(Basic_TestClass_scope069.testMethod()); } [TestMethod] public void Basic_scope070_Test() { - OutputHelper.WriteLine("Section 3"); + // Section 3 Assert.IsTrue(Basic_TestClass_scope070.testMethod()); } [TestMethod] public void Basic_scope071_Test() { - OutputHelper.WriteLine("Section 3"); + // Section 3 Assert.IsTrue(Basic_TestClass_scope071.testMethod()); } [TestMethod] public void Basic_scope074_Test() { - OutputHelper.WriteLine("Section 3.5"); - OutputHelper.WriteLine("The scope of a label declared in a label-statement"); - OutputHelper.WriteLine("is the block in which the declaration occurs."); + // Section 3.5 + // The scope of a label declared in a label-statement + // is the block in which the declaration occurs. Assert.IsTrue(Basic_TestClass_scope074.testMethod()); } [TestMethod] public void Basic_nhide001_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide001.Basic_TestClass_nhide001.testMethod()); } [TestMethod] public void Basic_nhide002_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide002.Basic_TestClass_nhide002.testMethod()); } [TestMethod] public void Basic_nhide003_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide003.Basic_TestClass_nhide003.testMethod()); } [TestMethod] public void Basic_nhide004_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide004.Basic_TestClass_nhide004.testMethod()); } [TestMethod] public void Basic_nhide005_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide005.Basic_TestClass_nhide005.testMethod()); } [TestMethod] public void Basic_nhide006_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide006.Basic_TestClass_nhide006.testMethod()); } [TestMethod] public void Basic_nhide007_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide007.testMethod()); } [TestMethod] public void Basic_nhide008_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide008.Basic_TestClass_nhide008.testMethod()); } [TestMethod] public void Basic_nhide009_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide009.Basic_TestClass_nhide009.testMethod()); } [TestMethod] public void Basic_nhide010_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide010.Basic_TestClass_nhide010.testMethod()); } [TestMethod] public void Basic_nhide011_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide011.Basic_TestClass_nhide011.testMethod()); } [TestMethod] public void Basic_nhide012_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide012.Basic_TestClass_nhide012.testMethod()); } [TestMethod] public void Basic_nhide013_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(NS_Basic_TestClass_nhide013.Basic_TestClass_nhide013.testMethod()); } [TestMethod] public void Basic_nhide014_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide014.testMethod()); } [TestMethod] public void Basic_nhide015_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide015.testMethod()); } [TestMethod] public void Basic_nhide016_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide016.testMethod()); } [TestMethod] public void Basic_nhide017_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide017.testMethod()); } [TestMethod] public void Basic_nhide018_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide018.testMethod()); } [TestMethod] public void Basic_nhide019_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide019.testMethod()); } [TestMethod] public void Basic_nhide020_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide020.testMethod()); } [TestMethod] public void Basic_nhide021_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide021.testMethod()); } [TestMethod] public void Basic_nhide022_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide022.testMethod()); } [TestMethod] public void Basic_nhide023_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide023.testMethod()); } [TestMethod] public void Basic_nhide024_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide024.testMethod()); } [TestMethod] public void Basic_nhide025_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide025.testMethod()); } [TestMethod] public void Basic_nhide026_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide026.testMethod()); } [TestMethod] public void Basic_nhide027_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide027.testMethod()); } [TestMethod] public void Basic_nhide028_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide028.testMethod()); } [TestMethod] public void Basic_nhide029_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide029.testMethod()); } [TestMethod] public void Basic_nhide030_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide030.testMethod()); } [TestMethod] public void Basic_nhide031_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide031.testMethod()); } [TestMethod] public void Basic_nhide032_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide032.testMethod()); } [TestMethod] public void Basic_nhide033_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide033.testMethod()); } [TestMethod] public void Basic_nhide034_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide034.testMethod()); } [TestMethod] public void Basic_nhide035_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide035.testMethod()); } [TestMethod] public void Basic_nhide036_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide036.testMethod()); } [TestMethod] public void Basic_nhide037_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide037.testMethod()); } [TestMethod] public void Basic_nhide038_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide038.testMethod()); } [TestMethod] public void Basic_nhide039_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide039.testMethod()); } [TestMethod] public void Basic_nhide040_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide040.testMethod()); } [TestMethod] public void Basic_nhide041_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide041.testMethod()); } [TestMethod] public void Basic_nhide042_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide042.testMethod()); } [TestMethod] public void Basic_nhide043_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide043.testMethod()); } [TestMethod] public void Basic_nhide044_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Name hiding through nesting can occur as a result of"); - OutputHelper.WriteLine("nesting namespaces or types within namespaces, as a "); - OutputHelper.WriteLine("result of nesting types within classes or structs,"); - OutputHelper.WriteLine("and as a result of parameter and local variable"); - OutputHelper.WriteLine("declarations. Name hiding through nesting of scopes"); - OutputHelper.WriteLine("always occurs silently, i.e. no errors or warnings"); - OutputHelper.WriteLine("are reported when outer names are hidden by inner names."); + // Section 3.5.1 + // Name hiding through nesting can occur as a result of + // nesting namespaces or types within namespaces, as a + // result of nesting types within classes or structs, + // and as a result of parameter and local variable + // declarations. Name hiding through nesting of scopes + // always occurs silently, i.e. no errors or warnings + // are reported when outer names are hidden by inner names. Assert.IsTrue(Basic_TestClass_nhide044.testMethod()); } [TestMethod] public void Basic_nhide045_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide045.testMethod()); } [TestMethod] public void Basic_nhide047_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide047.testMethod()); } [TestMethod] public void Basic_nhide049_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide049.testMethod()); } [TestMethod] public void Basic_nhide050_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide050.testMethod()); } [TestMethod] public void Basic_nhide051_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide051.testMethod()); } [TestMethod] public void Basic_nhide053_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide053.testMethod()); } [TestMethod] public void Basic_nhide055_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide055.testMethod()); } [TestMethod] public void Basic_nhide056_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide056.testMethod()); } [TestMethod] public void Basic_nhide057_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide057.testMethod()); } [TestMethod] public void Basic_nhide059_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("When a name in an inner scope hides a name"); - OutputHelper.WriteLine("in an outer scope, it hides all overloaded "); - OutputHelper.WriteLine("occurrences of that name."); + // Section 3.5.1 + // When a name in an inner scope hides a name + // in an outer scope, it hides all overloaded + // occurrences of that name. Assert.IsTrue(Basic_TestClass_nhide059.testMethod()); } [TestMethod] public void Basic_nhide061_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A constant, field, property, event or type introduced"); - OutputHelper.WriteLine("in a class or struct hides all base class members with the "); - OutputHelper.WriteLine("same name."); + // Section 3.5.1 + // A constant, field, property, event or type introduced + // in a class or struct hides all base class members with the + // same name. Assert.IsTrue(Basic_TestClass_nhide061.testMethod()); } [TestMethod] public void Basic_nhide062_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A constant, field, property, event or type introduced"); - OutputHelper.WriteLine("in a class or struct hides all base class members with the "); - OutputHelper.WriteLine("same name."); + // Section 3.5.1 + // A constant, field, property, event or type introduced + // in a class or struct hides all base class members with the + // same name. Assert.IsTrue(Basic_TestClass_nhide062.testMethod()); } [TestMethod] public void Basic_nhide063_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A constant, field, property, event or type introduced"); - OutputHelper.WriteLine("in a class or struct hides all base class members with the "); - OutputHelper.WriteLine("same name."); + // Section 3.5.1 + // A constant, field, property, event or type introduced + // in a class or struct hides all base class members with the + // same name. Assert.IsTrue(Basic_TestClass_nhide063.testMethod()); } [TestMethod] public void Basic_nhide064_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A constant, field, property, event or type introduced"); - OutputHelper.WriteLine("in a class or struct hides all base class members with the "); - OutputHelper.WriteLine("same name."); + // Section 3.5.1 + // A constant, field, property, event or type introduced + // in a class or struct hides all base class members with the + // same name. Assert.IsTrue(Basic_TestClass_nhide064.testMethod()); } [TestMethod] public void Basic_nhide067_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A constant, field, property, event or type introduced"); - OutputHelper.WriteLine("in a class or struct hides all base class members with the "); - OutputHelper.WriteLine("same name."); + // Section 3.5.1 + // A constant, field, property, event or type introduced + // in a class or struct hides all base class members with the + // same name. Assert.IsTrue(Basic_TestClass_nhide067.testMethod()); } [TestMethod] public void Basic_nhide068_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A constant, field, property, event or type introduced"); - OutputHelper.WriteLine("in a class or struct hides all base class members with the "); - OutputHelper.WriteLine("same name."); + // Section 3.5.1 + // A constant, field, property, event or type introduced + // in a class or struct hides all base class members with the + // same name. Assert.IsTrue(Basic_TestClass_nhide068.testMethod()); } [TestMethod] public void Basic_nhide071_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide071.testMethod()); } [TestMethod] public void Basic_nhide072_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide072.testMethod()); } [TestMethod] public void Basic_nhide075_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide075.testMethod()); } [TestMethod] public void Basic_nhide076_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide076.testMethod()); } [TestMethod] public void Basic_nhide077_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide077.testMethod()); } [TestMethod] public void Basic_nhide079_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide079.testMethod()); } [TestMethod] public void Basic_nhide081_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide081.testMethod()); } [TestMethod] public void Basic_nhide082_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide082.testMethod()); } [TestMethod] public void Basic_nhide085_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide085.testMethod()); } [TestMethod] public void Basic_nhide086_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide086.testMethod()); } [TestMethod] public void Basic_nhide087_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). Assert.IsTrue(Basic_TestClass_nhide087.testMethod()); } [TestMethod] public void Basic_nhide088_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A method introduced in a class or a struct"); - OutputHelper.WriteLine("hides all non-method base class members with"); - OutputHelper.WriteLine("the same name, and all base class methods"); - OutputHelper.WriteLine("with the same signature (method name and"); - OutputHelper.WriteLine("parameter count, modifiers, and types)."); - OutputHelper.WriteLine("This test passes in the baseline, but is an expected Fail"); - OutputHelper.WriteLine("See bug 16852 for more details"); + // Section 3.5.1 + // A method introduced in a class or a struct + // hides all non-method base class members with + // the same name, and all base class methods + // with the same signature (method name and + // parameter count, modifiers, and types). + // This test passes in the baseline, but is an expected Fail + // See bug 16852 for more details Assert.IsTrue(Basic_TestClass_nhide088.testMethod()); } [TestMethod] public void Basic_nhide089_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("An indexer introduced in a class or a struct"); - OutputHelper.WriteLine("hides all base class indexers with the same"); - OutputHelper.WriteLine("signature (parameter count and types)."); + // Section 3.5.1 + // An indexer introduced in a class or a struct + // hides all base class indexers with the same + // signature (parameter count and types). Assert.IsTrue(Basic_TestClass_nhide089.testMethod()); } [TestMethod] public void Basic_nhide090_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("An indexer introduced in a class or a struct"); - OutputHelper.WriteLine("hides all base class indexers with the same"); - OutputHelper.WriteLine("signature (parameter count and types)."); + // Section 3.5.1 + // An indexer introduced in a class or a struct + // hides all base class indexers with the same + // signature (parameter count and types). Assert.IsTrue(Basic_TestClass_nhide090.testMethod()); } [TestMethod] public void Basic_nhide091_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("Contrary to hiding a name from an outer scope,"); - OutputHelper.WriteLine("hding an accessible name from an inherited scope"); - OutputHelper.WriteLine("causes a warning to be reported."); + // Section 3.5.1 + // Contrary to hiding a name from an outer scope, + // hding an accessible name from an inherited scope + // causes a warning to be reported. Assert.IsTrue(Basic_TestClass_nhide091.testMethod()); } [TestMethod] public void Basic_nhide092_Test() { - OutputHelper.WriteLine("Section 3.5.1"); - OutputHelper.WriteLine("A declaration of a new member hides an inherited"); - OutputHelper.WriteLine("member only within the scope of the new member."); + // Section 3.5.1 + // A declaration of a new member hides an inherited + // member only within the scope of the new member. Assert.IsTrue(Basic_TestClass_nhide092.testMethod()); } [TestMethod] public void Basic_memac009_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Then, if M is public, the access is permitted."); + // Section 3.3 + // Then, if M is public, the access is permitted. Assert.IsTrue(Basic_TestClass_memac009.testMethod()); } [TestMethod] public void Basic_memac010_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Then, if M is public, the access is permitted."); + // Section 3.3 + // Then, if M is public, the access is permitted. Assert.IsTrue(Basic_TestClass_memac010.testMethod()); } [TestMethod] public void Basic_memac011_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected internal, the access"); - OutputHelper.WriteLine("is permitted if it occurs within the project in which"); - OutputHelper.WriteLine("M is declared, or if it occurs within a class derived "); - OutputHelper.WriteLine("from the class in which M is declared and takes place "); - OutputHelper.WriteLine("through the derived class type."); + // Section 3.3 + // Otherwise, if M is protected internal, the access + // is permitted if it occurs within the project in which + // M is declared, or if it occurs within a class derived + // from the class in which M is declared and takes place + // through the derived class type. Assert.IsTrue(Basic_TestClass_memac011.testMethod()); } [TestMethod] public void Basic_memac012_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected internal, the access"); - OutputHelper.WriteLine("is permitted if it occurs within the project in which"); - OutputHelper.WriteLine("M is declared, or if it occurs within a class derived "); - OutputHelper.WriteLine("from the class in which M is declared and takes place "); - OutputHelper.WriteLine("through the derived class type."); + // Section 3.3 + // Otherwise, if M is protected internal, the access + // is permitted if it occurs within the project in which + // M is declared, or if it occurs within a class derived + // from the class in which M is declared and takes place + // through the derived class type. Assert.IsTrue(Basic_TestClass_memac012.testMethod()); } /* @@ -1259,12 +1259,12 @@ public void Basic_memac012_Test() [TestMethod] public void Basic_memac013_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected internal, the access"); - OutputHelper.WriteLine("is permitted if it occurs within the project in which"); - OutputHelper.WriteLine("M is declared, or if it occurs within a class derived "); - OutputHelper.WriteLine("from the class in which M is declared and takes place "); - OutputHelper.WriteLine("through the derived class type."); + // Section 3.3 + // Otherwise, if M is protected internal, the access + // is permitted if it occurs within the project in which + // M is declared, or if it occurs within a class derived + // from the class in which M is declared and takes place + // through the derived class type. Assert.IsTrue(Basic_TestClass_memac013.testMethod()) { return MFTestResults.Pass; @@ -1274,12 +1274,12 @@ public void Basic_memac013_Test() [TestMethod] public void Basic_memac014_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected internal, the access"); - OutputHelper.WriteLine("is permitted if it occurs within the project in which"); - OutputHelper.WriteLine("M is declared, or if it occurs within a class derived "); - OutputHelper.WriteLine("from the class in which M is declared and takes place "); - OutputHelper.WriteLine("through the derived class type."); + // Section 3.3 + // Otherwise, if M is protected internal, the access + // is permitted if it occurs within the project in which + // M is declared, or if it occurs within a class derived + // from the class in which M is declared and takes place + // through the derived class type. Assert.IsTrue(Basic_TestClass_memac014.testMethod()) { return MFTestResults.Pass; @@ -1290,96 +1290,96 @@ public void Basic_memac014_Test() [TestMethod] public void Basic_memac019_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the class in which M is declared, or"); - OutputHelper.WriteLine("if it occurs within a class derived from the class in"); - OutputHelper.WriteLine("which M is delared and takes place through the derived class "); - OutputHelper.WriteLine("type."); + // Section 3.3 + // Otherwise, if M is protected, the access is permitted + // if it occurs within the class in which M is declared, or + // if it occurs within a class derived from the class in + // which M is delared and takes place through the derived class + // type. Assert.IsTrue(Basic_TestClass_memac019.testMethod()); } [TestMethod] public void Basic_memac020_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the class in which M is declared, or"); - OutputHelper.WriteLine("if it occurs within a class derived from the class in"); - OutputHelper.WriteLine("which M is delared and takes place through the derived class "); - OutputHelper.WriteLine("type."); + // Section 3.3 + // Otherwise, if M is protected, the access is permitted + // if it occurs within the class in which M is declared, or + // if it occurs within a class derived from the class in + // which M is delared and takes place through the derived class + // type. Assert.IsTrue(Basic_TestClass_memac020.testMethod()); } [TestMethod] public void Basic_memac021_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the class in which M is declared, or"); - OutputHelper.WriteLine("if it occurs within a class derived from the class in"); - OutputHelper.WriteLine("which M is delared and takes place through the derived class "); - OutputHelper.WriteLine("type."); + // Section 3.3 + // Otherwise, if M is protected, the access is permitted + // if it occurs within the class in which M is declared, or + // if it occurs within a class derived from the class in + // which M is delared and takes place through the derived class + // type. Assert.IsTrue(Basic_TestClass_memac021.testMethod()); } [TestMethod] public void Basic_memac022_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the class in which M is declared, or"); - OutputHelper.WriteLine("if it occurs within a class derived from the class in"); - OutputHelper.WriteLine("which M is delared and takes place through the derived class "); - OutputHelper.WriteLine("type."); + // Section 3.3 + // Otherwise, if M is protected, the access is permitted + // if it occurs within the class in which M is declared, or + // if it occurs within a class derived from the class in + // which M is delared and takes place through the derived class + // type. Assert.IsTrue(Basic_TestClass_memac022.testMethod()); } [TestMethod] public void Basic_memac025_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is protected, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the class in which M is declared, or"); - OutputHelper.WriteLine("if it occurs within a class derived from the class in"); - OutputHelper.WriteLine("which M is delared and takes place through the derived class "); - OutputHelper.WriteLine("type."); + // Section 3.3 + // Otherwise, if M is protected, the access is permitted + // if it occurs within the class in which M is declared, or + // if it occurs within a class derived from the class in + // which M is delared and takes place through the derived class + // type. Assert.IsTrue(Basic_TestClass_memac025.testMethod()); } [TestMethod] public void Basic_memac027_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is internal, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the project in which M is declared."); + // Section 3.3 + // Otherwise, if M is internal, the access is permitted + // if it occurs within the project in which M is declared. Assert.IsTrue(Basic_TestClass_memac027.testMethod()); } [TestMethod] public void Basic_memac029_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is internal, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the project in which M is declared."); + // Section 3.3 + // Otherwise, if M is internal, the access is permitted + // if it occurs within the project in which M is declared. Assert.IsTrue(Basic_TestClass_memac029.testMethod()); } [TestMethod] public void Basic_memac030_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is internal, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the project in which M is declared."); + // Section 3.3 + // Otherwise, if M is internal, the access is permitted + // if it occurs within the project in which M is declared. Assert.IsTrue(Basic_TestClass_memac030.testMethod()); } [TestMethod] public void Basic_memac033_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is private, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the type in which M is declared."); + // Section 3.3 + // Otherwise, if M is private, the access is permitted + // if it occurs within the type in which M is declared. Assert.IsTrue(Basic_TestClass_memac033.testMethod()); } [TestMethod] public void Basic_memac034_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("Otherwise, if M is private, the access is permitted"); - OutputHelper.WriteLine("if it occurs within the type in which M is declared."); + // Section 3.3 + // Otherwise, if M is private, the access is permitted + // if it occurs within the type in which M is declared. Assert.IsTrue(Basic_TestClass_memac034.testMethod()); } @@ -1389,7 +1389,7 @@ public void Basic_memac034_Test() [TestMethod] public void Basic_memac039_Test() { - OutputHelper.WriteLine("VS Bug 75548"); + // VS Bug 75548 Assert.IsTrue(Basic_TestClass_memac039.testMethod()) { return MFTestResults.Pass; @@ -1409,264 +1409,264 @@ public void Basic_memac041_Test() [TestMethod] public void Basic_memac042_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_memac042.testMethod()); } [TestMethod] public void Basic_memac043_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_memac043.testMethod()); } [TestMethod] public void Basic_memac044_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_memac044.testMethod()); } [TestMethod] public void Basic_memac045_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_memac045.testMethod()); } [TestMethod] public void Basic_memac046_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_memac046.testMethod()); } [TestMethod] public void Basic_memac047_Test() { - OutputHelper.WriteLine("Section 3.5"); + // Section 3.5 Assert.IsTrue(Basic_TestClass_memac047.testMethod()); } [TestMethod] public void Basic_accon001_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon001.testMethod()); } [TestMethod] public void Basic_accon003_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon003.testMethod()); } [TestMethod] public void Basic_accon005_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon005.testMethod()); } [TestMethod] public void Basic_accon007_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon007.testMethod()); } [TestMethod] public void Basic_accon009_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon009.testMethod()); } [TestMethod] public void Basic_accon011_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon011.testMethod()); } [TestMethod] public void Basic_accon013_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon013.testMethod()); } [TestMethod] public void Basic_accon015_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon015.testMethod()); } [TestMethod] public void Basic_accon019_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon019.testMethod()); } [TestMethod] public void Basic_accon021_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The direct base class of a class type must be"); - OutputHelper.WriteLine("at least as accessible as the class type itself."); + // Section 3.3 + // The direct base class of a class type must be + // at least as accessible as the class type itself. Assert.IsTrue(Basic_TestClass_accon021.testMethod()); } [TestMethod] public void Basic_accon023_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The explicit base interfaces of an interface "); - OutputHelper.WriteLine("type must be at least as accessible as the interface"); - OutputHelper.WriteLine("type itself."); + // Section 3.3 + // The explicit base interfaces of an interface + // type must be at least as accessible as the interface + // type itself. Assert.IsTrue(Basic_TestClass_accon023.testMethod()); } [TestMethod] public void Basic_accon025_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The explicit base interfaces of an interface "); - OutputHelper.WriteLine("type must be at least as accessible as the interface"); - OutputHelper.WriteLine("type itself."); + // Section 3.3 + // The explicit base interfaces of an interface + // type must be at least as accessible as the interface + // type itself. Assert.IsTrue(Basic_TestClass_accon025.testMethod()); } [TestMethod] public void Basic_accon027_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The explicit base interfaces of an interface "); - OutputHelper.WriteLine("type must be at least as accessible as the interface"); - OutputHelper.WriteLine("type itself."); + // Section 3.3 + // The explicit base interfaces of an interface + // type must be at least as accessible as the interface + // type itself. Assert.IsTrue(Basic_TestClass_accon027.testMethod()); } [TestMethod] public void Basic_accon029_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The explicit base interfaces of an interface "); - OutputHelper.WriteLine("type must be at least as accessible as the interface"); - OutputHelper.WriteLine("type itself."); + // Section 3.3 + // The explicit base interfaces of an interface + // type must be at least as accessible as the interface + // type itself. Assert.IsTrue(Basic_TestClass_accon029.testMethod()); } [TestMethod] public void Basic_accon031_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The explicit base interfaces of an interface "); - OutputHelper.WriteLine("type must be at least as accessible as the interface"); - OutputHelper.WriteLine("type itself."); + // Section 3.3 + // The explicit base interfaces of an interface + // type must be at least as accessible as the interface + // type itself. Assert.IsTrue(Basic_TestClass_accon031.testMethod()); } [TestMethod] public void Basic_accon033_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of a delegate"); - OutputHelper.WriteLine("type must be at least as accessible as the delegate"); - OutputHelper.WriteLine("ytpe itself."); + // Section 3.3 + // The return type and parameter types of a delegate + // type must be at least as accessible as the delegate + // ytpe itself. Assert.IsTrue(Basic_TestClass_accon033.testMethod()); } [TestMethod] public void Basic_accon035_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of a delegate"); - OutputHelper.WriteLine("type must be at least as accessible as the delegate"); - OutputHelper.WriteLine("ytpe itself."); + // Section 3.3 + // The return type and parameter types of a delegate + // type must be at least as accessible as the delegate + // ytpe itself. Assert.IsTrue(Basic_TestClass_accon035.testMethod()); } [TestMethod] public void Basic_accon037_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The type of a constant must be at least as"); - OutputHelper.WriteLine("accessible as the constant itself."); + // Section 3.3 + // The type of a constant must be at least as + // accessible as the constant itself. Assert.IsTrue(Basic_TestClass_accon037.testMethod()); } [TestMethod] public void Basic_accon039_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The type of a field must be at least as accessible"); - OutputHelper.WriteLine("as the field itself."); + // Section 3.3 + // The type of a field must be at least as accessible + // as the field itself. Assert.IsTrue(Basic_TestClass_accon039.testMethod()); } [TestMethod] public void Basic_accon041_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of a method"); - OutputHelper.WriteLine("must be at least asaccessible as the method itself."); + // Section 3.3 + // The return type and parameter types of a method + // must be at least asaccessible as the method itself. Assert.IsTrue(Basic_TestClass_accon041.testMethod()); } [TestMethod] public void Basic_accon043_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of a method"); - OutputHelper.WriteLine("must be at least asaccessible as the method itself."); + // Section 3.3 + // The return type and parameter types of a method + // must be at least asaccessible as the method itself. Assert.IsTrue(Basic_TestClass_accon043.testMethod()); } [TestMethod] public void Basic_accon045_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The type of a property must be at least as"); - OutputHelper.WriteLine("accessible as the property itself."); + // Section 3.3 + // The type of a property must be at least as + // accessible as the property itself. Assert.IsTrue(Basic_TestClass_accon045.testMethod()); } [TestMethod] public void Basic_accon047_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of an"); - OutputHelper.WriteLine("indexer must be at least as accessible as the"); - OutputHelper.WriteLine("indexer itself."); + // Section 3.3 + // The return type and parameter types of an + // indexer must be at least as accessible as the + // indexer itself. Assert.IsTrue(Basic_TestClass_accon047.testMethod()); } [TestMethod] public void Basic_accon049_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of an"); - OutputHelper.WriteLine("indexer must be at least as accessible as the"); - OutputHelper.WriteLine("indexer itself."); + // Section 3.3 + // The return type and parameter types of an + // indexer must be at least as accessible as the + // indexer itself. Assert.IsTrue(Basic_TestClass_accon049.testMethod()); } [TestMethod] public void Basic_accon051_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of an"); - OutputHelper.WriteLine("operator must be at least as accessible as"); - OutputHelper.WriteLine("the operator itself."); + // Section 3.3 + // The return type and parameter types of an + // operator must be at least as accessible as + // the operator itself. Assert.IsTrue(Basic_TestClass_accon051.testMethod()); } [TestMethod] public void Basic_accon053_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The return type and parameter types of an"); - OutputHelper.WriteLine("operator must be at least as accessible as"); - OutputHelper.WriteLine("the operator itself."); + // Section 3.3 + // The return type and parameter types of an + // operator must be at least as accessible as + // the operator itself. Assert.IsTrue(Basic_TestClass_accon053.testMethod()); } [TestMethod] public void Basic_accon055_Test() { - OutputHelper.WriteLine("Section 3.3"); - OutputHelper.WriteLine("The parameter types of a constructor must be at least"); - OutputHelper.WriteLine("as accessible as the constructor itself."); + // Section 3.3 + // The parameter types of a constructor must be at least + // as accessible as the constructor itself. Assert.IsTrue(Basic_TestClass_accon055.testMethod()); } @@ -2512,7 +2512,7 @@ public static int Main_old() { if (Basic_TestClass_nhide015_C1.Basic_TestClass_nhide015_I.intI == 2) { - OutputHelper.WriteLine("foo"); + // foo return 0; } else @@ -2722,7 +2722,7 @@ public static int Main_old() { if (Basic_TestClass_nhide022_C1.Basic_TestClass_nhide022_I.intI == 2) { - OutputHelper.WriteLine("foo"); + // foo return 0; } else @@ -2808,7 +2808,7 @@ public static int Main_old() { if (Basic_TestClass_nhide024_St1.Basic_TestClass_nhide024_I.intI == 2) { - OutputHelper.WriteLine("foo"); + // foo return 0; } else @@ -4733,7 +4733,7 @@ public static bool testMethod() public class Basic_TestClass_memac041_B : Basic_TestClass_memac041_A { protected override void f() - { OutputHelper.WriteLine("Basic_TestClass_memac041_B.f()"); } + { // Basic_TestClass_memac041_B.f() } static void Main_old() { Basic_TestClass_memac041_B b = new Basic_TestClass_memac041_B(); @@ -5861,7 +5861,7 @@ public static int Main_old() { if (Basic_TestClass_nhide008_C1.Basic_TestClass_nhide008_I.intI == 2) { - OutputHelper.WriteLine("foo"); + // foo return 0; } else @@ -5932,7 +5932,7 @@ public static int Main_old() { if (Basic_TestClass_nhide010_St1.Basic_TestClass_nhide010_I.intI == 2) { - OutputHelper.WriteLine("foo"); + // foo return 0; } else diff --git a/Tests/NFUnitTestBitConverter/BitConverter.cs b/Tests/NFUnitTestBitConverter/BitConverter.cs index d345b348..06d90a22 100644 --- a/Tests/NFUnitTestBitConverter/BitConverter.cs +++ b/Tests/NFUnitTestBitConverter/BitConverter.cs @@ -15,13 +15,13 @@ public class Test1 [Setup] public void Initialize() { - OutputHelper.WriteLine("BitConverter tests initialized."); + // BitConverter tests initialized. } [Cleanup] public void CleanUp() { - OutputHelper.WriteLine("Cleaning up after BitConverter tests."); + // Cleaning up after BitConverter tests. } //Test Case Calls diff --git a/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs b/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs index 15f1c3d9..155983bb 100644 --- a/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs +++ b/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs @@ -17,7 +17,7 @@ public class UnitTestConstructorTest [TestMethod] public void Constructors1_Test() { - OutputHelper.WriteLine("Tests if assignments in a constructor function."); + // Tests if assignments in a constructor function. Assert.IsTrue(ConstructorsTestClass1.testMethod()); } @@ -25,7 +25,7 @@ public void Constructors1_Test() public void Constructors2_Test() { //Ported from Const2.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor is public."); + // Tests if assignments in a constructor function, when constructor is public. Assert.IsTrue(ConstructorsTestClass2.testMethod()); } @@ -33,7 +33,7 @@ public void Constructors2_Test() public void Constructors3_Test() { //Ported from Const3.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor is protected."); + // Tests if assignments in a constructor function, when constructor is protected. Assert.IsTrue(ConstructorsTestClass3.testMethod()); } @@ -41,7 +41,7 @@ public void Constructors3_Test() public void Constructors5_Test() { //Ported from Const5.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor is internal."); + // Tests if assignments in a constructor function, when constructor is internal. Assert.IsTrue(ConstructorsTestClass5.testMethod()); } @@ -49,7 +49,7 @@ public void Constructors5_Test() public void Constructors6_Test() { //Ported from Const6.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor is private."); + // Tests if assignments in a constructor function, when constructor is private. Assert.IsTrue(ConstructorsTestClass6.testMethod()); } @@ -57,7 +57,7 @@ public void Constructors6_Test() public void Constructors8_Test() { //Ported from Const8.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor has one parameter."); + // Tests if assignments in a constructor function, when constructor has one parameter. Assert.IsTrue(ConstructorsTestClass8.testMethod()); } @@ -66,8 +66,8 @@ public void Constructors10_Test() { //Ported from Const10.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor is called with one parameter"); - OutputHelper.WriteLine("and is overloaded with an un-called zero parameter version"); + // Tests if assignments in a constructor function, when constructor is called with one parameter + // and is overloaded with an un-called zero parameter version Assert.IsTrue(ConstructorsTestClass10.testMethod()); } @@ -75,7 +75,7 @@ public void Constructors10_Test() public void Constructors11_Test() { //Ported from Const11.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor has two parameters."); + // Tests if assignments in a constructor function, when constructor has two parameters. Assert.IsTrue(ConstructorsTestClass11.testMethod()); } @@ -83,7 +83,7 @@ public void Constructors11_Test() public void Constructors13_Test() { //Ported from Const13.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when constructor has ten parameters."); + // Tests if assignments in a constructor function, when constructor has ten parameters. Assert.IsTrue(ConstructorsTestClass13.testMethod()); } @@ -91,9 +91,9 @@ public void Constructors13_Test() public void Constructors16_Test() { //Ported from Const16.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when test class inherits constructor"); + // Tests if assignments in a constructor function, when test class inherits constructor - OutputHelper.WriteLine("and extends it with base"); + // and extends it with base Assert.IsTrue(ConstructorsTestClass16.testMethod()); } @@ -101,8 +101,8 @@ public void Constructors16_Test() public void Constructors17_Test() { //Ported from Const17.cs - OutputHelper.WriteLine("Tests if assignments in a constructor function, when test class inherits 2 constructors"); - OutputHelper.WriteLine("and extends one of them with base"); + // Tests if assignments in a constructor function, when test class inherits 2 constructors + // and extends one of them with base Assert.IsTrue(ConstructorsTestClass17.testMethod()); } @@ -110,7 +110,7 @@ public void Constructors17_Test() public void Constructors20_Test() { //Ported from Const20.cs - OutputHelper.WriteLine("Tests if assignments in a constructor and its base are both functional"); + // Tests if assignments in a constructor and its base are both functional Assert.IsTrue(ConstructorsTestClass20.testMethod()); } @@ -118,7 +118,7 @@ public void Constructors20_Test() public void Constructors21_Test() { //Ported from Const21.cs - OutputHelper.WriteLine("Tests if assignments in a constructor and its base, and its base's base are all functional"); + // Tests if assignments in a constructor and its base, and its base's base are all functional Assert.IsTrue(ConstructorsTestClass21.testMethod()); } @@ -126,8 +126,8 @@ public void Constructors21_Test() public void Constructors22_Test() { //Ported from Const22.cs - OutputHelper.WriteLine("Tests if assignments in both a class' constructors are functional when a parametered constructor extends"); - OutputHelper.WriteLine("a not-parametered one with 'this'"); + // Tests if assignments in both a class' constructors are functional when a parametered constructor extends + // a not-parametered one with 'this' Assert.IsTrue(ConstructorsTestClass22.testMethod()); } @@ -135,8 +135,8 @@ public void Constructors22_Test() public void Constructors23_Test() { //Ported from Const23.cs - OutputHelper.WriteLine("Tests if assignments in both a class' constructors are functional when a not-parametered constructor extends"); - OutputHelper.WriteLine("a parametered one with 'this'"); + // Tests if assignments in both a class' constructors are functional when a not-parametered constructor extends + // a parametered one with 'this' Assert.IsTrue(ConstructorsTestClass23.testMethod()); } @@ -144,7 +144,7 @@ public void Constructors23_Test() public void Constructors24_Test() { //Ported from Const24.cs - OutputHelper.WriteLine("Tests if assignments in all a class' constructors are functional in a chain of extension using 'this'"); + // Tests if assignments in all a class' constructors are functional in a chain of extension using 'this' Assert.IsTrue(ConstructorsTestClass24.testMethod()); } @@ -153,8 +153,8 @@ public void Constructors25_Test() { //Ported from Const25.cs - OutputHelper.WriteLine("Tests if assignments in all a class' constructors are functional when a parametered one extends a"); - OutputHelper.WriteLine("not-parametered one, which in turn extends the class' base class constructor"); + // Tests if assignments in all a class' constructors are functional when a parametered one extends a + // not-parametered one, which in turn extends the class' base class constructor Assert.IsTrue(ConstructorsTestClass25.testMethod()); } @@ -162,8 +162,8 @@ public void Constructors25_Test() public void Constructors26_Test() { //Ported from Const26.cs - OutputHelper.WriteLine("Tests if assignments in all a class' constructors are functional when a not-parametered one extends a"); - OutputHelper.WriteLine("not-parametered one in its base class, which in turn extends a parametered one in the base class"); + // Tests if assignments in all a class' constructors are functional when a not-parametered one extends a + // not-parametered one in its base class, which in turn extends a parametered one in the base class Assert.IsTrue(ConstructorsTestClass26.testMethod()); } @@ -171,8 +171,8 @@ public void Constructors26_Test() public void Constructors27_Test() { //Ported from Const27.cs - OutputHelper.WriteLine("Tests if assignments in both a class' constructors are functional when a two-parametered constructor extends"); - OutputHelper.WriteLine("a one-parametered one with 'this'"); + // Tests if assignments in both a class' constructors are functional when a two-parametered constructor extends + // a one-parametered one with 'this' Assert.IsTrue(ConstructorsTestClass27.testMethod()); } @@ -180,8 +180,8 @@ public void Constructors27_Test() public void Constructors28_Test() { //Ported from Const28.cs - OutputHelper.WriteLine("Tests if assignments in both a class' constructors are functional when a two-parametered constructor extends"); - OutputHelper.WriteLine("a one-parametered one with 'this' and calls that constructor with a static arg"); + // Tests if assignments in both a class' constructors are functional when a two-parametered constructor extends + // a one-parametered one with 'this' and calls that constructor with a static arg Assert.IsTrue(ConstructorsTestClass28.testMethod()); } @@ -189,8 +189,8 @@ public void Constructors28_Test() public void Constructors31_Test() { //Ported from Const31.cs - OutputHelper.WriteLine("Tests if assignments in both a class' constructors are functional when a not-parametered constructor extends"); - OutputHelper.WriteLine("a two-parametered one with 'this'"); + // Tests if assignments in both a class' constructors are functional when a not-parametered constructor extends + // a two-parametered one with 'this' Assert.IsTrue(ConstructorsTestClass31.testMethod()); } @@ -199,8 +199,8 @@ public void Constructors32_Test() { //Ported from Const32.cs - OutputHelper.WriteLine("Tests if assignments in both a class' constructors are functional when a parametered constructor extends"); - OutputHelper.WriteLine("a not-parametered one that is private with 'this'"); + // Tests if assignments in both a class' constructors are functional when a parametered constructor extends + // a not-parametered one that is private with 'this' Assert.IsTrue(ConstructorsTestClass32.testMethod()); } @@ -209,7 +209,7 @@ public void Constructors33_Test() { //Ported from Const33.cs - OutputHelper.WriteLine("Tests if assignments in a class' constructor are functional when the constructor is static"); + // Tests if assignments in a class' constructor are functional when the constructor is static Assert.IsTrue(ConstructorsTestClass33.testMethod()); } @@ -217,8 +217,8 @@ public void Constructors33_Test() public void Constructors34_Test() { //Ported from Const34.cs - OutputHelper.WriteLine("Tests if assignments in a class' constructor are functional when one constructor is static"); - OutputHelper.WriteLine("and the other isn't"); + // Tests if assignments in a class' constructor are functional when one constructor is static + // and the other isn't Assert.IsTrue(ConstructorsTestClass34.testMethod()); } @@ -226,7 +226,7 @@ public void Constructors34_Test() public void Constructors35_Test() { //From Bug# 16354/16719 - OutputHelper.WriteLine("Tests if handled exceptions in constructors continues execution"); + // Tests if handled exceptions in constructors continues execution Assert.IsTrue(ConstructorsTestClass35.testMethod()); } @@ -234,11 +234,11 @@ public void Constructors35_Test() public void Constructors44_Test() { //Ported from Const44.cs - OutputHelper.WriteLine("Section 10.9.5"); - OutputHelper.WriteLine("When a class declares only private constructors it "); - OutputHelper.WriteLine("is not possible for other classes to derive from"); - OutputHelper.WriteLine("the class or create instances of the class (an System.Exception"); - OutputHelper.WriteLine("being classes nested within the class)."); + // Section 10.9.5 + // When a class declares only private constructors it + // is not possible for other classes to derive from + // the class or create instances of the class (an System.Exception + // being classes nested within the class). Assert.IsTrue(ConstructorsTestClass44.testMethod()); } @@ -246,10 +246,10 @@ public void Constructors44_Test() public void Constructors45_Test() { //Ported from Const45.cs - OutputHelper.WriteLine("Section 10.11."); - OutputHelper.WriteLine("It is possible to construct circular dependencies that"); - OutputHelper.WriteLine("allow static fields with variable initializers to be"); - OutputHelper.WriteLine("observed in their default value state."); + // Section 10.11. + // It is possible to construct circular dependencies that + // allow static fields with variable initializers to be + // observed in their default value state. Assert.IsTrue(ConstructorsTestClass45.testMethod()); } @@ -259,10 +259,10 @@ public void Constructors45_Test() //public void Constructors46_Test() //{ // //Ported from Const46.cs - // OutputHelper.WriteLine("Section 10.11."); - // OutputHelper.WriteLine("It is possible to construct circular dependencies that"); - // OutputHelper.WriteLine("allow static fields with variable initializers to be"); - // OutputHelper.WriteLine("observed in their default value state."); + // // Section 10.11. + // // It is possible to construct circular dependencies that + // // allow static fields with variable initializers to be + // // observed in their default value state. // Assert.IsTrue(ConstructorsTestClass46.testMethod()) // { // return MFTestResults.Pass; @@ -274,11 +274,11 @@ public void Constructors45_Test() //public void Constructors47_Test() //{ // //Ported from Const47.cs - // OutputHelper.WriteLine("Section 10.11."); - // OutputHelper.WriteLine("It is possible to construct circular dependencies that"); - // OutputHelper.WriteLine("allow static fields with variable initializers to be"); - // OutputHelper.WriteLine("observed in their default value state."); - // OutputHelper.WriteLine("This test is expected to fail."); + // // Section 10.11. + // // It is possible to construct circular dependencies that + // // allow static fields with variable initializers to be + // // observed in their default value state. + // // This test is expected to fail. // Assert.IsTrue(ConstructorsTestClass47.testMethod()) // { // return MFTestResults.Fail; @@ -290,11 +290,11 @@ public void Constructors45_Test() public void Constructors50_Test() { //Ported from Const50.cs - OutputHelper.WriteLine("The scope of the parameters given by the formal"); - OutputHelper.WriteLine("parameter list of a constructor includes the"); - OutputHelper.WriteLine("constructor initializer of that declaration."); - OutputHelper.WriteLine("Thus, a constructor initializer is permitted to"); - OutputHelper.WriteLine("access the parameters of the constructor."); + // The scope of the parameters given by the formal + // parameter list of a constructor includes the + // constructor initializer of that declaration. + // Thus, a constructor initializer is permitted to + // access the parameters of the constructor. Assert.IsTrue(ConstructorsTestClass50.testMethod()); } @@ -302,19 +302,19 @@ public void Constructors50_Test() public void Constructors51_Test() { //Ported from Const51.cs - OutputHelper.WriteLine("Section 10.9"); - OutputHelper.WriteLine("The scope of the parameters given by the formal"); - OutputHelper.WriteLine("parameter list of a constructor includes the"); - OutputHelper.WriteLine("constructor initializer of that declaration."); - OutputHelper.WriteLine("Thus, a constructor initializer is permitted to"); - OutputHelper.WriteLine("access the parameters of the constructor."); + // Section 10.9 + // The scope of the parameters given by the formal + // parameter list of a constructor includes the + // constructor initializer of that declaration. + // Thus, a constructor initializer is permitted to + // access the parameters of the constructor. Assert.IsTrue(ConstructorsTestClass51.testMethod()); } [TestMethod] public void Constructors52_Test() { - OutputHelper.WriteLine("Testing a constructor with a '(params int[] values)' prototype, called with 3 ints"); + // Testing a constructor with a '(params int[] values)' prototype, called with 3 ints //Ported from Const52.cs Assert.IsTrue(ConstructorsTestClass52.testMethod()); } @@ -323,7 +323,7 @@ public void Constructors52_Test() public void Constructors54_Test() { //Ported from Const54.cs - OutputHelper.WriteLine("Testing a constructor with a '(params int[] values)' prototype, called with 3 ints from its derived class"); + // Testing a constructor with a '(params int[] values)' prototype, called with 3 ints from its derived class Assert.IsTrue(ConstructorsTestClass54.testMethod()); } @@ -332,16 +332,16 @@ public void Constructors55_Test() { //Ported from Const55.cs - OutputHelper.WriteLine("Testing a constructor with a '(params int[] values)' prototype, called with 3 ints"); - OutputHelper.WriteLine(" from its derived class, and both constructors are 'protected internal'"); + // Testing a constructor with a '(params int[] values)' prototype, called with 3 ints + // from its derived class, and both constructors are 'protected internal' Assert.IsTrue(ConstructorsTestClass55.testMethod()); } [TestMethod] public void Constructors56_Test() { - OutputHelper.WriteLine("Testing a constructor with a '(params int[] values)' prototype, called with 3 ints"); - OutputHelper.WriteLine(" from its derived class implicitly, and both constructors are 'internal'"); + // Testing a constructor with a '(params int[] values)' prototype, called with 3 ints + // from its derived class implicitly, and both constructors are 'internal' //Ported from Const56.cs Assert.IsTrue(ConstructorsTestClass56.testMethod()); } @@ -350,7 +350,7 @@ public void Constructors56_Test() public void Constructors57_Test() { //Ported from Const57.cs - OutputHelper.WriteLine("Testing a 'private' constructor with a '(params int[] values)' prototype, called with 3 ints"); + // Testing a 'private' constructor with a '(params int[] values)' prototype, called with 3 ints Assert.IsTrue(ConstructorsTestClass57.testMethod()); } @@ -358,7 +358,7 @@ public void Constructors57_Test() public void Constructors64_Test() { //Ported from Const64.cs - OutputHelper.WriteLine("Instance constructors, destructors, and static constructors are not inherited"); + // Instance constructors, destructors, and static constructors are not inherited Assert.IsTrue(ConstructorsTestClass64.testMethod()); } @@ -483,7 +483,7 @@ public void ConstructorParametersInfo_01() // get ParameterInfo for 1st constructor ParameterInfo[] constructorParameters = constructors[0].GetParameters(); - OutputHelper.WriteLine("Checking parameters for 1st constructor of ClassWith3Constructors"); + // Checking parameters for 1st constructor of ClassWith3Constructors Assert.AreEqual(0, constructorParameters.Length, $"Expecting no parameters, got {constructorParameters.Length}."); // get ParameterInfo for 2nd constructor @@ -491,7 +491,7 @@ public void ConstructorParametersInfo_01() Assert.AreEqual(1, constructorParameters.Length, $"Expecting 1 parameter, got {constructorParameters.Length}."); - OutputHelper.WriteLine("Checking parameters for 2nd constructor of ClassWith3Constructors"); + // Checking parameters for 2nd constructor of ClassWith3Constructors Assert.AreEqual(constructorParameters[0].ParameterType.ToString(), $"{typeof(int)}", $"Expecting parameter of type {typeof(int)}, got {constructorParameters[0].ParameterType}."); // get ParameterInfo for 3rd constructor @@ -499,7 +499,7 @@ public void ConstructorParametersInfo_01() Assert.AreEqual(2, constructorParameters.Length, $"Expecting 2 parameters, got {constructorParameters.Length}."); - OutputHelper.WriteLine("Checking parameters for 3rd constructor of ClassWith3Constructors"); + // Checking parameters for 3rd constructor of ClassWith3Constructors Assert.AreEqual(constructorParameters[0].ParameterType.ToString(), $"{typeof(int)}", $"Expecting parameter of type {typeof(int)}, got {constructorParameters[0].ParameterType}."); Assert.AreEqual(constructorParameters[1].ParameterType.ToString(), $"{typeof(string)}", $"Expecting parameter of type {typeof(string)}, got {constructorParameters[0].ParameterType}."); } diff --git a/Tests/NFUnitTestClasses/UnitTestConstsTests.cs b/Tests/NFUnitTestClasses/UnitTestConstsTests.cs index 3e06bdb9..161c3d7f 100644 --- a/Tests/NFUnitTestClasses/UnitTestConstsTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestConstsTests.cs @@ -18,11 +18,11 @@ class UnitTestConstsTests public void Const1_Test() { //Ported from const1.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass1.test()); } @@ -30,11 +30,11 @@ public void Const1_Test() public void Const2_Test() { //Ported from const2.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass2.test()); } @@ -42,11 +42,11 @@ public void Const2_Test() public void Const3_Test() { //Ported from const3.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass3.test()); } @@ -55,11 +55,11 @@ public void Const3_Test() public void Const4_Test() { //Ported from const4.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass4.test()); } @@ -67,11 +67,11 @@ public void Const4_Test() public void Const5_Test() { //Ported from const5.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass5.test()); } @@ -79,11 +79,11 @@ public void Const5_Test() public void Const6_Test() { //Ported from const6.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass6.test()); } @@ -92,11 +92,11 @@ public void Const6_Test() public void Const9_Test() { //Ported from const9.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant-declaration may include a set of attributes,"); - OutputHelper.WriteLine("a new modifier, and one of four access modifiers. The"); - OutputHelper.WriteLine("attributes and modifiers apply to all of the members "); - OutputHelper.WriteLine("declared by the constant declaration."); + // Section 10.3 + // A constant-declaration may include a set of attributes, + // a new modifier, and one of four access modifiers. The + // attributes and modifiers apply to all of the members + // declared by the constant declaration. Assert.IsTrue(ConstTestClass9.test()); } @@ -104,14 +104,14 @@ public void Const9_Test() [TestMethod] public void Const11_Test() { - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. //Ported from const11.cs Assert.IsTrue(ConstTestClass11.test()); } @@ -120,14 +120,14 @@ public void Const11_Test() public void Const12_Test() { //Ported from const12.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass12.test()); } @@ -135,14 +135,14 @@ public void Const12_Test() public void Const13_Test() { //Ported from const13.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass13.test()); } @@ -150,14 +150,14 @@ public void Const13_Test() public void Const14_Test() { //Ported from const14.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass14.test()); } @@ -165,14 +165,14 @@ public void Const14_Test() public void Const15_Test() { //Ported from const15.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass15.test()); } @@ -180,14 +180,14 @@ public void Const15_Test() public void Const16_Test() { //Ported from const16.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass16.test()); } @@ -195,14 +195,14 @@ public void Const16_Test() public void Const17_Test() { //Ported from const17.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass17.test()); } @@ -210,14 +210,14 @@ public void Const17_Test() public void Const18_Test() { //Ported from const18.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass18.test()); } @@ -225,14 +225,14 @@ public void Const18_Test() public void Const19_Test() { //Ported from const19.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass19.test()); } @@ -240,14 +240,14 @@ public void Const19_Test() public void Const20_Test() { //Ported from const20.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass20.test()); } @@ -255,14 +255,14 @@ public void Const20_Test() public void Const21_Test() { //Ported from const21.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass21.test()); } @@ -270,14 +270,14 @@ public void Const21_Test() public void Const24_Test() { //Ported from const24.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass24.test()); } @@ -285,12 +285,12 @@ public void Const24_Test() public void Const25_Test() { //Ported from const25.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant itself can participate in a constant-expression."); - OutputHelper.WriteLine("Thus, a constant may be used in any construct that requires"); - OutputHelper.WriteLine("a constant-expression. Examples of such constructs include"); - OutputHelper.WriteLine("case labels, goto case statements, enum member declarations,"); - OutputHelper.WriteLine("attributes, and other constant declarations."); + // Section 10.3 + // A constant itself can participate in a constant-expression. + // Thus, a constant may be used in any construct that requires + // a constant-expression. Examples of such constructs include + // case labels, goto case statements, enum member declarations, + // attributes, and other constant declarations. Assert.IsTrue(ConstTestClass25.test()); } @@ -298,12 +298,12 @@ public void Const25_Test() public void Const26_Test() { //Ported from const26.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant itself can participate in a constant-expression."); - OutputHelper.WriteLine("Thus, a constant may be used in any construct that requires"); - OutputHelper.WriteLine("a constant-expression. Examples of such constructs include"); - OutputHelper.WriteLine("case labels, goto case statements, enum member declarations,"); - OutputHelper.WriteLine("attributes, and other constant declarations."); + // Section 10.3 + // A constant itself can participate in a constant-expression. + // Thus, a constant may be used in any construct that requires + // a constant-expression. Examples of such constructs include + // case labels, goto case statements, enum member declarations, + // attributes, and other constant declarations. Assert.IsTrue(ConstTestClass26.test()); } @@ -311,12 +311,12 @@ public void Const26_Test() public void Const27_Test() { //Ported from const27.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant itself can participate in a constant-expression."); - OutputHelper.WriteLine("Thus, a constant may be used in any construct that requires"); - OutputHelper.WriteLine("a constant-expression. Examples of such constructs include"); - OutputHelper.WriteLine("case labels, goto case statements, enum member declarations,"); - OutputHelper.WriteLine("attributes, and other constant declarations."); + // Section 10.3 + // A constant itself can participate in a constant-expression. + // Thus, a constant may be used in any construct that requires + // a constant-expression. Examples of such constructs include + // case labels, goto case statements, enum member declarations, + // attributes, and other constant declarations. Assert.IsTrue(ConstTestClass27.test()); } @@ -324,12 +324,12 @@ public void Const27_Test() public void Const28_Test() { //Ported from const28.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant itself can participate in a constant-expression."); - OutputHelper.WriteLine("Thus, a constant may be used in any construct that requires"); - OutputHelper.WriteLine("a constant-expression. Examples of such constructs include"); - OutputHelper.WriteLine("case labels, goto case statements, enum member declarations,"); - OutputHelper.WriteLine("attributes, and other constant declarations."); + // Section 10.3 + // A constant itself can participate in a constant-expression. + // Thus, a constant may be used in any construct that requires + // a constant-expression. Examples of such constructs include + // case labels, goto case statements, enum member declarations, + // attributes, and other constant declarations. Assert.IsTrue(ConstTestClass28.test()); } @@ -337,12 +337,12 @@ public void Const28_Test() public void Const30_Test() { //Ported from const30.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("Constants are permitted to depend on other constants"); - OutputHelper.WriteLine("within the same project as long as the dependencies"); - OutputHelper.WriteLine("are not of a circular nature. The compiler automatically"); - OutputHelper.WriteLine("arranges to evaluate the constant declarations in the"); - OutputHelper.WriteLine("appropriate order."); + // Section 10.3 + // Constants are permitted to depend on other constants + // within the same project as long as the dependencies + // are not of a circular nature. The compiler automatically + // arranges to evaluate the constant declarations in the + // appropriate order. Assert.IsTrue(ConstTestClass30.test()); } @@ -350,14 +350,14 @@ public void Const30_Test() public void Const32_Test() { //Ported from const32.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass32.test()); } @@ -365,14 +365,14 @@ public void Const32_Test() public void Const33_Test() { //Ported from const33.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass33.test()); } @@ -380,14 +380,14 @@ public void Const33_Test() public void Const34_Test() { //Ported from const34.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass34.test()); } @@ -395,14 +395,14 @@ public void Const34_Test() public void Const35_Test() { //Ported from const35.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type specified in a constant declaration"); - OutputHelper.WriteLine("must be byte, char, short, int, long, float,"); - OutputHelper.WriteLine("double, double, bool, string, an enum-type,"); - OutputHelper.WriteLine("or a reference type. Each constant-expression"); - OutputHelper.WriteLine("must yield a value of the target type or of a "); - OutputHelper.WriteLine("type that can be converted to the target type"); - OutputHelper.WriteLine("by implicit conversion."); + // Section 10.3 + // The type specified in a constant declaration + // must be byte, char, short, int, long, float, + // double, double, bool, string, an enum-type, + // or a reference type. Each constant-expression + // must yield a value of the target type or of a + // type that can be converted to the target type + // by implicit conversion. Assert.IsTrue(ConstTestClass35.test()); } @@ -410,14 +410,14 @@ public void Const35_Test() public void Const42_Test() { //Ported from const42.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant declarator introduces a new member"); - OutputHelper.WriteLine("This test is expected to fail"); + // Section 10.3 + // A constant declarator introduces a new member + // This test is expected to fail Assert.IsFalse(ConstTestClass42.test()); { - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 17246"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 17246 + // The Test owner needs to verify that the change was intentional and remove the known failure. } } @@ -425,14 +425,14 @@ public void Const42_Test() public void Const43_Test() { //Ported from const43.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant declarator introduces a new member"); - OutputHelper.WriteLine("This test is expected to fail"); + // Section 10.3 + // A constant declarator introduces a new member + // This test is expected to fail Assert.IsFalse(ConstTestClass43.test()); { - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 17246"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 17246 + // The Test owner needs to verify that the change was intentional and remove the known failure. } } @@ -440,8 +440,8 @@ public void Const43_Test() public void Const44_Test() { //Ported from const44.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("The type of a constant must be at least as acccessible as the constant itself."); + // Section 10.3 + // The type of a constant must be at least as acccessible as the constant itself. Assert.IsTrue(ConstTestClass44.test()); } @@ -450,9 +450,9 @@ public void Const44_Test() public void Const56_Test() { //Ported from const56.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("...the only possible value for constants of reference-types other than "); - OutputHelper.WriteLine("string is null"); + // Section 10.3 + // ...the only possible value for constants of reference-types other than + // string is null Assert.IsTrue(ConstTestClass56.test()); } @@ -460,10 +460,10 @@ public void Const56_Test() public void Const57_Test() { //Ported from const57.cs - OutputHelper.WriteLine("Section 10.3"); - OutputHelper.WriteLine("A constant declaration that declares multiple constants is equivalent to "); - OutputHelper.WriteLine("multiple declarations of single constants with the same attributes, "); - OutputHelper.WriteLine("modifiers, and type. "); + // Section 10.3 + // A constant declaration that declares multiple constants is equivalent to + // multiple declarations of single constants with the same attributes, + // modifiers, and type. Assert.IsTrue(ConstTestClass57.test()); } diff --git a/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs b/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs index 28b50922..315eae1c 100644 --- a/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs @@ -16,7 +16,7 @@ class UnitTestDeclarationTests [TestMethod] public void BaseClass1_Test() { - OutputHelper.WriteLine("Tests an int declaration with assignment in a base class"); + // Tests an int declaration with assignment in a base class Assert.IsTrue(BaseClassTestClass1.testMethod()); } @@ -24,8 +24,8 @@ public void BaseClass1_Test() public void BaseClass2_Test() { - OutputHelper.WriteLine("Tests a function declaration in a implementing class still"); - OutputHelper.WriteLine("works after child is cast as an implemented interface"); + // Tests a function declaration in a implementing class still + // works after child is cast as an implemented interface Assert.IsTrue(BaseClassTestClass2.testMethod()); } @@ -33,52 +33,52 @@ public void BaseClass2_Test() public void BaseClass3_Test() { - OutputHelper.WriteLine("Tests a function declaration in an implementing class still works after child is cast as"); - OutputHelper.WriteLine("each of two implemented interfaces"); + // Tests a function declaration in an implementing class still works after child is cast as + // each of two implemented interfaces Assert.IsTrue(BaseClassTestClass3.testMethod()); } [TestMethod] public void BaseClass4_Test() { - OutputHelper.WriteLine("Tests a function declaration in a child class still works after child is cast as"); - OutputHelper.WriteLine("its parent class and an interface it implements"); + // Tests a function declaration in a child class still works after child is cast as + // its parent class and an interface it implements Assert.IsTrue(BaseClassTestClass4.testMethod()); } [TestMethod] public void BaseClass10_Test() { - OutputHelper.WriteLine("Section 10.1"); - OutputHelper.WriteLine("The base classes of a class are the direct base"); - OutputHelper.WriteLine("class and its base classes. In other words, the"); - OutputHelper.WriteLine("set of base classes is the transitive closure of the "); - OutputHelper.WriteLine("direct base class relatationship."); + // Section 10.1 + // The base classes of a class are the direct base + // class and its base classes. In other words, the + // set of base classes is the transitive closure of the + // direct base class relatationship. Assert.IsTrue(BaseClassTestClass10.testMethod()); } [TestMethod] public void BaseClass13_Test() { - OutputHelper.WriteLine("Section 10.1"); - OutputHelper.WriteLine("Note that a class does not depend on the"); - OutputHelper.WriteLine("classes that are nested within it. "); + // Section 10.1 + // Note that a class does not depend on the + // classes that are nested within it. Assert.IsTrue(BaseClassTestClass13.testMethod()); } [TestMethod] public void BaseClass25_Test() { - OutputHelper.WriteLine("10.1.2.1 "); - OutputHelper.WriteLine("inheriting from nested types"); + // 10.1.2.1 + // inheriting from nested types Assert.IsTrue(BaseClassTestClass25.testMethod()); } [TestMethod] public void BaseClass29_Test() { - OutputHelper.WriteLine("10.1.2.1 "); - OutputHelper.WriteLine("inheriting from nested types"); + // 10.1.2.1 + // inheriting from nested types Assert.IsTrue(BaseClassTestClass29.testMethod()); } @@ -86,7 +86,7 @@ public void BaseClass29_Test() [TestMethod] public void Modifiers2_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner class with modifier 'new' "); + // Testing a public int inside an inner class with modifier 'new' Assert.IsTrue(ModifiersTestClass2.testMethod()); } @@ -95,7 +95,7 @@ public void Modifiers2_Test() public void Modifiers3_Test() { - OutputHelper.WriteLine("Testing a public int directly inside a public class"); + // Testing a public int directly inside a public class Assert.IsTrue(ModifiersTestClass3.testMethod()); } @@ -103,7 +103,7 @@ public void Modifiers3_Test() public void Modifiers4_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner class with modifier 'public' "); + // Testing a public int inside an inner class with modifier 'public' Assert.IsTrue(ModifiersTestClass4.testMethod()); } @@ -111,7 +111,7 @@ public void Modifiers4_Test() public void Modifiers6_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner class with modifier 'protected' "); + // Testing a public int inside an inner class with modifier 'protected' Assert.IsTrue(ModifiersTestClass6.testMethod()); } @@ -119,14 +119,14 @@ public void Modifiers6_Test() public void Modifiers7_Test() { - OutputHelper.WriteLine("Testing a public int directly inside an internal class"); + // Testing a public int directly inside an internal class Assert.IsTrue(ModifiersTestClass7.testMethod()); } [TestMethod] public void Modifiers8_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner class with modifier 'internal' "); + // Testing a public int inside an inner class with modifier 'internal' Assert.IsTrue(ModifiersTestClass8.testMethod()); } @@ -134,7 +134,7 @@ public void Modifiers8_Test() public void Modifiers10_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner class with modifier 'private' "); + // Testing a public int inside an inner class with modifier 'private' Assert.IsTrue(ModifiersTestClass10.testMethod()); } @@ -142,7 +142,7 @@ public void Modifiers10_Test() public void Modifiers11_Test() { - OutputHelper.WriteLine("Testing a public int inside an abstract class that is implemented"); + // Testing a public int inside an abstract class that is implemented Assert.IsTrue(ModifiersTestClass11.testMethod()); } @@ -150,14 +150,14 @@ public void Modifiers11_Test() public void Modifiers12_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner abstract class that is implemented"); + // Testing a public int inside an inner abstract class that is implemented Assert.IsTrue(ModifiersTestClass12.testMethod()); } [TestMethod] public void Modifiers13_Test() { - OutputHelper.WriteLine("Testing a public int directly inside a sealed class"); + // Testing a public int directly inside a sealed class Assert.IsTrue(ModifiersTestClass13.testMethod()); } @@ -165,51 +165,51 @@ public void Modifiers13_Test() public void Modifiers14_Test() { - OutputHelper.WriteLine("Testing a public int inside an inner sealed class"); + // Testing a public int inside an inner sealed class Assert.IsTrue(ModifiersTestClass14.testMethod()); } [TestMethod] public void Modifiers23_Test() { - OutputHelper.WriteLine("An abstract class cannot be instantiated, and it is"); - OutputHelper.WriteLine("an error to use the new operator on an abstract class."); - OutputHelper.WriteLine("While it is possible to have variables and values whose"); - OutputHelper.WriteLine("compile-time types are abstract, such variables and values"); - OutputHelper.WriteLine("will necessarily either be null or contain references"); - OutputHelper.WriteLine("to instances of non-abstract classes derived from the "); - OutputHelper.WriteLine("abstract types."); + // An abstract class cannot be instantiated, and it is + // an error to use the new operator on an abstract class. + // While it is possible to have variables and values whose + // compile-time types are abstract, such variables and values + // will necessarily either be null or contain references + // to instances of non-abstract classes derived from the + // abstract types. Assert.IsTrue(ModifiersTestClass23.testMethod()); } [TestMethod] public void Modifiers24_Test() { - OutputHelper.WriteLine("An abstract class cannot be instantiated, and it is"); - OutputHelper.WriteLine("an error to use the new operator on an abstract class."); - OutputHelper.WriteLine("While it is possible to have variables and values whose"); - OutputHelper.WriteLine("compile-time types are abstract, such variables and values"); - OutputHelper.WriteLine("will necessarily either be null or contain references"); - OutputHelper.WriteLine("to instances of non-abstract classes derived from the "); - OutputHelper.WriteLine("abstract types."); + // An abstract class cannot be instantiated, and it is + // an error to use the new operator on an abstract class. + // While it is possible to have variables and values whose + // compile-time types are abstract, such variables and values + // will necessarily either be null or contain references + // to instances of non-abstract classes derived from the + // abstract types. Assert.IsTrue(ModifiersTestClass24.testMethod()); } [TestMethod] public void Modifiers25_Test() { - OutputHelper.WriteLine("Section 10.1"); - OutputHelper.WriteLine("An abstract class is permitted (but not required)"); - OutputHelper.WriteLine("to contain abstract methods and accessors."); + // Section 10.1 + // An abstract class is permitted (but not required) + // to contain abstract methods and accessors. Assert.IsTrue(ModifiersTestClass25.testMethod()); } [TestMethod] public void Modifiers26_Test() { - OutputHelper.WriteLine("Section 10.1"); - OutputHelper.WriteLine("An abstract class is permitted (but not required)"); - OutputHelper.WriteLine("to contain abstract methods and accessors."); + // Section 10.1 + // An abstract class is permitted (but not required) + // to contain abstract methods and accessors. Assert.IsTrue(ModifiersTestClass26.testMethod()); } @@ -217,13 +217,13 @@ public void Modifiers26_Test() public void Modifiers31_Test() { - OutputHelper.WriteLine("Section 10.1"); - OutputHelper.WriteLine("When a non-abstract class is derived from"); - OutputHelper.WriteLine("an abstract class, the non-abstract class must"); - OutputHelper.WriteLine("be include actual implementations of all inherited "); - OutputHelper.WriteLine("abstract methods and accessors. Such implementations"); - OutputHelper.WriteLine("are provided by overriding the abstract methods"); - OutputHelper.WriteLine("and accessors."); + // Section 10.1 + // When a non-abstract class is derived from + // an abstract class, the non-abstract class must + // be include actual implementations of all inherited + // abstract methods and accessors. Such implementations + // are provided by overriding the abstract methods + // and accessors. Assert.IsTrue(ModifiersTestClass31.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs b/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs index 22984d48..97d94e48 100644 --- a/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs @@ -19,11 +19,11 @@ class UnitTestDestructorTests //public void Destructors3_Test() //{ // //Ported from Destructors3.cs - // OutputHelper.WriteLine(" Section 10.11"); - // OutputHelper.WriteLine(" Destructors implement the actions required to "); - // OutputHelper.WriteLine(" destruct the instances of a class."); - // OutputHelper.WriteLine(""); - // OutputHelper.WriteLine("Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs"); + // // Section 10.11 + // // Destructors implement the actions required to + // // destruct the instances of a class. + // // + // // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs // Assert.IsTrue(DestructorsTestClass3.testMethod()); //} @@ -31,11 +31,11 @@ class UnitTestDestructorTests //public void Destructors4_Test() //{ // //Ported from Destructors4.cs - // OutputHelper.WriteLine(" Section 10.11"); - // OutputHelper.WriteLine(" Destructors implement the actions required to "); - // OutputHelper.WriteLine(" destruct the instances of a class."); - // OutputHelper.WriteLine(""); - // OutputHelper.WriteLine("Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs"); + // // Section 10.11 + // // Destructors implement the actions required to + // // destruct the instances of a class. + // // + // // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs // Assert.IsTrue(DestructorsTestClass4.testMethod()); //} @@ -44,12 +44,12 @@ class UnitTestDestructorTests //public void Destructors7_Test() //{ // //Ported from Destructors7.cs - // OutputHelper.WriteLine(" Section 10.12"); - // OutputHelper.WriteLine(" Destructors are not inherited. Thus, a class"); - // OutputHelper.WriteLine(" has no other destructors than those that are "); - // OutputHelper.WriteLine(" actually declared in the class."); - // OutputHelper.WriteLine(""); - // OutputHelper.WriteLine("Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs"); + // // Section 10.12 + // // Destructors are not inherited. Thus, a class + // // has no other destructors than those that are + // // actually declared in the class. + // // + // // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs // Assert.IsTrue(DestructorsTestClass7.testMethod()); //} @@ -60,7 +60,7 @@ class UnitTestDestructorTests // ~DestructorsTestClass3() // { - // //OutputHelper.WriteLine("Calling Destructor for Test Class 3"); + // // Calling Destructor for Test Class 3 // intI = 2; // } @@ -76,7 +76,7 @@ class UnitTestDestructorTests // System.Threading.Thread.Sleep(10); // slept += 10; // } - // OutputHelper.WriteLine("Thread has slept for"); + // // Thread has slept for // OutputHelper.WriteLine(slept.ToString()); // if (intI == 2) // { @@ -96,7 +96,7 @@ class DestructorsTestClass4_Base ~DestructorsTestClass4_Base() { intI = intI * 2; - //OutputHelper.WriteLine("Calling Destructor for Test Class 4 Base"); + // Calling Destructor for Test Class 4 Base } } @@ -106,7 +106,7 @@ class DestructorsTestClass4 : DestructorsTestClass4_Base ~DestructorsTestClass4() { intI = intI + 2; - //OutputHelper.WriteLine("Calling Destructor for Test Class 4"); + // Calling Destructor for Test Class 4 } public static bool testMethod() @@ -121,7 +121,7 @@ public static bool testMethod() System.Threading.Thread.Sleep(10); slept += 10; } - OutputHelper.WriteLine("Thread has slept for"); + // Thread has slept for OutputHelper.WriteLine(slept.ToString()); if (intI == 8) { @@ -145,7 +145,7 @@ class DestructorsTestClass7 : DestructorsTestClass7_Base ~DestructorsTestClass7() { intI = 3; - //OutputHelper.WriteLine("Calling Destructor for Test Class 7"); + // Calling Destructor for Test Class 7 } public static bool testMethod() @@ -160,7 +160,7 @@ public static bool testMethod() System.Threading.Thread.Sleep(10); slept += 10; } - OutputHelper.WriteLine("Thread has slept for"); + // Thread has slept for OutputHelper.WriteLine(slept.ToString()); if (intI == 3) { diff --git a/Tests/NFUnitTestClasses/UnitTestEventTests.cs b/Tests/NFUnitTestClasses/UnitTestEventTests.cs index 63a8da7c..83494f3d 100644 --- a/Tests/NFUnitTestClasses/UnitTestEventTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestEventTests.cs @@ -16,7 +16,7 @@ class UnitTestEventTests [TestMethod] public void Events1_Test() { - OutputHelper.WriteLine("This is testing an obsolete event structure, but should pass."); + // This is testing an obsolete event structure, but should pass. Assert.IsTrue(EventsTestClass1.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestFieldTests.cs b/Tests/NFUnitTestClasses/UnitTestFieldTests.cs index f5a82332..9df7b797 100644 --- a/Tests/NFUnitTestClasses/UnitTestFieldTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestFieldTests.cs @@ -16,379 +16,379 @@ class UnitTestFieldTests [TestMethod] public void Fields1_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass1.testMethod()); } [TestMethod] public void Fields2_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass2.testMethod()); } [TestMethod] public void Fields3_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass3.testMethod()); } [TestMethod] public void Fields4_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass4.testMethod()); } [TestMethod] public void Fields5_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass5.testMethod()); } [TestMethod] public void Fields6_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass6.testMethod()); } [TestMethod] public void Fields7_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass7.testMethod()); } [TestMethod] public void Fields8_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. Assert.IsTrue(FieldsTestClass8.testMethod()); } [TestMethod] public void Fields13_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A field-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers, a"); - OutputHelper.WriteLine(" static modifier, and a readonly modifier. The "); - OutputHelper.WriteLine(" attributes and modifiers apply to all of the "); - OutputHelper.WriteLine(" members declared by the field-declaration."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" A field declaration that declares multiple fields"); - OutputHelper.WriteLine(" is equivalent to multiple declarations of single "); - OutputHelper.WriteLine(" fields with the same attributes, modifiers, and type."); + // Section 10.4 + // A field-declaration may include set of attributes, + // a new modifier, one of four access modifiers, a + // static modifier, and a readonly modifier. The + // attributes and modifiers apply to all of the + // members declared by the field-declaration. + // + // A field declaration that declares multiple fields + // is equivalent to multiple declarations of single + // fields with the same attributes, modifiers, and type. Assert.IsTrue(FieldsTestClass13.testMethod()); } [TestMethod] public void Fields14_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A static field identifies exactly on storage location."); - OutputHelper.WriteLine(" No matter how many instances of a class are created,"); - OutputHelper.WriteLine(" there is only ever one copy of a static field."); + // Section 10.4 + // A static field identifies exactly on storage location. + // No matter how many instances of a class are created, + // there is only ever one copy of a static field. Assert.IsTrue(FieldsTestClass14.testMethod()); } [TestMethod] public void Fields15_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A static field comes into existence when the "); - OutputHelper.WriteLine(" type in which it is declared is loaded, and "); - OutputHelper.WriteLine(" ceases to exist when the type in which it "); - OutputHelper.WriteLine(" is declared in unloaded."); + // Section 10.4 + // A static field comes into existence when the + // type in which it is declared is loaded, and + // ceases to exist when the type in which it + // is declared in unloaded. Assert.IsTrue(FieldsTestClass15.testMethod()); } [TestMethod] public void Fields16_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" Every instance of a class contains a separate copy"); - OutputHelper.WriteLine(" of all instance fields of the class. An instance "); - OutputHelper.WriteLine(" field comes into existence when a new instance of "); - OutputHelper.WriteLine(" its class is created, and ceases to exist when there "); - OutputHelper.WriteLine(" are no references to that instance and the destructor"); - OutputHelper.WriteLine(" of the instance has executed."); + // Section 10.4 + // Every instance of a class contains a separate copy + // of all instance fields of the class. An instance + // field comes into existence when a new instance of + // its class is created, and ceases to exist when there + // are no references to that instance and the destructor + // of the instance has executed. Assert.IsTrue(FieldsTestClass16.testMethod()); } [TestMethod] public void Fields17_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" Every instance of a class contains a separate copy"); - OutputHelper.WriteLine(" of all instance fields of the class. An instance "); - OutputHelper.WriteLine(" field comes into existence when a new instance of "); - OutputHelper.WriteLine(" its class is created, and ceases to exist when there "); - OutputHelper.WriteLine(" are no references to that instance and the destructor"); - OutputHelper.WriteLine(" of the instance has executed."); + // Section 10.4 + // Every instance of a class contains a separate copy + // of all instance fields of the class. An instance + // field comes into existence when a new instance of + // its class is created, and ceases to exist when there + // are no references to that instance and the destructor + // of the instance has executed. Assert.IsTrue(FieldsTestClass17.testMethod()); } [TestMethod] public void Fields18_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" When a field is referenced in a member-access of"); - OutputHelper.WriteLine(" the form E.M, if M is a static field, E must denote"); - OutputHelper.WriteLine(" a type, and if M is an instance field, E must "); - OutputHelper.WriteLine(" denote an instance."); + // Section 10.4 + // When a field is referenced in a member-access of + // the form E.M, if M is a static field, E must denote + // a type, and if M is an instance field, E must + // denote an instance. Assert.IsTrue(FieldsTestClass18.testMethod()); } [TestMethod] public void Fields20_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" When a field is referenced in a member-access of"); - OutputHelper.WriteLine(" the form E.M, if M is a static field, E must denote"); - OutputHelper.WriteLine(" a type, and if M is an instance field, E must "); - OutputHelper.WriteLine(" denote an instance."); + // Section 10.4 + // When a field is referenced in a member-access of + // the form E.M, if M is a static field, E must denote + // a type, and if M is an instance field, E must + // denote an instance. Assert.IsTrue(FieldsTestClass20.testMethod()); } [TestMethod] public void Fields22_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" When a field-declaration includes a readonly"); - OutputHelper.WriteLine(" modifier, assignments to the fields introduced"); - OutputHelper.WriteLine(" by the declaration can only occur as part of"); - OutputHelper.WriteLine(" the declaration or in a constructor in the"); - OutputHelper.WriteLine(" same class."); + // Section 10.4 + // When a field-declaration includes a readonly + // modifier, assignments to the fields introduced + // by the declaration can only occur as part of + // the declaration or in a constructor in the + // same class. Assert.IsTrue(FieldsTestClass22.testMethod()); } [TestMethod] public void Fields23_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" When a field-declaration includes a readonly"); - OutputHelper.WriteLine(" modifier, assignments to the fields introduced"); - OutputHelper.WriteLine(" by the declaration can only occur as part of"); - OutputHelper.WriteLine(" the declaration or in a constructor in the"); - OutputHelper.WriteLine(" same class."); + // Section 10.4 + // When a field-declaration includes a readonly + // modifier, assignments to the fields introduced + // by the declaration can only occur as part of + // the declaration or in a constructor in the + // same class. Assert.IsTrue(FieldsTestClass23.testMethod()); } [TestMethod] public void Fields24_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" When a field-declaration includes a readonly"); - OutputHelper.WriteLine(" modifier, assignments to the fields introduced"); - OutputHelper.WriteLine(" by the declaration can only occur as part of"); - OutputHelper.WriteLine(" the declaration or in a constructor in the"); - OutputHelper.WriteLine(" same class."); + // Section 10.4 + // When a field-declaration includes a readonly + // modifier, assignments to the fields introduced + // by the declaration can only occur as part of + // the declaration or in a constructor in the + // same class. Assert.IsTrue(FieldsTestClass24.testMethod()); } [TestMethod] public void Fields41_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" A static readonly field is useful when a symbolic"); - OutputHelper.WriteLine(" name for a constant value is desired, but when the "); - OutputHelper.WriteLine(" type of the value is not permitted in a const declaration"); - OutputHelper.WriteLine(" or when the value cannot be computed at compile-time"); - OutputHelper.WriteLine(" by a constant expression."); + // Section 10.4 + // A static readonly field is useful when a symbolic + // name for a constant value is desired, but when the + // type of the value is not permitted in a const declaration + // or when the value cannot be computed at compile-time + // by a constant expression. Assert.IsTrue(FieldsTestClass41.testMethod()); } [TestMethod] public void Fields42_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" Field declarations may include variable-initializers."); - OutputHelper.WriteLine(" For static fields, varaible initializers correspond to"); - OutputHelper.WriteLine(" assignment statements that are executed when the class"); - OutputHelper.WriteLine(" is loaded. For instance fields, variable initializers"); - OutputHelper.WriteLine(" correspond to assignment statements that are executed"); - OutputHelper.WriteLine(" when an instance of the class is created."); - OutputHelper.WriteLine("This test has been rewritten to avoid use of the Math.Abs function which the MF does not support"); + // Section 10.4 + // Field declarations may include variable-initializers. + // For static fields, varaible initializers correspond to + // assignment statements that are executed when the class + // is loaded. For instance fields, variable initializers + // correspond to assignment statements that are executed + // when an instance of the class is created. + // This test has been rewritten to avoid use of the Math.Abs function which the MF does not support Assert.IsTrue(FieldsTestClass42.testMethod()); } [TestMethod] public void Fields43_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" The static field variable initializers of a class"); - OutputHelper.WriteLine(" correspond to a sequence of assignments that are "); - OutputHelper.WriteLine(" executed immediately upon entry to the static"); - OutputHelper.WriteLine(" constructor of a class. The variable initializers"); - OutputHelper.WriteLine(" are executed in the textual order they appear"); - OutputHelper.WriteLine(" in the class declaration."); + // Section 10.4 + // The static field variable initializers of a class + // correspond to a sequence of assignments that are + // executed immediately upon entry to the static + // constructor of a class. The variable initializers + // are executed in the textual order they appear + // in the class declaration. Assert.IsTrue(FieldsTestClass43.testMethod()); } [TestMethod] public void Fields44_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" The static field variable initializers of a class"); - OutputHelper.WriteLine(" correspond to a sequence of assignments that are "); - OutputHelper.WriteLine(" executed immediately upon entry to the static"); - OutputHelper.WriteLine(" constructor of a class. The variable initializers"); - OutputHelper.WriteLine(" are executed in the textual order they appear"); - OutputHelper.WriteLine(" in the class declaration."); + // Section 10.4 + // The static field variable initializers of a class + // correspond to a sequence of assignments that are + // executed immediately upon entry to the static + // constructor of a class. The variable initializers + // are executed in the textual order they appear + // in the class declaration. Assert.IsTrue(FieldsTestClass44.testMethod()); } [TestMethod] public void Fields45_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" The static field variable initializers of a class"); - OutputHelper.WriteLine(" correspond to a sequence of assignments that are "); - OutputHelper.WriteLine(" executed immediately upon entry to the static"); - OutputHelper.WriteLine(" constructor of a class. The variable initializers"); - OutputHelper.WriteLine(" are executed in the textual order they appear"); - OutputHelper.WriteLine(" in the class declaration."); + // Section 10.4 + // The static field variable initializers of a class + // correspond to a sequence of assignments that are + // executed immediately upon entry to the static + // constructor of a class. The variable initializers + // are executed in the textual order they appear + // in the class declaration. Assert.IsTrue(FieldsTestClass45.testMethod()); } [TestMethod] public void Fields46_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" The instance field variable initializers of a class"); - OutputHelper.WriteLine(" correspond to a sequence of assignments that are "); - OutputHelper.WriteLine(" executed immediately upon entry to one of the instance"); - OutputHelper.WriteLine(" constructors of the class."); + // Section 10.4 + // The instance field variable initializers of a class + // correspond to a sequence of assignments that are + // executed immediately upon entry to one of the instance + // constructors of the class. Assert.IsTrue(FieldsTestClass46.testMethod()); } [TestMethod] public void Fields49_testMethod() { - OutputHelper.WriteLine(" A variable initializer for an instance field"); - OutputHelper.WriteLine(" cannot reference the instance being created."); - OutputHelper.WriteLine(" Thus, it is an error to reference this in a "); - OutputHelper.WriteLine(" variable initializer, as it is an error for"); - OutputHelper.WriteLine(" a variable initialzer to reference any instance"); - OutputHelper.WriteLine(" member through a simple-name."); + // A variable initializer for an instance field + // cannot reference the instance being created. + // Thus, it is an error to reference this in a + // variable initializer, as it is an error for + // a variable initialzer to reference any instance + // member through a simple-name. Assert.IsTrue(FieldsTestClass49.testMethod()); } [TestMethod] public void Fields51_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" Specifically, assignments to a readonly field"); - OutputHelper.WriteLine(" are permitted only in the following context."); - OutputHelper.WriteLine(" ..."); - OutputHelper.WriteLine(" For an instance field, in the instance constructors"); - OutputHelper.WriteLine(" of the class that contains the field declaration, or"); - OutputHelper.WriteLine(" for a static field, in the static constructor of the"); - OutputHelper.WriteLine(" class the contains the field declaration. These are also"); - OutputHelper.WriteLine(" contexts in which it is valid to pass a readonly field"); - OutputHelper.WriteLine(" as an out or ref parameter."); + // Section 10.4 + // Specifically, assignments to a readonly field + // are permitted only in the following context. + // ... + // For an instance field, in the instance constructors + // of the class that contains the field declaration, or + // for a static field, in the static constructor of the + // class the contains the field declaration. These are also + // contexts in which it is valid to pass a readonly field + // as an out or ref parameter. Assert.IsTrue(FieldsTestClass51.testMethod()); } [TestMethod] public void Fields52_testMethod() { - OutputHelper.WriteLine(" Section 10.4"); - OutputHelper.WriteLine(" Specifically, assignments to a readonly field"); - OutputHelper.WriteLine(" are permitted only in the following context."); - OutputHelper.WriteLine(" ..."); - OutputHelper.WriteLine(" For an instance field, in the instance constructors"); - OutputHelper.WriteLine(" of the class that contains the field declaration, or"); - OutputHelper.WriteLine(" for a static field, in the static constructor of the"); - OutputHelper.WriteLine(" class the contains the field declaration. These are also"); - OutputHelper.WriteLine(" contexts in which it is valid to pass a readonly field"); - OutputHelper.WriteLine(" as an out or ref parameter."); + // Section 10.4 + // Specifically, assignments to a readonly field + // are permitted only in the following context. + // ... + // For an instance field, in the instance constructors + // of the class that contains the field declaration, or + // for a static field, in the static constructor of the + // class the contains the field declaration. These are also + // contexts in which it is valid to pass a readonly field + // as an out or ref parameter. Assert.IsTrue(FieldsTestClass52.testMethod()); } [TestMethod] public void Fields53_testMethod() { - OutputHelper.WriteLine("Testing bools assigned with (x == y)"); + // Testing bools assigned with (x == y) Assert.IsTrue(FieldsTestClass53.testMethod()); } [TestMethod] public void Fields54_testMethod() { - OutputHelper.WriteLine("Testing bools assigned with function calls"); + // Testing bools assigned with function calls Assert.IsTrue(FieldsTestClass54.testMethod()); } [TestMethod] public void Fields55_testMethod() { - OutputHelper.WriteLine("Testing bools assigned with conditionals"); + // Testing bools assigned with conditionals Assert.IsTrue(FieldsTestClass55.testMethod()); } [TestMethod] public void Fields56_testMethod() { - OutputHelper.WriteLine("Testing ints assigned with function calls"); + // Testing ints assigned with function calls Assert.IsTrue(FieldsTestClass56.testMethod()); } [TestMethod] public void Fields57_testMethod() { - OutputHelper.WriteLine("Testing strings assigned with \"x\" + \"y\""); + // Testing strings assigned with \"x\" + \"y\" Assert.IsTrue(FieldsTestClass57.testMethod()); } [TestMethod] public void Fields58_testMethod() { - OutputHelper.WriteLine("Testing strings assigned with function calls"); + // Testing strings assigned with function calls Assert.IsTrue(FieldsTestClass58.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs b/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs index 3a09359c..89710ef5 100644 --- a/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs @@ -16,30 +16,30 @@ class UnitTestIndexerTests [TestMethod] public void Indexers1_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass1.testMethod()); } [TestMethod] public void Indexers2_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass2.testMethod()); } [TestMethod] public void Indexers3_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass3.testMethod()); } @@ -47,257 +47,257 @@ public void Indexers3_Test() [TestMethod] public void Indexers4_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass4.testMethod()); } [TestMethod] public void Indexers5_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass5.testMethod()); } [TestMethod] public void Indexers6_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass6.testMethod()); } [TestMethod] public void Indexers10_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass10.testMethod()); } [TestMethod] public void Indexers11_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" An indexer-declaration may include set of"); - OutputHelper.WriteLine(" attributes, a new modifier, and a valid combination"); - OutputHelper.WriteLine(" of the four access modifiers."); + // Section 10.8 + // An indexer-declaration may include set of + // attributes, a new modifier, and a valid combination + // of the four access modifiers. Assert.IsTrue(IndexersTestClass11.testMethod()); } [TestMethod] public void Indexers12_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" The type on an indexer declaration specifies"); - OutputHelper.WriteLine(" the element type of the indexer introduced"); - OutputHelper.WriteLine(" by the declaration"); + // Section 10.8 + // The type on an indexer declaration specifies + // the element type of the indexer introduced + // by the declaration Assert.IsTrue(IndexersTestClass12.testMethod()); } [TestMethod] public void Indexers14_Test() { - OutputHelper.WriteLine(" Unless the indexer is an explicit interface"); - OutputHelper.WriteLine(" member implementation, the type is followed"); - OutputHelper.WriteLine(" by the keyword this. For an explicit "); - OutputHelper.WriteLine(" interface member implementation, the type is "); - OutputHelper.WriteLine(" followed by an interface-type, a . and the "); - OutputHelper.WriteLine(" keyword this."); - OutputHelper.WriteLine("This is currently an expected fail, but is resolved in 3.0 see Bug 16341 for details"); + // Unless the indexer is an explicit interface + // member implementation, the type is followed + // by the keyword this. For an explicit + // interface member implementation, the type is + // followed by an interface-type, a . and the + // keyword this. + // This is currently an expected fail, but is resolved in 3.0 see Bug 16341 for details Assert.IsTrue(IndexersTestClass14.testMethod()); } [TestMethod] public void Indexers18_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" The formal-index-parameter-list specifies"); - OutputHelper.WriteLine(" the parameters of the indexer. The formal"); - OutputHelper.WriteLine(" parameter list of an indexer corresponds"); - OutputHelper.WriteLine(" to that of a method, except that at least"); - OutputHelper.WriteLine(" one parameter must be specified, and that the"); - OutputHelper.WriteLine(" ref and out parameter modifiers are not"); - OutputHelper.WriteLine(" permitted."); + // Section 10.8 + // The formal-index-parameter-list specifies + // the parameters of the indexer. The formal + // parameter list of an indexer corresponds + // to that of a method, except that at least + // one parameter must be specified, and that the + // ref and out parameter modifiers are not + // permitted. Assert.IsTrue(IndexersTestClass18.testMethod()); } [TestMethod] public void Indexers23_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" The type of an indexer declaration and each "); - OutputHelper.WriteLine(" of the types referenced in the formal-index"); - OutputHelper.WriteLine(" parameter list must be at least as accessible"); - OutputHelper.WriteLine(" as the indexer itself."); + // Section 10.8 + // The type of an indexer declaration and each + // of the types referenced in the formal-index + // parameter list must be at least as accessible + // as the indexer itself. Assert.IsTrue(IndexersTestClass23.testMethod()); } [TestMethod] public void Indexers29_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" The formal parameter list of an indexer defines"); - OutputHelper.WriteLine(" the signature of the indexer. Specifically, the"); - OutputHelper.WriteLine(" signature of an indexer consists of the number and"); - OutputHelper.WriteLine(" types of its formal parameters. The element type"); - OutputHelper.WriteLine(" is not a part of an index signature, nor are the"); - OutputHelper.WriteLine(" names of the formal parameters."); + // Section 10.8 + // The formal parameter list of an indexer defines + // the signature of the indexer. Specifically, the + // signature of an indexer consists of the number and + // types of its formal parameters. The element type + // is not a part of an index signature, nor are the + // names of the formal parameters. Assert.IsTrue(IndexersTestClass29.testMethod()); } [TestMethod] public void Indexers32_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" The formal parameter list of an indexer defines"); - OutputHelper.WriteLine(" the signature of the indexer. Specifically, the"); - OutputHelper.WriteLine(" signature of an indexer consists of the number and"); - OutputHelper.WriteLine(" types of its formal parameters. The element type"); - OutputHelper.WriteLine(" is not a part of an index signature, nor are the"); - OutputHelper.WriteLine(" names of the formal parameters."); + // Section 10.8 + // The formal parameter list of an indexer defines + // the signature of the indexer. Specifically, the + // signature of an indexer consists of the number and + // types of its formal parameters. The element type + // is not a part of an index signature, nor are the + // names of the formal parameters. Assert.IsTrue(IndexersTestClass32.testMethod()); } [TestMethod] public void Indexers33_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" The formal parameter list of an indexer defines"); - OutputHelper.WriteLine(" the signature of the indexer. Specifically, the"); - OutputHelper.WriteLine(" signature of an indexer consists of the number and"); - OutputHelper.WriteLine(" types of its formal parameters. The element type"); - OutputHelper.WriteLine(" is not a part of an index signature, nor are the"); - OutputHelper.WriteLine(" names of the formal parameters."); + // Section 10.8 + // The formal parameter list of an indexer defines + // the signature of the indexer. Specifically, the + // signature of an indexer consists of the number and + // types of its formal parameters. The element type + // is not a part of an index signature, nor are the + // names of the formal parameters. Assert.IsTrue(IndexersTestClass33.testMethod()); } [TestMethod] public void Indexers37_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" With these differences in mind, all rules"); - OutputHelper.WriteLine(" defined in 10.6.2 and 10.6.3 apply to indexer"); - OutputHelper.WriteLine(" accessors as well as property accessors."); + // Section 10.8 + // With these differences in mind, all rules + // defined in 10.6.2 and 10.6.3 apply to indexer + // accessors as well as property accessors. Assert.IsTrue(IndexersTestClass37.testMethod()); } [TestMethod] public void Indexers38_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" With these differences in mind, all rules"); - OutputHelper.WriteLine(" defined in 10.6.2 and 10.6.3 apply to indexer"); - OutputHelper.WriteLine(" accessors as well as property accessors."); + // Section 10.8 + // With these differences in mind, all rules + // defined in 10.6.2 and 10.6.3 apply to indexer + // accessors as well as property accessors. Assert.IsTrue(IndexersTestClass38.testMethod()); } [TestMethod] public void Indexers39_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" With these differences in mind, all rules"); - OutputHelper.WriteLine(" defined in 10.6.2 and 10.6.3 apply to indexer"); - OutputHelper.WriteLine(" accessors as well as property accessors."); + // Section 10.8 + // With these differences in mind, all rules + // defined in 10.6.2 and 10.6.3 apply to indexer + // accessors as well as property accessors. Assert.IsTrue(IndexersTestClass39.testMethod()); } [TestMethod] public void Indexers42_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" With these differences in mind, all rules"); - OutputHelper.WriteLine(" defined in 10.6.2 and 10.6.3 apply to indexer"); - OutputHelper.WriteLine(" accessors as well as property accessors."); + // Section 10.8 + // With these differences in mind, all rules + // defined in 10.6.2 and 10.6.3 apply to indexer + // accessors as well as property accessors. Assert.IsTrue(IndexersTestClass42.testMethod()); } [TestMethod] public void Indexers43_Test() { - OutputHelper.WriteLine(" Section 10.8"); - OutputHelper.WriteLine(" With these differences in mind, all rules"); - OutputHelper.WriteLine(" defined in 10.6.2 and 10.6.3 apply to indexer"); - OutputHelper.WriteLine(" accessors as well as property accessors."); + // Section 10.8 + // With these differences in mind, all rules + // defined in 10.6.2 and 10.6.3 apply to indexer + // accessors as well as property accessors. Assert.IsTrue(IndexersTestClass43.testMethod()); } [TestMethod] public void Indexers46_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers"); + // Testing multiple comma seperated indexers Assert.IsTrue(IndexersTestClass46.testMethod()); } [TestMethod] public void Indexers47_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers to a public variable"); + // Testing multiple comma seperated indexers to a public variable Assert.IsTrue(IndexersTestClass47.testMethod()); } [TestMethod] public void Indexers48_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers with a protected internal get and set"); + // Testing multiple comma seperated indexers with a protected internal get and set Assert.IsTrue(IndexersTestClass48.testMethod()); } [TestMethod] public void Indexers49_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers with an internal get and set"); + // Testing multiple comma seperated indexers with an internal get and set Assert.IsTrue(IndexersTestClass49.testMethod()); } [TestMethod] public void Indexers50_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers with a private get and set"); + // Testing multiple comma seperated indexers with a private get and set Assert.IsTrue(IndexersTestClass50.testMethod()); } [TestMethod] public void Indexers51_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers with a public virtual get and set"); + // Testing multiple comma seperated indexers with a public virtual get and set Assert.IsTrue(IndexersTestClass51.testMethod()); } [TestMethod] public void Indexers52_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers with an overridden public virtual get and set"); - OutputHelper.WriteLine("This test is expected to fail"); + // Testing multiple comma seperated indexers with an overridden public virtual get and set + // This test is expected to fail Assert.IsFalse(IndexersTestClass52.testMethod()); } [TestMethod] public void Indexers53_Test() { - OutputHelper.WriteLine("Testing multiple comma seperated indexers with an overridden public abstract get and set"); + // Testing multiple comma seperated indexers with an overridden public abstract get and set Assert.IsTrue(IndexersTestClass53.testMethod()); } [TestMethod] public void Indexers55_Test() { - OutputHelper.WriteLine("Testing 10 explicitly specified indexers"); + // Testing 10 explicitly specified indexers Assert.IsTrue(IndexersTestClass55.testMethod()); } [TestMethod] public void Indexers56_Test() { - OutputHelper.WriteLine("Testing a single indexers with an overridden public abstract get"); + // Testing a single indexers with an overridden public abstract get Assert.IsTrue(IndexersTestClass56.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestMembersTests.cs b/Tests/NFUnitTestClasses/UnitTestMembersTests.cs index eb163a14..3118ab4f 100644 --- a/Tests/NFUnitTestClasses/UnitTestMembersTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestMembersTests.cs @@ -10,72 +10,72 @@ class UnitTestMembersTests [TestMethod] public void Members23_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" The inherited members of a class are specifically"); - OutputHelper.WriteLine(" not part of the declaration space of a class. Thus, a "); - OutputHelper.WriteLine(" derived class is allowed to declare a member with the same "); - OutputHelper.WriteLine(" name or signature as an inherited member (which in effect"); - OutputHelper.WriteLine(" hides the inherited member)."); + // Section 10.2 + // The inherited members of a class are specifically + // not part of the declaration space of a class. Thus, a + // derived class is allowed to declare a member with the same + // name or signature as an inherited member (which in effect + // hides the inherited member). Assert.IsTrue(MembersTestClass023.testMethod()); } [TestMethod] public void Members24_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" The inherited members of a class are specifically"); - OutputHelper.WriteLine(" not part of the declaration space of a class. Thus, a "); - OutputHelper.WriteLine(" derived class is allowed to declare a member with the same "); - OutputHelper.WriteLine(" name or signature as an inherited member (which in effect"); - OutputHelper.WriteLine(" hides the inherited member)."); + // Section 10.2 + // The inherited members of a class are specifically + // not part of the declaration space of a class. Thus, a + // derived class is allowed to declare a member with the same + // name or signature as an inherited member (which in effect + // hides the inherited member). Assert.IsTrue(MembersTestClass024.testMethod()); } [TestMethod] public void Members25_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" The inherited members of a class are specifically"); - OutputHelper.WriteLine(" not part of the declaration space of a class. Thus, a "); - OutputHelper.WriteLine(" derived class is allowed to declare a member with the same "); - OutputHelper.WriteLine(" name or signature as an inherited member (which in effect"); - OutputHelper.WriteLine(" hides the inherited member)."); + // Section 10.2 + // The inherited members of a class are specifically + // not part of the declaration space of a class. Thus, a + // derived class is allowed to declare a member with the same + // name or signature as an inherited member (which in effect + // hides the inherited member). Assert.IsTrue(MembersTestClass025.testMethod()); } [TestMethod] public void Members26_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" The inherited members of a class are specifically"); - OutputHelper.WriteLine(" not part of the declaration space of a class. Thus, a "); - OutputHelper.WriteLine(" derived class is allowed to declare a member with the same "); - OutputHelper.WriteLine(" name or signature as an inherited member (which in effect"); - OutputHelper.WriteLine(" hides the inherited member)."); + // Section 10.2 + // The inherited members of a class are specifically + // not part of the declaration space of a class. Thus, a + // derived class is allowed to declare a member with the same + // name or signature as an inherited member (which in effect + // hides the inherited member). Assert.IsTrue(MembersTestClass026.testMethod()); } [TestMethod] public void Members27_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" The inherited members of a class are specifically"); - OutputHelper.WriteLine(" not part of the declaration space of a class. Thus, a "); - OutputHelper.WriteLine(" derived class is allowed to declare a member with the same "); - OutputHelper.WriteLine(" name or signature as an inherited member (which in effect"); - OutputHelper.WriteLine(" hides the inherited member)."); + // Section 10.2 + // The inherited members of a class are specifically + // not part of the declaration space of a class. Thus, a + // derived class is allowed to declare a member with the same + // name or signature as an inherited member (which in effect + // hides the inherited member). Assert.IsTrue(MembersTestClass027.testMethod()); } [TestMethod] public void Members28_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" The inherited members of a class are specifically"); - OutputHelper.WriteLine(" not part of the declaration space of a class. Thus, a "); - OutputHelper.WriteLine(" derived class is allowed to declare a member with the same "); - OutputHelper.WriteLine(" name or signature as an inherited member (which in effect"); - OutputHelper.WriteLine(" hides the inherited member)."); + // Section 10.2 + // The inherited members of a class are specifically + // not part of the declaration space of a class. Thus, a + // derived class is allowed to declare a member with the same + // name or signature as an inherited member (which in effect + // hides the inherited member). Assert.IsTrue(MembersTestClass028.testMethod()); } @@ -83,436 +83,436 @@ public void Members28_Test() [TestMethod] public void MembersInheritance001_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass001.testMethod()); } [TestMethod] public void MembersInheritance002_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass002.testMethod()); } [TestMethod] public void MembersInheritance003_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass003.testMethod()); } [TestMethod] public void MembersInheritance004_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass004.testMethod()); } [TestMethod] public void MembersInheritance005_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass005.testMethod()); } [TestMethod] public void MembersInheritance006_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass006.testMethod()); } [TestMethod] public void MembersInheritance007_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass007.testMethod()); } [TestMethod] public void MembersInheritance008_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Inheritance is transitive. If C is derived from"); - OutputHelper.WriteLine(" B, and B is derived from A, then C inherits the"); - OutputHelper.WriteLine(" members declared in B as well as the members"); + // Section 10.2 + // Inheritance is transitive. If C is derived from + // B, and B is derived from A, then C inherits the + // members declared in B as well as the members Assert.IsTrue(MembersInheritanceTestClass008.testMethod()); } [TestMethod] public void MembersInheritance018_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass018.testMethod()); } [TestMethod] public void MembersInheritance019_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass019.testMethod()); } [TestMethod] public void MembersInheritance020_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass020.testMethod()); } [TestMethod] public void MembersInheritance021_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass021.testMethod()); } [TestMethod] public void MembersInheritance022_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass022.testMethod()); } [TestMethod] public void MembersInheritance023_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass023.testMethod()); } [TestMethod] public void MembersInheritance024_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass024.testMethod()); } [TestMethod] public void MembersInheritance025_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" Constructors and destructors are not inherited, but all"); - OutputHelper.WriteLine(" other members are, regardless of their declared accessibility."); - OutputHelper.WriteLine(" However, depending on their declared accessibility, inherited"); - OutputHelper.WriteLine(" members may not be accessible in the derived class."); + // Section 10.2 + // Constructors and destructors are not inherited, but all + // other members are, regardless of their declared accessibility. + // However, depending on their declared accessibility, inherited + // members may not be accessible in the derived class. Assert.IsTrue(MembersInheritanceTestClass025.testMethod()); } [TestMethod] public void MembersInheritance026_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" An instance of a class contains a copy of all instance fields"); - OutputHelper.WriteLine(" declared in the class and its base classes, and an implicit"); - OutputHelper.WriteLine(" conversion exists from a derived class type to any of its base "); - OutputHelper.WriteLine(" class types. Thus, a reference to a derived class instance"); - OutputHelper.WriteLine(" can be treated as a reference to a base class instance."); + // Section 10.2 + // An instance of a class contains a copy of all instance fields + // declared in the class and its base classes, and an implicit + // conversion exists from a derived class type to any of its base + // class types. Thus, a reference to a derived class instance + // can be treated as a reference to a base class instance. Assert.IsTrue(MembersInheritanceTestClass026.testMethod()); } [TestMethod] public void MembersInheritance027_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" An instance of a class contains a copy of all instance fields"); - OutputHelper.WriteLine(" declared in the class and its base classes, and an implicit"); - OutputHelper.WriteLine(" conversion exists from a derived class type to any of its base "); - OutputHelper.WriteLine(" class types. Thus, a reference to a derived class instance"); - OutputHelper.WriteLine(" can be treated as a reference to a base class instance."); + // Section 10.2 + // An instance of a class contains a copy of all instance fields + // declared in the class and its base classes, and an implicit + // conversion exists from a derived class type to any of its base + // class types. Thus, a reference to a derived class instance + // can be treated as a reference to a base class instance. Assert.IsTrue(MembersInheritanceTestClass027.testMethod()); } [TestMethod] public void MembersInheritance028_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass028.testMethod()); } [TestMethod] public void MembersInheritance029_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass029.testMethod()); } [TestMethod] public void MembersInheritance030_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass030.testMethod()); } [TestMethod] public void MembersInheritance031_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass031.testMethod()); } [TestMethod] public void MembersInheritance032_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsFalse(MembersInheritanceTestClass032.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21562"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21562 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void MembersInheritance033_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass033.testMethod()); } [TestMethod] public void MembersInheritance034_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass034.testMethod()); } [TestMethod] public void MembersInheritance035_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsTrue(MembersInheritanceTestClass035.testMethod()); } [TestMethod] public void MembersInheritance036_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class can declare virtual methods, properties,"); - OutputHelper.WriteLine(" and indexers, and derived classes can override the "); - OutputHelper.WriteLine(" implementation of these function members. This enables"); - OutputHelper.WriteLine(" classes to exhibit polymorphic behavior wherein the "); - OutputHelper.WriteLine(" actions performed by a function member invocation"); - OutputHelper.WriteLine(" varies depending on the run-time type of the instance"); - OutputHelper.WriteLine(" through which the member is invoked."); + // Section 10.2 + // A class can declare virtual methods, properties, + // and indexers, and derived classes can override the + // implementation of these function members. This enables + // classes to exhibit polymorphic behavior wherein the + // actions performed by a function member invocation + // varies depending on the run-time type of the instance + // through which the member is invoked. Assert.IsFalse(MembersInheritanceTestClass036.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21562"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21562 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void MembersInheritance037_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration is permitted to declare"); - OutputHelper.WriteLine(" a member with the same name or signature as an "); - OutputHelper.WriteLine(" inherited member. When this occurs, the derived"); - OutputHelper.WriteLine(" class member is said to hide the base class member."); + // Section 10.2 + // A class-member-declaration is permitted to declare + // a member with the same name or signature as an + // inherited member. When this occurs, the derived + // class member is said to hide the base class member. Assert.IsTrue(MembersInheritanceTestClass037.testMethod()); } [TestMethod] public void MembersInheritance038_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration is permitted to declare"); - OutputHelper.WriteLine(" a member with the same name or signature as an "); - OutputHelper.WriteLine(" inherited member. When this occurs, the derived"); - OutputHelper.WriteLine(" class member is said to hide the base class member."); + // Section 10.2 + // A class-member-declaration is permitted to declare + // a member with the same name or signature as an + // inherited member. When this occurs, the derived + // class member is said to hide the base class member. Assert.IsTrue(MembersInheritanceTestClass038.testMethod()); } [TestMethod] public void MembersInheritance039_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration is permitted to declare"); - OutputHelper.WriteLine(" a member with the same name or signature as an "); - OutputHelper.WriteLine(" inherited member. When this occurs, the derived"); - OutputHelper.WriteLine(" class member is said to hide the base class member."); + // Section 10.2 + // A class-member-declaration is permitted to declare + // a member with the same name or signature as an + // inherited member. When this occurs, the derived + // class member is said to hide the base class member. Assert.IsTrue(MembersInheritanceTestClass039.testMethod()); } [TestMethod] public void MembersInheritance040_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration is permitted to declare"); - OutputHelper.WriteLine(" a member with the same name or signature as an "); - OutputHelper.WriteLine(" inherited member. When this occurs, the derived"); - OutputHelper.WriteLine(" class member is said to hide the base class member."); + // Section 10.2 + // A class-member-declaration is permitted to declare + // a member with the same name or signature as an + // inherited member. When this occurs, the derived + // class member is said to hide the base class member. Assert.IsTrue(MembersInheritanceTestClass040.testMethod()); } [TestMethod] public void MembersInheritance041_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass041.testMethod()); } [TestMethod] public void MembersInheritance042_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass042.testMethod()); } [TestMethod] public void MembersInheritance043_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass043.testMethod()); } [TestMethod] public void MembersInheritance044_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass044.testMethod()); } [TestMethod] public void MembersInheritance045_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass045.testMethod()); } [TestMethod] public void MembersInheritance046_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass046.testMethod()); } [TestMethod] public void MembersInheritance047_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass047.testMethod()); } [TestMethod] public void MembersInheritance053_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" If a new modifier is included in a declaration"); - OutputHelper.WriteLine(" that doesn't hide an inherited member, a warning "); - OutputHelper.WriteLine(" is issued to that effect."); + // Section 10.2 + // If a new modifier is included in a declaration + // that doesn't hide an inherited member, a warning + // is issued to that effect. Assert.IsTrue(MembersInheritanceTestClass053.testMethod()); } [TestMethod] public void MembersInheritance054_Test() { - OutputHelper.WriteLine("Testing that protected members can be passed to a grandchild class"); + // Testing that protected members can be passed to a grandchild class Assert.IsTrue(MembersInheritanceTestClass054.testMethod()); } [TestMethod] public void MembersInheritance057_Test() { - OutputHelper.WriteLine("Testing that you can inherit from a member class"); + // Testing that you can inherit from a member class Assert.IsTrue(MembersInheritanceTestClass057.testMethod()); } [TestMethod] public void MembersInheritance058_Test() { - OutputHelper.WriteLine("Testing that you can inherit from a class declared later in the file"); + // Testing that you can inherit from a class declared later in the file Assert.IsTrue(MembersInheritanceTestClass058.testMethod()); } [TestMethod] public void MembersInheritance059_Test() { - OutputHelper.WriteLine("Testing that an inner class inherit from another class"); + // Testing that an inner class inherit from another class Assert.IsTrue(MembersInheritanceTestClass059.testMethod()); } @@ -520,109 +520,109 @@ public void MembersInheritance059_Test() [TestMethod] public void MembersModifiers01_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass01.testMethod()); } [TestMethod] public void MembersModifiers02_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass02.testMethod()); } [TestMethod] public void MembersModifiers03_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass03.testMethod()); } [TestMethod] public void MembersModifiers04_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass04.testMethod()); } [TestMethod] public void MembersModifiers05_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass05.testMethod()); } [TestMethod] public void MembersModifiers06_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass06.testMethod()); } [TestMethod] public void MembersModifiers07_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass07.testMethod()); } [TestMethod] public void MembersModifiers08_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass08.testMethod()); } [TestMethod] public void MembersModifiers12_Test() { - OutputHelper.WriteLine(" Section 10.2"); - OutputHelper.WriteLine(" A class-member-declaration may include one of the "); - OutputHelper.WriteLine(" four access modifiers: public, protected, internal,"); - OutputHelper.WriteLine(" or private. It is an error to specify more than one"); - OutputHelper.WriteLine(" access modifier. When a class-member-declaration "); - OutputHelper.WriteLine(" does not include an access modifier, the declaration"); - OutputHelper.WriteLine(" defaults to private."); + // Section 10.2 + // A class-member-declaration may include one of the + // four access modifiers: public, protected, internal, + // or private. It is an error to specify more than one + // access modifier. When a class-member-declaration + // does not include an access modifier, the declaration + // defaults to private. Assert.IsTrue(MembersModifiersTestClass12.testMethod()); } [TestMethod] diff --git a/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs b/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs index c8da8afa..03619587 100644 --- a/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs @@ -10,527 +10,527 @@ class UnitTestMethodsTests [TestMethod] public void Methods1_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass1.testMethod()); } [TestMethod] public void Methods2_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass2.testMethod()); } [TestMethod] public void Methods3_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass3.testMethod()); } [TestMethod] public void Methods4_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass4.testMethod()); } [TestMethod] public void Methods6_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass6.testMethod()); } [TestMethod] public void Methods7_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass7.testMethod()); } [TestMethod] public void Methods9_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass9.testMethod()); } [TestMethod] public void Methods10_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass10.testMethod()); } [TestMethod] public void Methods11_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsFalse(MethodsTestClass11.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Methods13_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass13.testMethod()); } [TestMethod] public void Methods17_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass17.testMethod()); } [TestMethod] public void Methods19_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass19.testMethod()); } [TestMethod] public void Methods20_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass20.testMethod()); } [TestMethod] public void Methods22_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass22.testMethod()); } [TestMethod] public void Methods23_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass23.testMethod()); } [TestMethod] public void Methods24_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass24.testMethod()); } [TestMethod] public void Methods25_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass25.testMethod()); } [TestMethod] public void Methods26_Test() { - OutputHelper.WriteLine(" The return-type of a method declaration specifies"); - OutputHelper.WriteLine(" the type of the value computed and returned by the"); - OutputHelper.WriteLine(" method. The return type is void if the method does"); - OutputHelper.WriteLine(" not return a value."); + // The return-type of a method declaration specifies + // the type of the value computed and returned by the + // method. The return type is void if the method does + // not return a value. Assert.IsTrue(MethodsTestClass26.testMethod()); } [TestMethod] public void Methods29_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The member-name specifies the name of the method."); - OutputHelper.WriteLine(" Unless the method is an explicit interface member"); - OutputHelper.WriteLine(" implementation, the member-name is simply an "); - OutputHelper.WriteLine(" identifier. For an explicit interface member "); - OutputHelper.WriteLine(" implementation, the member-name consists of an"); - OutputHelper.WriteLine(" interface-type followed by a . and an identifier."); + // Section 10.5 + // The member-name specifies the name of the method. + // Unless the method is an explicit interface member + // implementation, the member-name is simply an + // identifier. For an explicit interface member + // implementation, the member-name consists of an + // interface-type followed by a . and an identifier. Assert.IsTrue(MethodsTestClass29.testMethod()); } [TestMethod] public void Methods30_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The member-name specifies the name of the method."); - OutputHelper.WriteLine(" Unless the method is an explicit interface member"); - OutputHelper.WriteLine(" implementation, the member-name is simply an "); - OutputHelper.WriteLine(" identifier. For an explicit interface member "); - OutputHelper.WriteLine(" implementation, the member-name consists of an"); - OutputHelper.WriteLine(" interface-type followed by a . and an identifier."); + // Section 10.5 + // The member-name specifies the name of the method. + // Unless the method is an explicit interface member + // implementation, the member-name is simply an + // identifier. For an explicit interface member + // implementation, the member-name consists of an + // interface-type followed by a . and an identifier. Assert.IsTrue(MethodsTestClass30.testMethod()); } [TestMethod] public void Methods33_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The optional formal-parameter-list specifies"); - OutputHelper.WriteLine(" the parameters of the method."); + // Section 10.5 + // The optional formal-parameter-list specifies + // the parameters of the method. Assert.IsTrue(MethodsTestClass33.testMethod()); } [TestMethod] public void Methods34_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The optional formal-parameter-list specifies"); - OutputHelper.WriteLine(" the parameters of the method."); + // Section 10.5 + // The optional formal-parameter-list specifies + // the parameters of the method. Assert.IsTrue(MethodsTestClass34.testMethod()); } [TestMethod] public void Methods35_Test() { - OutputHelper.WriteLine("Testing method call with 10 parameters"); + // Testing method call with 10 parameters Assert.IsTrue(MethodsTestClass35.testMethod()); } [TestMethod] public void Methods56_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method declaration creates a separate space"); - OutputHelper.WriteLine(" for parameters and local variables. Names are introduced"); - OutputHelper.WriteLine(" into this declaration space by the formal parameter"); - OutputHelper.WriteLine(" list of the method and by the local variable declarations"); - OutputHelper.WriteLine(" in the block of the method. All names in the declaration"); - OutputHelper.WriteLine(" space of a method must be unique. Thus it is an error"); - OutputHelper.WriteLine(" for a parameter or local variable to have the same name"); - OutputHelper.WriteLine(" as another parameter or local variable."); + // Section 10.5 + // A method declaration creates a separate space + // for parameters and local variables. Names are introduced + // into this declaration space by the formal parameter + // list of the method and by the local variable declarations + // in the block of the method. All names in the declaration + // space of a method must be unique. Thus it is an error + // for a parameter or local variable to have the same name + // as another parameter or local variable. Assert.IsTrue(MethodsTestClass56.testMethod()); } [TestMethod] public void Methods57_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method declaration creates a separate space"); - OutputHelper.WriteLine(" for parameters and local variables. Names are introduced"); - OutputHelper.WriteLine(" into this declaration space by the formal parameter"); - OutputHelper.WriteLine(" list of the method and by the local variable declarations"); - OutputHelper.WriteLine(" in the block of the method. All names in the declaration"); - OutputHelper.WriteLine(" space of a method must be unique. Thus it is an error"); - OutputHelper.WriteLine(" for a parameter or local variable to have the same name"); - OutputHelper.WriteLine(" as another parameter or local variable."); + // Section 10.5 + // A method declaration creates a separate space + // for parameters and local variables. Names are introduced + // into this declaration space by the formal parameter + // list of the method and by the local variable declarations + // in the block of the method. All names in the declaration + // space of a method must be unique. Thus it is an error + // for a parameter or local variable to have the same name + // as another parameter or local variable. Assert.IsTrue(MethodsTestClass57.testMethod()); } [TestMethod] public void Methods58_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is a value parameter,"); - OutputHelper.WriteLine(" the corresponding argument in the method invocation"); - OutputHelper.WriteLine(" must be an expression of a type that is implicitly"); - OutputHelper.WriteLine(" convertible to the formal parameter type."); + // Section 10.5 + // When a formal parameter is a value parameter, + // the corresponding argument in the method invocation + // must be an expression of a type that is implicitly + // convertible to the formal parameter type. Assert.IsTrue(MethodsTestClass58.testMethod()); } [TestMethod] public void Methods59_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is a value parameter,"); - OutputHelper.WriteLine(" the corresponding argument in the method invocation"); - OutputHelper.WriteLine(" must be an expression of a type that is implicitly"); - OutputHelper.WriteLine(" convertible to the formal parameter type."); + // Section 10.5 + // When a formal parameter is a value parameter, + // the corresponding argument in the method invocation + // must be an expression of a type that is implicitly + // convertible to the formal parameter type. Assert.IsTrue(MethodsTestClass59.testMethod()); } [TestMethod] public void Methods60_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is a value parameter,"); - OutputHelper.WriteLine(" the corresponding argument in the method invocation"); - OutputHelper.WriteLine(" must be an expression of a type that is implicitly"); - OutputHelper.WriteLine(" convertible to the formal parameter type."); + // Section 10.5 + // When a formal parameter is a value parameter, + // the corresponding argument in the method invocation + // must be an expression of a type that is implicitly + // convertible to the formal parameter type. Assert.IsTrue(MethodsTestClass60.testMethod()); } [TestMethod] public void Methods61_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is a value parameter,"); - OutputHelper.WriteLine(" the corresponding argument in the method invocation"); - OutputHelper.WriteLine(" must be an expression of a type that is implicitly"); - OutputHelper.WriteLine(" convertible to the formal parameter type."); + // Section 10.5 + // When a formal parameter is a value parameter, + // the corresponding argument in the method invocation + // must be an expression of a type that is implicitly + // convertible to the formal parameter type. Assert.IsTrue(MethodsTestClass61.testMethod()); } [TestMethod] public void Methods66_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method is permitted to assign new values to "); - OutputHelper.WriteLine(" a value parameter. Such assignments only affect"); - OutputHelper.WriteLine(" the local storage location represented by the "); - OutputHelper.WriteLine(" value parameter--they have no effect on the actual "); - OutputHelper.WriteLine(" argument given in the method invocation."); + // Section 10.5 + // A method is permitted to assign new values to + // a value parameter. Such assignments only affect + // the local storage location represented by the + // value parameter--they have no effect on the actual + // argument given in the method invocation. Assert.IsTrue(MethodsTestClass66.testMethod()); } [TestMethod] public void Methods67_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method is permitted to assign new values to "); - OutputHelper.WriteLine(" a value parameter. Such assignments only affect"); - OutputHelper.WriteLine(" the local storage location represented by the "); - OutputHelper.WriteLine(" value parameter--they have no effect on the actual "); - OutputHelper.WriteLine(" argument given in the method invocation."); + // Section 10.5 + // A method is permitted to assign new values to + // a value parameter. Such assignments only affect + // the local storage location represented by the + // value parameter--they have no effect on the actual + // argument given in the method invocation. Assert.IsTrue(MethodsTestClass67.testMethod()); } [TestMethod] public void Methods68_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method is permitted to assign new values to "); - OutputHelper.WriteLine(" a value parameter. Such assignments only affect"); - OutputHelper.WriteLine(" the local storage location represented by the "); - OutputHelper.WriteLine(" value parameter--they have no effect on the actual "); - OutputHelper.WriteLine(" argument given in the method invocation."); + // Section 10.5 + // A method is permitted to assign new values to + // a value parameter. Such assignments only affect + // the local storage location represented by the + // value parameter--they have no effect on the actual + // argument given in the method invocation. Assert.IsTrue(MethodsTestClass68.testMethod()); } [TestMethod] public void Methods69_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with a ref modifier is a "); - OutputHelper.WriteLine(" reference parameter. Unlike a value parameter,"); - OutputHelper.WriteLine(" a reference parameter does not create a new "); - OutputHelper.WriteLine(" storage location. Instead, a reference parameter"); - OutputHelper.WriteLine(" represents the same storage location as the"); - OutputHelper.WriteLine(" variable given as the argument in the method"); - OutputHelper.WriteLine(" invocation."); + // Section 10.5 + // A parameter declared with a ref modifier is a + // reference parameter. Unlike a value parameter, + // a reference parameter does not create a new + // storage location. Instead, a reference parameter + // represents the same storage location as the + // variable given as the argument in the method + // invocation. Assert.IsTrue(MethodsTestClass69.testMethod()); } [TestMethod] public void Methods70_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with a ref modifier is a "); - OutputHelper.WriteLine(" reference parameter. Unlike a value parameter,"); - OutputHelper.WriteLine(" a reference parameter does not create a new "); - OutputHelper.WriteLine(" storage location. Instead, a reference parameter"); - OutputHelper.WriteLine(" represents the same storage location as the"); - OutputHelper.WriteLine(" variable given as the argument in the method"); - OutputHelper.WriteLine(" invocation."); + // Section 10.5 + // A parameter declared with a ref modifier is a + // reference parameter. Unlike a value parameter, + // a reference parameter does not create a new + // storage location. Instead, a reference parameter + // represents the same storage location as the + // variable given as the argument in the method + // invocation. Assert.IsTrue(MethodsTestClass70.testMethod()); } [TestMethod] public void Methods71_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with a ref modifier is a "); - OutputHelper.WriteLine(" reference parameter. Unlike a value parameter,"); - OutputHelper.WriteLine(" a reference parameter does not create a new "); - OutputHelper.WriteLine(" storage location. Instead, a reference parameter"); - OutputHelper.WriteLine(" represents the same storage location as the"); - OutputHelper.WriteLine(" variable given as the argument in the method"); - OutputHelper.WriteLine(" invocation."); + // Section 10.5 + // A parameter declared with a ref modifier is a + // reference parameter. Unlike a value parameter, + // a reference parameter does not create a new + // storage location. Instead, a reference parameter + // represents the same storage location as the + // variable given as the argument in the method + // invocation. Assert.IsTrue(MethodsTestClass71.testMethod()); } [TestMethod] public void Methods75_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is a reference parameter,"); - OutputHelper.WriteLine(" the corresponding argument in a method invocation"); - OutputHelper.WriteLine(" must consist of the keyword ref followed by a "); - OutputHelper.WriteLine(" variable-reference of the same type as the formal"); - OutputHelper.WriteLine(" parameter. A variable must be definitely assigned"); - OutputHelper.WriteLine(" before it can be passed as a reference parameter."); + // Section 10.5 + // When a formal parameter is a reference parameter, + // the corresponding argument in a method invocation + // must consist of the keyword ref followed by a + // variable-reference of the same type as the formal + // parameter. A variable must be definitely assigned + // before it can be passed as a reference parameter. Assert.IsTrue(MethodsTestClass75.testMethod()); } [TestMethod] public void Methods78_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with an out modifier is an output"); - OutputHelper.WriteLine(" parameter. Similar to a reference parameter, an output"); - OutputHelper.WriteLine(" parameter does not create a new storage location. Instead,"); - OutputHelper.WriteLine(" an output parameter represents the same storage location"); - OutputHelper.WriteLine(" as the variable given as the argument in the method invocation."); + // Section 10.5 + // A parameter declared with an out modifier is an output + // parameter. Similar to a reference parameter, an output + // parameter does not create a new storage location. Instead, + // an output parameter represents the same storage location + // as the variable given as the argument in the method invocation. Assert.IsTrue(MethodsTestClass78.testMethod()); } [TestMethod] public void Methods79_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with an out modifier is an output"); - OutputHelper.WriteLine(" parameter. Similar to a reference parameter, an output"); - OutputHelper.WriteLine(" parameter does not create a new storage location. Instead,"); - OutputHelper.WriteLine(" an output parameter represents the same storage location"); - OutputHelper.WriteLine(" as the variable given as the argument in the method invocation."); + // Section 10.5 + // A parameter declared with an out modifier is an output + // parameter. Similar to a reference parameter, an output + // parameter does not create a new storage location. Instead, + // an output parameter represents the same storage location + // as the variable given as the argument in the method invocation. Assert.IsTrue(MethodsTestClass79.testMethod()); } [TestMethod] public void Methods80_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with an out modifier is an output"); - OutputHelper.WriteLine(" parameter. Similar to a reference parameter, an output"); - OutputHelper.WriteLine(" parameter does not create a new storage location. Instead,"); - OutputHelper.WriteLine(" an output parameter represents the same storage location"); - OutputHelper.WriteLine(" as the variable given as the argument in the method invocation."); + // Section 10.5 + // A parameter declared with an out modifier is an output + // parameter. Similar to a reference parameter, an output + // parameter does not create a new storage location. Instead, + // an output parameter represents the same storage location + // as the variable given as the argument in the method invocation. Assert.IsTrue(MethodsTestClass80.testMethod()); } [TestMethod] public void Methods84_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is an output parameter,"); - OutputHelper.WriteLine(" the corresponding argument in a method invocation"); - OutputHelper.WriteLine(" must consist of the keyword out followed by a "); - OutputHelper.WriteLine(" variable-reference of the same type as the formal "); - OutputHelper.WriteLine(" parameter. A variable need not be definitely"); - OutputHelper.WriteLine(" assigned before it can be passed as an output"); - OutputHelper.WriteLine(" parameter, but following an invocation where a "); - OutputHelper.WriteLine(" variable was passed as an output parameter, the"); - OutputHelper.WriteLine(" variable is considered definitely assigned."); + // Section 10.5 + // When a formal parameter is an output parameter, + // the corresponding argument in a method invocation + // must consist of the keyword out followed by a + // variable-reference of the same type as the formal + // parameter. A variable need not be definitely + // assigned before it can be passed as an output + // parameter, but following an invocation where a + // variable was passed as an output parameter, the + // variable is considered definitely assigned. Assert.IsTrue(MethodsTestClass84.testMethod()); } [TestMethod] public void Methods85_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When a formal parameter is an output parameter,"); - OutputHelper.WriteLine(" the corresponding argument in a method invocation"); - OutputHelper.WriteLine(" must consist of the keyword out followed by a "); - OutputHelper.WriteLine(" variable-reference of the same type as the formal "); - OutputHelper.WriteLine(" parameter. A variable need not be definitely"); - OutputHelper.WriteLine(" assigned before it can be passed as an output"); - OutputHelper.WriteLine(" parameter, but following an invocation where a "); - OutputHelper.WriteLine(" variable was passed as an output parameter, the"); - OutputHelper.WriteLine(" variable is considered definitely assigned."); + // Section 10.5 + // When a formal parameter is an output parameter, + // the corresponding argument in a method invocation + // must consist of the keyword out followed by a + // variable-reference of the same type as the formal + // parameter. A variable need not be definitely + // assigned before it can be passed as an output + // parameter, but following an invocation where a + // variable was passed as an output parameter, the + // variable is considered definitely assigned. Assert.IsTrue(MethodsTestClass85.testMethod()); } [TestMethod] public void Methods92_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" Every output parameter of a method must be"); - OutputHelper.WriteLine(" definitely assigned before the method returns."); + // Section 10.5 + // Every output parameter of a method must be + // definitely assigned before the method returns. Assert.IsTrue(MethodsTestClass92.testMethod()); } [TestMethod] public void Methods93_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" Every output parameter of a method must be"); - OutputHelper.WriteLine(" definitely assigned before the method returns."); + // Section 10.5 + // Every output parameter of a method must be + // definitely assigned before the method returns. Assert.IsTrue(MethodsTestClass93.testMethod()); } [TestMethod] public void Methods94_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" Every output parameter of a method must be"); - OutputHelper.WriteLine(" definitely assigned before the method returns."); + // Section 10.5 + // Every output parameter of a method must be + // definitely assigned before the method returns. Assert.IsTrue(MethodsTestClass94.testMethod()); } [TestMethod] public void Methods95_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" Every output parameter of a method must be"); - OutputHelper.WriteLine(" definitely assigned before the method returns."); + // Section 10.5 + // Every output parameter of a method must be + // definitely assigned before the method returns. Assert.IsTrue(MethodsTestClass95.testMethod()); } [TestMethod] public void Methods103_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The implementation of a non-virtual method"); - OutputHelper.WriteLine(" is invariant: The implementation is the same "); - OutputHelper.WriteLine(" whether the method is invoked on an instance"); - OutputHelper.WriteLine(" of the class in which it is declared or an "); - OutputHelper.WriteLine(" instance of the derived class."); + // Section 10.5 + // The implementation of a non-virtual method + // is invariant: The implementation is the same + // whether the method is invoked on an instance + // of the class in which it is declared or an + // instance of the derived class. Assert.IsTrue(MethodsTestClass103.testMethod()); } @@ -538,17 +538,17 @@ public void Methods103_Test() [TestMethod] public void Methods104_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The implementation of a non-virtual method"); - OutputHelper.WriteLine(" is invariant: The implementation is the same "); - OutputHelper.WriteLine(" whether the method is invoked on an instance"); - OutputHelper.WriteLine(" of the class in which it is declared or an "); - OutputHelper.WriteLine(" instance of the derived class."); + // Section 10.5 + // The implementation of a non-virtual method + // is invariant: The implementation is the same + // whether the method is invoked on an instance + // of the class in which it is declared or an + // instance of the derived class. Assert.IsFalse(MethodsTestClass104.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } @@ -556,283 +556,283 @@ public void Methods104_Test() [TestMethod] public void Methods105_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" The implementation of a non-virtual method"); - OutputHelper.WriteLine(" is invariant: The implementation is the same "); - OutputHelper.WriteLine(" whether the method is invoked on an instance"); - OutputHelper.WriteLine(" of the class in which it is declared or an "); - OutputHelper.WriteLine(" instance of the derived class."); + // Section 10.5 + // The implementation of a non-virtual method + // is invariant: The implementation is the same + // whether the method is invoked on an instance + // of the class in which it is declared or an + // instance of the derived class. Assert.IsTrue(MethodsTestClass105.testMethod()); } [TestMethod] public void Methods106_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For every virtual method declaration of M,"); - OutputHelper.WriteLine(" there exists a most derived implementation"); - OutputHelper.WriteLine(" of the method with respect to the class."); - OutputHelper.WriteLine(" The most derived implementation of a "); - OutputHelper.WriteLine(" virtual method M with respectto a class"); - OutputHelper.WriteLine(" R is determined as follows:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" If R contains the introducing virtual"); - OutputHelper.WriteLine(" declaration of M, then this is the most"); - OutputHelper.WriteLine(" derived implementation of M."); + // Section 10.5 + // For every virtual method declaration of M, + // there exists a most derived implementation + // of the method with respect to the class. + // The most derived implementation of a + // virtual method M with respectto a class + // R is determined as follows: + // + // If R contains the introducing virtual + // declaration of M, then this is the most + // derived implementation of M. Assert.IsTrue(MethodsTestClass106.testMethod()); } [TestMethod] public void Methods107_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For every virtual method declaration of M,"); - OutputHelper.WriteLine(" there exists a most derived implementation"); - OutputHelper.WriteLine(" of the method with respect to the class."); - OutputHelper.WriteLine(" The most derived implementation of a "); - OutputHelper.WriteLine(" virtual method M with respectto a class"); - OutputHelper.WriteLine(" R is determined as follows:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" If R contains the introducing virtual"); - OutputHelper.WriteLine(" declaration of M, then this is the most"); - OutputHelper.WriteLine(" derived implementation of M."); + // Section 10.5 + // For every virtual method declaration of M, + // there exists a most derived implementation + // of the method with respect to the class. + // The most derived implementation of a + // virtual method M with respectto a class + // R is determined as follows: + // + // If R contains the introducing virtual + // declaration of M, then this is the most + // derived implementation of M. Assert.IsFalse(MethodsTestClass107.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Methods108_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For every virtual method declaration of M,"); - OutputHelper.WriteLine(" there exists a most derived implementation"); - OutputHelper.WriteLine(" of the method with respect to the class."); - OutputHelper.WriteLine(" The most derived implementation of a "); - OutputHelper.WriteLine(" virtual method M with respectto a class"); - OutputHelper.WriteLine(" R is determined as follows:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" If R contains the introducing virtual"); - OutputHelper.WriteLine(" declaration of M, then this is the most"); - OutputHelper.WriteLine(" derived implementation of M."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" Otherwise, if R contains an override of M,"); - OutputHelper.WriteLine(" then this is the most derived implementation"); - OutputHelper.WriteLine(" of M."); + // Section 10.5 + // For every virtual method declaration of M, + // there exists a most derived implementation + // of the method with respect to the class. + // The most derived implementation of a + // virtual method M with respectto a class + // R is determined as follows: + // + // If R contains the introducing virtual + // declaration of M, then this is the most + // derived implementation of M. + // + // Otherwise, if R contains an override of M, + // then this is the most derived implementation + // of M. Assert.IsTrue(MethodsTestClass108.testMethod()); } [TestMethod] public void Methods109_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For every virtual method declaration of M,"); - OutputHelper.WriteLine(" there exists a most derived implementation"); - OutputHelper.WriteLine(" of the method with respect to the class."); - OutputHelper.WriteLine(" The most derived implementation of a "); - OutputHelper.WriteLine(" virtual method M with respectto a class"); - OutputHelper.WriteLine(" R is determined as follows:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" If R contains the introducing virtual"); - OutputHelper.WriteLine(" declaration of M, then this is the most"); - OutputHelper.WriteLine(" derived implementation of M."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" Otherwise, if R contains an override of M,"); - OutputHelper.WriteLine(" then this is the most derived implementation"); - OutputHelper.WriteLine(" of M."); + // Section 10.5 + // For every virtual method declaration of M, + // there exists a most derived implementation + // of the method with respect to the class. + // The most derived implementation of a + // virtual method M with respectto a class + // R is determined as follows: + // + // If R contains the introducing virtual + // declaration of M, then this is the most + // derived implementation of M. + // + // Otherwise, if R contains an override of M, + // then this is the most derived implementation + // of M. Assert.IsTrue(MethodsTestClass109.testMethod()); } [TestMethod] public void Methods110_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For every virtual method declaration of M,"); - OutputHelper.WriteLine(" there exists a most derived implementation"); - OutputHelper.WriteLine(" of the method with respect to the class."); - OutputHelper.WriteLine(" The most derived implementation of a "); - OutputHelper.WriteLine(" virtual method M with respectto a class"); - OutputHelper.WriteLine(" R is determined as follows:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" If R contains the introducing virtual"); - OutputHelper.WriteLine(" declaration of M, then this is the most"); - OutputHelper.WriteLine(" derived implementation of M."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" Otherwise, if R contains an override of M,"); - OutputHelper.WriteLine(" then this is the most derived implementation"); - OutputHelper.WriteLine(" of M."); + // Section 10.5 + // For every virtual method declaration of M, + // there exists a most derived implementation + // of the method with respect to the class. + // The most derived implementation of a + // virtual method M with respectto a class + // R is determined as follows: + // + // If R contains the introducing virtual + // declaration of M, then this is the most + // derived implementation of M. + // + // Otherwise, if R contains an override of M, + // then this is the most derived implementation + // of M. Assert.IsFalse(MethodsTestClass110.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Methods111_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For every virtual method declaration of M,"); - OutputHelper.WriteLine(" there exists a most derived implementation"); - OutputHelper.WriteLine(" of the method with respect to the class."); - OutputHelper.WriteLine(" The most derived implementation of a "); - OutputHelper.WriteLine(" virtual method M with respectto a class"); - OutputHelper.WriteLine(" R is determined as follows:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" If R contains the introducing virtual"); - OutputHelper.WriteLine(" declaration of M, then this is the most"); - OutputHelper.WriteLine(" derived implementation of M."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" Otherwise, if R contains an override of M,"); - OutputHelper.WriteLine(" then this is the most derived implementation"); - OutputHelper.WriteLine(" of M."); + // Section 10.5 + // For every virtual method declaration of M, + // there exists a most derived implementation + // of the method with respect to the class. + // The most derived implementation of a + // virtual method M with respectto a class + // R is determined as follows: + // + // If R contains the introducing virtual + // declaration of M, then this is the most + // derived implementation of M. + // + // Otherwise, if R contains an override of M, + // then this is the most derived implementation + // of M. Assert.IsTrue(MethodsTestClass111.testMethod()); } [TestMethod] public void Methods112_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" Because methods are allowed to hide inherited"); - OutputHelper.WriteLine(" methods, it is possible for a class to contain"); - OutputHelper.WriteLine(" several virtual methods with the same signature."); - OutputHelper.WriteLine(" This does not provide an ambiguity problem, since"); - OutputHelper.WriteLine(" all but the most derived method are hidden."); + // Section 10.5 + // Because methods are allowed to hide inherited + // methods, it is possible for a class to contain + // several virtual methods with the same signature. + // This does not provide an ambiguity problem, since + // all but the most derived method are hidden. Assert.IsFalse(MethodsTestClass112.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Methods116_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" It is an error for an override method declaration"); - OutputHelper.WriteLine(" to include any one of the new, static, virtual, or "); - OutputHelper.WriteLine(" abstract modifiers."); + // Section 10.5 + // It is an error for an override method declaration + // to include any one of the new, static, virtual, or + // abstract modifiers. Assert.IsTrue(MethodsTestClass116.testMethod()); } [TestMethod] public void Methods117_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For purposes of locating the overridden base"); - OutputHelper.WriteLine(" method, a method is considered accessible if "); - OutputHelper.WriteLine(" it is public, if it is protected, if it is "); - OutputHelper.WriteLine(" internal and declared in the same project as "); - OutputHelper.WriteLine(" C, or if it is private and declared in a class"); - OutputHelper.WriteLine(" containing the declaration of C."); + // Section 10.5 + // For purposes of locating the overridden base + // method, a method is considered accessible if + // it is public, if it is protected, if it is + // internal and declared in the same project as + // C, or if it is private and declared in a class + // containing the declaration of C. Assert.IsTrue(MethodsTestClass117.testMethod()); } [TestMethod] public void Methods119_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For purposes of locating the overridden base"); - OutputHelper.WriteLine(" method, a method is considered accessible if "); - OutputHelper.WriteLine(" it is public, if it is protected, if it is "); - OutputHelper.WriteLine(" internal and declared in the same project as "); - OutputHelper.WriteLine(" C, or if it is private and declared in a class"); - OutputHelper.WriteLine(" containing the declaration of C."); + // Section 10.5 + // For purposes of locating the overridden base + // method, a method is considered accessible if + // it is public, if it is protected, if it is + // internal and declared in the same project as + // C, or if it is private and declared in a class + // containing the declaration of C. Assert.IsTrue(MethodsTestClass119.testMethod()); } [TestMethod] public void Methods120_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For purposes of locating the overridden base"); - OutputHelper.WriteLine(" method, a method is considered accessible if "); - OutputHelper.WriteLine(" it is public, if it is protected, if it is "); - OutputHelper.WriteLine(" internal and declared in the same project as "); - OutputHelper.WriteLine(" C, or if it is private and declared in a class"); - OutputHelper.WriteLine(" containing the declaration of C."); + // Section 10.5 + // For purposes of locating the overridden base + // method, a method is considered accessible if + // it is public, if it is protected, if it is + // internal and declared in the same project as + // C, or if it is private and declared in a class + // containing the declaration of C. Assert.IsTrue(MethodsTestClass120.testMethod()); } [TestMethod] public void Methods121_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" For purposes of locating the overridden base"); - OutputHelper.WriteLine(" method, a method is considered accessible if "); - OutputHelper.WriteLine(" it is public, if it is protected, if it is "); - OutputHelper.WriteLine(" internal and declared in the same project as "); - OutputHelper.WriteLine(" C, or if it is private and declared in a class"); - OutputHelper.WriteLine(" containing the declaration of C."); + // Section 10.5 + // For purposes of locating the overridden base + // method, a method is considered accessible if + // it is public, if it is protected, if it is + // internal and declared in the same project as + // C, or if it is private and declared in a class + // containing the declaration of C. Assert.IsTrue(MethodsTestClass121.testMethod()); } [TestMethod] public void Methods124_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A compile time-error occurs unless all"); - OutputHelper.WriteLine(" of the following are true for an override"); - OutputHelper.WriteLine(" declaration:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" An overriddden base method can be located"); - OutputHelper.WriteLine(" as described above."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" The overridden base method is virtual,"); - OutputHelper.WriteLine(" abstract, or override method. In other"); - OutputHelper.WriteLine(" words, the overridden base method cannot"); - OutputHelper.WriteLine(" be static or non-virtual."); + // Section 10.5 + // A compile time-error occurs unless all + // of the following are true for an override + // declaration: + // + // An overriddden base method can be located + // as described above. + // + // The overridden base method is virtual, + // abstract, or override method. In other + // words, the overridden base method cannot + // be static or non-virtual. Assert.IsTrue(MethodsTestClass124.testMethod()); } [TestMethod] public void Methods125_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A compile time-error occurs unless all"); - OutputHelper.WriteLine(" of the following are true for an override"); - OutputHelper.WriteLine(" declaration:"); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" An overriddden base method can be located"); - OutputHelper.WriteLine(" as described above."); - OutputHelper.WriteLine(""); - OutputHelper.WriteLine(" The overridden base method is virtual,"); - OutputHelper.WriteLine(" abstract, or override method. In other"); - OutputHelper.WriteLine(" words, the overridden base method cannot"); - OutputHelper.WriteLine(" be static or non-virtual."); + // Section 10.5 + // A compile time-error occurs unless all + // of the following are true for an override + // declaration: + // + // An overriddden base method can be located + // as described above. + // + // The overridden base method is virtual, + // abstract, or override method. In other + // words, the overridden base method cannot + // be static or non-virtual. Assert.IsTrue(MethodsTestClass125.testMethod()); } [TestMethod] public void Methods132_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" An override declaration can access the overridden "); - OutputHelper.WriteLine(" base method using a base-access."); + // Section 10.5 + // An override declaration can access the overridden + // base method using a base-access. Assert.IsTrue(MethodsTestClass132.testMethod()); } [TestMethod] public void Methods133_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" An override declaration can access the overridden "); - OutputHelper.WriteLine(" base method using a base-access."); + // Section 10.5 + // An override declaration can access the overridden + // base method using a base-access. Assert.IsTrue(MethodsTestClass133.testMethod()); } [TestMethod] public void Methods134_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" Only by including an override modifier can"); - OutputHelper.WriteLine(" a method override another method. In all other"); - OutputHelper.WriteLine(" cases, a method with the same signature as an"); - OutputHelper.WriteLine(" inherited method simply hides the inherited "); - OutputHelper.WriteLine(" member."); + // Section 10.5 + // Only by including an override modifier can + // a method override another method. In all other + // cases, a method with the same signature as an + // inherited method simply hides the inherited + // member. Assert.IsFalse(MethodsTestClass134.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] @@ -844,489 +844,489 @@ public void Methods142_Test() [TestMethod] public void Methods148_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" If execution of the method body of a void"); - OutputHelper.WriteLine(" method completes normally (that is, if control"); - OutputHelper.WriteLine(" flows off the end of the method body), the "); - OutputHelper.WriteLine(" method simply returns to the caller."); + // Section 10.5 + // If execution of the method body of a void + // method completes normally (that is, if control + // flows off the end of the method body), the + // method simply returns to the caller. Assert.IsTrue(MethodsTestClass148.testMethod()); } [TestMethod] public void Methods149_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When the return type of a method is not void,"); - OutputHelper.WriteLine(" each return statement in the method body must"); - OutputHelper.WriteLine(" specify an expression of a type that is implicitly"); - OutputHelper.WriteLine(" covertable to the return type."); + // Section 10.5 + // When the return type of a method is not void, + // each return statement in the method body must + // specify an expression of a type that is implicitly + // covertable to the return type. Assert.IsTrue(MethodsTestClass149.testMethod()); } [TestMethod] public void Methods150_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When the return type of a method is not void,"); - OutputHelper.WriteLine(" each return statement in the method body must"); - OutputHelper.WriteLine(" specify an expression of a type that is implicitly"); - OutputHelper.WriteLine(" covertable to the return type."); + // Section 10.5 + // When the return type of a method is not void, + // each return statement in the method body must + // specify an expression of a type that is implicitly + // covertable to the return type. Assert.IsTrue(MethodsTestClass150.testMethod()); } [TestMethod] public void Methods154_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When the return type of a method is not void,"); - OutputHelper.WriteLine(" each return statement in the method body must"); - OutputHelper.WriteLine(" specify an expression of a type that is implicitly"); - OutputHelper.WriteLine(" covertable to the return type."); + // Section 10.5 + // When the return type of a method is not void, + // each return statement in the method body must + // specify an expression of a type that is implicitly + // covertable to the return type. Assert.IsTrue(MethodsTestClass154.testMethod()); } [TestMethod] public void Methods159_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When the return type of a method is not void,"); - OutputHelper.WriteLine(" each return statement in the method body must"); - OutputHelper.WriteLine(" specify an expression of a type that is implicitly"); - OutputHelper.WriteLine(" covertable to the return type. Execution of the "); - OutputHelper.WriteLine(" method body of a value returning method is required"); - OutputHelper.WriteLine(" to terminate in a return statement that specifies"); - OutputHelper.WriteLine(" an expression or in a throw statement that throws"); - OutputHelper.WriteLine(" an System.Exception."); + // Section 10.5 + // When the return type of a method is not void, + // each return statement in the method body must + // specify an expression of a type that is implicitly + // covertable to the return type. Execution of the + // method body of a value returning method is required + // to terminate in a return statement that specifies + // an expression or in a throw statement that throws + // an System.Exception. Assert.IsTrue(MethodsTestClass159.testMethod()); } [TestMethod] public void Methods160_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When the return type of a method is not void,"); - OutputHelper.WriteLine(" each return statement in the method body must"); - OutputHelper.WriteLine(" specify an expression of a type that is implicitly"); - OutputHelper.WriteLine(" covertable to the return type. Execution of the "); - OutputHelper.WriteLine(" method body of a value returning method is required"); - OutputHelper.WriteLine(" to terminate in a return statement that specifies"); - OutputHelper.WriteLine(" an expression or in a throw statement that throws"); - OutputHelper.WriteLine(" an System.Exception."); + // Section 10.5 + // When the return type of a method is not void, + // each return statement in the method body must + // specify an expression of a type that is implicitly + // covertable to the return type. Execution of the + // method body of a value returning method is required + // to terminate in a return statement that specifies + // an expression or in a throw statement that throws + // an System.Exception. Assert.IsTrue(MethodsTestClass160.testMethod()); } [TestMethod] public void Methods161_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" When the return type of a method is not void,"); - OutputHelper.WriteLine(" each return statement in the method body must"); - OutputHelper.WriteLine(" specify an expression of a type that is implicitly"); - OutputHelper.WriteLine(" covertable to the return type. Execution of the "); - OutputHelper.WriteLine(" method body of a value returning method is required"); - OutputHelper.WriteLine(" to terminate in a return statement that specifies"); - OutputHelper.WriteLine(" an expression or in a throw statement that throws"); - OutputHelper.WriteLine(" an System.Exception."); + // Section 10.5 + // When the return type of a method is not void, + // each return statement in the method body must + // specify an expression of a type that is implicitly + // covertable to the return type. Execution of the + // method body of a value returning method is required + // to terminate in a return statement that specifies + // an expression or in a throw statement that throws + // an System.Exception. Assert.IsTrue(MethodsTestClass161.testMethod()); } [TestMethod] public void Methods163_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with a params modifier is"); - OutputHelper.WriteLine(" a params parameter. A params parameter must be"); - OutputHelper.WriteLine(" the last parameter in the formal parameter list,"); - OutputHelper.WriteLine(" and the type of a params parameter must be a "); - OutputHelper.WriteLine(" single-dimension array type. For example, the"); - OutputHelper.WriteLine(" types int[] and int[][] can be used as the type of"); - OutputHelper.WriteLine(" a params parameter, but the type int[,] cannot be"); - OutputHelper.WriteLine(" used in this way."); + // Section 10.5 + // A parameter declared with a params modifier is + // a params parameter. A params parameter must be + // the last parameter in the formal parameter list, + // and the type of a params parameter must be a + // single-dimension array type. For example, the + // types int[] and int[][] can be used as the type of + // a params parameter, but the type int[,] cannot be + // used in this way. Assert.IsTrue(MethodsTestClass163.testMethod()); } [TestMethod] public void Methods164_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A parameter declared with a params modifier is"); - OutputHelper.WriteLine(" a params parameter. A params parameter must be"); - OutputHelper.WriteLine(" the last parameter in the formal parameter list,"); - OutputHelper.WriteLine(" and the type of a params parameter must be a "); - OutputHelper.WriteLine(" single-dimension array type. For example, the"); - OutputHelper.WriteLine(" types int[] and int[][] can be used as the type of"); - OutputHelper.WriteLine(" a params parameter, but the type int[,] cannot be"); - OutputHelper.WriteLine(" used in this way."); + // Section 10.5 + // A parameter declared with a params modifier is + // a params parameter. A params parameter must be + // the last parameter in the formal parameter list, + // and the type of a params parameter must be a + // single-dimension array type. For example, the + // types int[] and int[][] can be used as the type of + // a params parameter, but the type int[,] cannot be + // used in this way. Assert.IsTrue(MethodsTestClass164.testMethod()); } [TestMethod] public void Methods169_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" The caller may specify an expression of a type that"); - OutputHelper.WriteLine(" is implicitly convertible to the formal parameter type."); - OutputHelper.WriteLine(" In this case, the params parameter acts precisely like"); - OutputHelper.WriteLine(" a value parameter."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // The caller may specify an expression of a type that + // is implicitly convertible to the formal parameter type. + // In this case, the params parameter acts precisely like + // a value parameter. Assert.IsTrue(MethodsTestClass169.testMethod()); } [TestMethod] public void Methods172_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass172.testMethod()); } [TestMethod] public void Methods173_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass173.testMethod()); } [TestMethod] public void Methods174_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass174.testMethod()); } [TestMethod] public void Methods175_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass175.testMethod()); } [TestMethod] public void Methods179_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass179.testMethod()); } [TestMethod] public void Methods180_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass180.testMethod()); } [TestMethod] public void Methods181_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass181.testMethod()); } [TestMethod] public void Methods182_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass182.testMethod()); } [TestMethod] public void Methods183_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass183.testMethod()); } [TestMethod] public void Methods184_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter enables a caller to supply values"); - OutputHelper.WriteLine(" in one of two ways."); - OutputHelper.WriteLine(" Alternately, the caller may specify zero or more expressions,"); - OutputHelper.WriteLine(" where the type of each expression is implicitly convertible"); - OutputHelper.WriteLine(" to the element type of the formal parameter type. In this case,"); - OutputHelper.WriteLine(" params parameter is initialized with an array fo the formal"); - OutputHelper.WriteLine(" parameter type that contains the value or values provided by"); - OutputHelper.WriteLine(" the caller."); + // Section 10.5 + // A params parameter enables a caller to supply values + // in one of two ways. + // Alternately, the caller may specify zero or more expressions, + // where the type of each expression is implicitly convertible + // to the element type of the formal parameter type. In this case, + // params parameter is initialized with an array fo the formal + // parameter type that contains the value or values provided by + // the caller. Assert.IsTrue(MethodsTestClass184.testMethod()); } [TestMethod] public void Methods185_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method is permitted to assign new values"); - OutputHelper.WriteLine(" to a params parameter. Such assignments only"); - OutputHelper.WriteLine(" affect the local storage location represented"); - OutputHelper.WriteLine(" by the params parameter."); + // Section 10.5 + // A method is permitted to assign new values + // to a params parameter. Such assignments only + // affect the local storage location represented + // by the params parameter. Assert.IsTrue(MethodsTestClass185.testMethod()); } [TestMethod] public void Methods186_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter can be passed along to another"); - OutputHelper.WriteLine(" params parameter."); + // Section 10.5 + // A params parameter can be passed along to another + // params parameter. Assert.IsTrue(MethodsTestClass186.testMethod()); } [TestMethod] public void Methods187_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A params parameter can be passed along to another"); - OutputHelper.WriteLine(" params parameter."); + // Section 10.5 + // A params parameter can be passed along to another + // params parameter. Assert.IsTrue(MethodsTestClass187.testMethod()); } [TestMethod] public void Methods188_Test() { - OutputHelper.WriteLine("Testing explicit base method call to a child class whose parent implements"); + // Testing explicit base method call to a child class whose parent implements Assert.IsTrue(MethodsTestClass188.testMethod()); } [TestMethod] public void Methods190_Test() { - OutputHelper.WriteLine("Testing implicit base method calls to protected methods in parent class"); + // Testing implicit base method calls to protected methods in parent class Assert.IsTrue(MethodsTestClass190.testMethod()); } [TestMethod] public void Methods191_Test() { - OutputHelper.WriteLine("Testing implicit base method calls to internal methods in parent class"); + // Testing implicit base method calls to internal methods in parent class Assert.IsTrue(MethodsTestClass191.testMethod()); } [TestMethod] public void Methods192_Test() { - OutputHelper.WriteLine("Testing implicit base method calls to protected internal methods in parent class"); + // Testing implicit base method calls to protected internal methods in parent class Assert.IsTrue(MethodsTestClass192.testMethod()); } [TestMethod] public void Methods193_Test() { - OutputHelper.WriteLine("Testing implicit base method calls to private methods in parent class"); + // Testing implicit base method calls to private methods in parent class Assert.IsTrue(MethodsTestClass193.testMethod()); } [TestMethod] public void Methods194_Test() { - OutputHelper.WriteLine("Testing implicit base method calls to public virtual methods in parent class"); + // Testing implicit base method calls to public virtual methods in parent class Assert.IsTrue(MethodsTestClass194.testMethod()); } [TestMethod] public void Methods195_Test() { - OutputHelper.WriteLine("Tests if a new method does not overwrite a virtual method in a base class"); + // Tests if a new method does not overwrite a virtual method in a base class Assert.IsFalse(MethodsTestClass195.testMethod()); - OutputHelper.WriteLine("This failure indicates a test is now passing that previously failed by design."); - OutputHelper.WriteLine("It previously marked as known failure because of bug # 21563"); - OutputHelper.WriteLine("The Test owner needs to verify that the change was intentional and remove the known failure."); + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] public void Methods196_Test() { - OutputHelper.WriteLine("Tests if a new method does overwrite an abstract method in a base class"); + // Tests if a new method does overwrite an abstract method in a base class Assert.IsTrue(MethodsTestClass196.testMethod()); } [TestMethod] public void Methods197_Test() { - OutputHelper.WriteLine("Tests the calling of an empty delegate"); + // Tests the calling of an empty delegate Assert.IsTrue(MethodsTestClass197.testMethod()); } [TestMethod] public void Methods199_Test() { - OutputHelper.WriteLine("Tests if a sealed method overwrites a virtual method in a base class"); + // Tests if a sealed method overwrites a virtual method in a base class Assert.IsTrue(MethodsTestClass199.testMethod()); } [TestMethod] public void Methods200_Test() { - OutputHelper.WriteLine("Tests large number of assignments inside a public method"); + // Tests large number of assignments inside a public method Assert.IsTrue(MethodsTestClass200.testMethod()); } [TestMethod] public void Methods201_Test() { - OutputHelper.WriteLine("Tests large number of assignments inside a public static method"); + // Tests large number of assignments inside a public static method Assert.IsTrue(MethodsTestClass201.testMethod()); } [TestMethod] public void Methods204_Test() { - OutputHelper.WriteLine("Tests a method with explicit, params signature"); + // Tests a method with explicit, params signature Assert.IsTrue(MethodsTestClass204.testMethod()); } [TestMethod] public void Methods205_Test() { - OutputHelper.WriteLine("Tests a method with a mixed explicit and params signature"); + // Tests a method with a mixed explicit and params signature Assert.IsTrue(MethodsTestClass205.testMethod()); } [TestMethod] public void Methods206_Test() { - OutputHelper.WriteLine("Tests method overloading between params and explicit signatures (static)"); + // Tests method overloading between params and explicit signatures (static) Assert.IsTrue(MethodsTestClass206.testMethod()); } [TestMethod] public void Methods207_Test() { - OutputHelper.WriteLine("Tests method overloading between params and explicit signatures"); + // Tests method overloading between params and explicit signatures Assert.IsTrue(MethodsTestClass207.testMethod()); } [TestMethod] public void Methods210_Test() { - OutputHelper.WriteLine(" Section 10.5 If the declaration includes the sealed modifier, then the "); - OutputHelper.WriteLine(" declaration must also include the override modifier."); + // Section 10.5 If the declaration includes the sealed modifier, then the + // declaration must also include the override modifier. Assert.IsTrue(MethodsTestClass210.testMethod()); } [TestMethod] public void Methods223_Test() { - OutputHelper.WriteLine(" Section 10.5 The ref and out parameters are part of a method's signature, but the params modifier is not."); + // Section 10.5 The ref and out parameters are part of a method's signature, but the params modifier is not. Assert.IsTrue(MethodsTestClass223.testMethod()); } [TestMethod] public void Methods224_Test() { - OutputHelper.WriteLine(" Section 10.5 The ref and out parameters are part of a method's signature, but the params modifier is not."); + // Section 10.5 The ref and out parameters are part of a method's signature, but the params modifier is not. Assert.IsTrue(MethodsTestClass224.testMethod()); } [TestMethod] public void Methods229_Test() { - OutputHelper.WriteLine(" error CS0114: 'function1' hides inherited member 'function2'."); - OutputHelper.WriteLine(" To make the current method override that implementation, add "); - OutputHelper.WriteLine(" the override keyword. Otherwise add the new keyword."); + // error CS0114: 'function1' hides inherited member 'function2'. + // To make the current method override that implementation, add + // the override keyword. Otherwise add the new keyword. Assert.IsTrue(MethodsTestClass229.testMethod()); } [TestMethod] public void Methods230_Test() { - OutputHelper.WriteLine(" error CS0114: 'function1' hides inherited member 'function2'."); - OutputHelper.WriteLine(" To make the current method override that implementation, add "); - OutputHelper.WriteLine(" the override keyword. Otherwise add the new keyword."); + // error CS0114: 'function1' hides inherited member 'function2'. + // To make the current method override that implementation, add + // the override keyword. Otherwise add the new keyword. Assert.IsTrue(MethodsTestClass230.testMethod()); } [TestMethod] public void Methods231_Test() { - OutputHelper.WriteLine(" error CS0114: 'function1' hides inherited member 'function2'."); - OutputHelper.WriteLine(" To make the current method override that implementation, add "); - OutputHelper.WriteLine(" the override keyword. Otherwise add the new keyword."); + // error CS0114: 'function1' hides inherited member 'function2'. + // To make the current method override that implementation, add + // the override keyword. Otherwise add the new keyword. Assert.IsTrue(MethodsTestClass231.testMethod()); } [TestMethod] public void Methods232_Test() { - OutputHelper.WriteLine(" error CS0114: 'function1' hides inherited member 'function2'."); - OutputHelper.WriteLine(" To make the current method override that implementation, add "); - OutputHelper.WriteLine(" the override keyword. Otherwise add the new keyword."); + // error CS0114: 'function1' hides inherited member 'function2'. + // To make the current method override that implementation, add + // the override keyword. Otherwise add the new keyword. Assert.IsTrue(MethodsTestClass232.testMethod()); } [TestMethod] public void Methods233_Test() { - OutputHelper.WriteLine(" Section 10.5"); - OutputHelper.WriteLine(" A method-declaration may include set of attributes,"); - OutputHelper.WriteLine(" a new modifier, one of four access modifiers,"); - OutputHelper.WriteLine(" one of the static, virtual, override, or abstract "); - OutputHelper.WriteLine(" modifiers, and an extern modifier."); + // Section 10.5 + // A method-declaration may include set of attributes, + // a new modifier, one of four access modifiers, + // one of the static, virtual, override, or abstract + // modifiers, and an extern modifier. Assert.IsTrue(MethodsTestClass233.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs b/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs index 93e3e106..cb342d1e 100644 --- a/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs @@ -16,280 +16,280 @@ class UnitTestOperatorTests [TestMethod] public void Operators1_Test() { - OutputHelper.WriteLine("Tests overriding unary plus"); + // Tests overriding unary plus Assert.IsTrue(OperatorsTestClass1.testMethod()); } [TestMethod] public void Operators2_Test() { - OutputHelper.WriteLine("Tests overriding unary minus"); + // Tests overriding unary minus Assert.IsTrue(OperatorsTestClass2.testMethod()); } [TestMethod] public void Operators3_Test() { - OutputHelper.WriteLine("Tests overriding tilde"); + // Tests overriding tilde Assert.IsTrue(OperatorsTestClass3.testMethod()); } [TestMethod] public void Operators4_Test() { - OutputHelper.WriteLine("Tests overriding increment prefix"); + // Tests overriding increment prefix Assert.IsTrue(OperatorsTestClass4.testMethod()); } [TestMethod] public void Operators5_Test() { - OutputHelper.WriteLine("Tests overriding increment suffix"); + // Tests overriding increment suffix Assert.IsTrue(OperatorsTestClass5.testMethod()); } [TestMethod] public void Operators6_Test() { - OutputHelper.WriteLine("Tests overriding decrement prefix"); + // Tests overriding decrement prefix Assert.IsTrue(OperatorsTestClass6.testMethod()); } [TestMethod] public void Operators7_Test() { - OutputHelper.WriteLine("Tests overriding decrement suffix"); + // Tests overriding decrement suffix Assert.IsTrue(OperatorsTestClass7.testMethod()); } [TestMethod] public void Operators13_Test() { - OutputHelper.WriteLine("Tests overriding binary plus"); + // Tests overriding binary plus Assert.IsTrue(OperatorsTestClass13.testMethod()); } [TestMethod] public void Operators14_Test() { - OutputHelper.WriteLine("Tests overriding binary minus"); + // Tests overriding binary minus Assert.IsTrue(OperatorsTestClass14.testMethod()); } [TestMethod] public void Operators15_Test() { - OutputHelper.WriteLine("Tests overriding asterisk (multiply)"); + // Tests overriding asterisk (multiply) Assert.IsTrue(OperatorsTestClass15.testMethod()); } [TestMethod] public void Operators16_Test() { - OutputHelper.WriteLine("Tests overriding slash (division)"); + // Tests overriding slash (division) Assert.IsTrue(OperatorsTestClass16.testMethod()); } [TestMethod] public void Operators17_Test() { - OutputHelper.WriteLine("Tests overriding percent (modulus)"); + // Tests overriding percent (modulus) Assert.IsTrue(OperatorsTestClass17.testMethod()); } [TestMethod] public void Operators18_Test() { - OutputHelper.WriteLine("Tests overriding caret (xor)"); + // Tests overriding caret (xor) Assert.IsTrue(OperatorsTestClass18.testMethod()); } [TestMethod] public void Operators19_Test() { - OutputHelper.WriteLine("Tests overriding ampersand"); + // Tests overriding ampersand Assert.IsTrue(OperatorsTestClass19.testMethod()); } [TestMethod] public void Operators20_Test() { - OutputHelper.WriteLine("Tests overriding pipe (or)"); + // Tests overriding pipe (or) Assert.IsTrue(OperatorsTestClass20.testMethod()); } [TestMethod] public void Operators21_Test() { - OutputHelper.WriteLine("Tests overriding double less-than (left shift)"); + // Tests overriding double less-than (left shift) Assert.IsTrue(OperatorsTestClass21.testMethod()); } [TestMethod] public void Operators22_Test() { - OutputHelper.WriteLine("Tests overriding double greater-than (right shift)"); + // Tests overriding double greater-than (right shift) Assert.IsTrue(OperatorsTestClass22.testMethod()); } [TestMethod] public void Operators23_Test() { - OutputHelper.WriteLine("Tests overriding binary plus with 1 int parameter"); + // Tests overriding binary plus with 1 int parameter Assert.IsTrue(OperatorsTestClass23.testMethod()); } [TestMethod] public void Operators24_Test() { - OutputHelper.WriteLine("Tests overriding double equals (equality comparison) and exclamation-equals (non-equality comparison)"); + // Tests overriding double equals (equality comparison) and exclamation-equals (non-equality comparison) Assert.IsTrue(OperatorsTestClass24.testMethod()); } [TestMethod] public void Operators38_Test() { - OutputHelper.WriteLine("Tests overriding binary plus with 1 int parameter"); + // Tests overriding binary plus with 1 int parameter Assert.IsTrue(OperatorsTestClass38.testMethod()); } [TestMethod] public void Operators39_Test() { - OutputHelper.WriteLine("Tests overriding binary minus with 1 int parameter"); + // Tests overriding binary minus with 1 int parameter Assert.IsTrue(OperatorsTestClass39.testMethod()); } [TestMethod] public void Operators40_Test() { - OutputHelper.WriteLine("Tests overriding asterisk (multiply) with 1 int parameter"); + // Tests overriding asterisk (multiply) with 1 int parameter Assert.IsTrue(OperatorsTestClass40.testMethod()); } [TestMethod] public void Operators41_Test() { - OutputHelper.WriteLine("Tests overriding slash (divide) with 1 int parameter"); + // Tests overriding slash (divide) with 1 int parameter Assert.IsTrue(OperatorsTestClass41.testMethod()); } [TestMethod] public void Operators42_Test() { - OutputHelper.WriteLine("Tests overriding percent (modulus) with 1 int parameter"); + // Tests overriding percent (modulus) with 1 int parameter Assert.IsTrue(OperatorsTestClass42.testMethod()); } [TestMethod] public void Operators43_Test() { - OutputHelper.WriteLine("Tests overriding caret (xor) with 1 int parameter"); + // Tests overriding caret (xor) with 1 int parameter Assert.IsTrue(OperatorsTestClass43.testMethod()); } [TestMethod] public void Operators44_Test() { - OutputHelper.WriteLine("Tests overriding ampersand with 1 int parameter"); + // Tests overriding ampersand with 1 int parameter Assert.IsTrue(OperatorsTestClass44.testMethod()); } [TestMethod] public void Operators45_Test() { - OutputHelper.WriteLine("Tests overriding pipe (or) with 1 int parameter"); + // Tests overriding pipe (or) with 1 int parameter Assert.IsTrue(OperatorsTestClass45.testMethod()); } [TestMethod] public void Operators46_Test() { - OutputHelper.WriteLine("Tests overriding double equals (equality comparison) and exclamation-equals "); - OutputHelper.WriteLine("(non-equality comparison) with 1 int"); + // Tests overriding double equals (equality comparison) and exclamation-equals + // (non-equality comparison) with 1 int Assert.IsTrue(OperatorsTestClass46.testMethod()); } [TestMethod] public void Operators67_Test() { - OutputHelper.WriteLine("Tests overriding unary exclamation (not)"); + // Tests overriding unary exclamation (not) Assert.IsTrue(OperatorsTestClass67.testMethod()); } [TestMethod] public void Operators68_Test() { - OutputHelper.WriteLine("Tests overriding true and false"); + // Tests overriding true and false Assert.IsTrue(OperatorsTestClass68.testMethod()); } [TestMethod] public void Operators69_Test() { - OutputHelper.WriteLine("Tests overriding true and false and ampersand"); + // Tests overriding true and false and ampersand Assert.IsTrue(OperatorsTestClass69.testMethod()); } [TestMethod] public void Operators88_Test() { - OutputHelper.WriteLine("Tests true and false with ampersand"); + // Tests true and false with ampersand Assert.IsTrue(OperatorsTestClass88.testMethod()); } [TestMethod] public void Operators89_Test() { - OutputHelper.WriteLine("Tests true and false with double ampersand"); + // Tests true and false with double ampersand Assert.IsTrue(OperatorsTestClass89.testMethod()); } [TestMethod] public void Operators90_Test() { - OutputHelper.WriteLine("Tests true and false with pipe (or)"); + // Tests true and false with pipe (or) Assert.IsTrue(OperatorsTestClass90.testMethod()); } [TestMethod] public void Operators91_Test() { - OutputHelper.WriteLine("Tests true and false with double pipe (or)"); + // Tests true and false with double pipe (or) Assert.IsTrue(OperatorsTestClass91.testMethod()); } [TestMethod] public void Operators92_Test() { - OutputHelper.WriteLine("Tests true and false with caret (xor)"); + // Tests true and false with caret (xor) Assert.IsTrue(OperatorsTestClass92.testMethod()); } [TestMethod] public void Operators93_Test() { - OutputHelper.WriteLine("Tests numerical types with plus"); + // Tests numerical types with plus Assert.IsTrue(OperatorsTestClass93.testMethod()); } [TestMethod] public void Operators94_Test() { - OutputHelper.WriteLine("Tests numerical types with minus"); + // Tests numerical types with minus Assert.IsTrue(OperatorsTestClass94.testMethod()); } [TestMethod] public void Operators95_Test() { - OutputHelper.WriteLine("Tests numerical types with asterisk (multiply)"); + // Tests numerical types with asterisk (multiply) Assert.IsTrue(OperatorsTestClass95.testMethod()); } [TestMethod] public void Operators96_Test() { - OutputHelper.WriteLine("Tests numerical types with slash (divide)"); + // Tests numerical types with slash (divide) Assert.IsTrue(OperatorsTestClass96.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs b/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs index 1fcdd2f4..82b51aac 100644 --- a/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs @@ -16,446 +16,446 @@ class UnitTestPropertiesTests [TestMethod] public void Properties003_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass003.testMethod()); } [TestMethod] public void Properties004_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass004.testMethod()); } [TestMethod] public void Properties005_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass005.testMethod()); } [TestMethod] public void Properties006_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass006.testMethod()); } [TestMethod] public void Properties007_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass007.testMethod()); } [TestMethod] public void Properties008_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass008.testMethod()); } [TestMethod] public void Properties009_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass009.testMethod()); } [TestMethod] public void Properties010_Test() { - OutputHelper.WriteLine("Section 10.6"); - OutputHelper.WriteLine("A property declaration may include set of"); - OutputHelper.WriteLine("attributes, a new modifier, a valid combination"); - OutputHelper.WriteLine("nof the four access modifiers, and a static modifier."); + // Section 10.6 + // A property declaration may include set of + // attributes, a new modifier, a valid combination + // nof the four access modifiers, and a static modifier. Assert.IsTrue(PropertiesTestClass010.testMethod()); } [TestMethod] public void Properties011_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("The type of a property declaration specifies"); - OutputHelper.WriteLine("the type of the property introduced by the"); - OutputHelper.WriteLine("declaration, and the member-name specifies"); - OutputHelper.WriteLine("the name of the property. Unless the property"); - OutputHelper.WriteLine("is an explicit interface member implementation,"); - OutputHelper.WriteLine("the member name is simply an identifier. For an"); - OutputHelper.WriteLine("explicit interface member implementation, the"); - OutputHelper.WriteLine("member name consists of an interface-type followed"); - OutputHelper.WriteLine("by a . and an identifier."); - OutputHelper.WriteLine("This is currently an expected fail, but is resolved in 3.0 see Bug 16341 for details"); + // Section 10.6 + // The type of a property declaration specifies + // the type of the property introduced by the + // declaration, and the member-name specifies + // the name of the property. Unless the property + // is an explicit interface member implementation, + // the member name is simply an identifier. For an + // explicit interface member implementation, the + // member name consists of an interface-type followed + // by a . and an identifier. + // This is currently an expected fail, but is resolved in 3.0 see Bug 16341 for details Assert.IsTrue(PropertiesTestClass011.testMethod()); } [TestMethod] public void Properties024_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("An instance property is associated with"); - OutputHelper.WriteLine("a given instance of a class, and this instance"); - OutputHelper.WriteLine("can be accessed as this in the accessors of"); - OutputHelper.WriteLine("the property."); + // Section 10.6 + // An instance property is associated with + // a given instance of a class, and this instance + // can be accessed as this in the accessors of + // the property. Assert.IsTrue(PropertiesTestClass024.testMethod()); } [TestMethod] public void Properties025_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("An instance property is associated with"); - OutputHelper.WriteLine("a given instance of a class, and this instance"); - OutputHelper.WriteLine("can be accessed as this in the accessors of"); - OutputHelper.WriteLine("the property."); + // Section 10.6 + // An instance property is associated with + // a given instance of a class, and this instance + // can be accessed as this in the accessors of + // the property. Assert.IsTrue(PropertiesTestClass025.testMethod()); } [TestMethod] public void Properties026_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("When a property is referenced in a member-access"); - OutputHelper.WriteLine("of the form E.M, if M is a static property, E must"); - OutputHelper.WriteLine("denote a type, and if M is an instance property,"); - OutputHelper.WriteLine("E must denote an instance."); + // Section 10.6 + // When a property is referenced in a member-access + // of the form E.M, if M is a static property, E must + // denote a type, and if M is an instance property, + // E must denote an instance. Assert.IsTrue(PropertiesTestClass026.testMethod()); } [TestMethod] public void Properties027_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("When a property is referenced in a member-access"); - OutputHelper.WriteLine("of the form E.M, if M is a static property, E must"); - OutputHelper.WriteLine("denote a type, and if M is an instance property,"); - OutputHelper.WriteLine("E must denote an instance."); + // Section 10.6 + // When a property is referenced in a member-access + // of the form E.M, if M is a static property, E must + // denote a type, and if M is an instance property, + // E must denote an instance. Assert.IsTrue(PropertiesTestClass027.testMethod()); } [TestMethod] public void Properties033_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("The accessor declarations consist of a "); - OutputHelper.WriteLine("get-accessor-declaration, a set-accessor"); - OutputHelper.WriteLine("declaration, or both."); + // Section 10.6 + // The accessor declarations consist of a + // get-accessor-declaration, a set-accessor + // declaration, or both. Assert.IsTrue(PropertiesTestClass033.testMethod()); } [TestMethod] public void Properties034_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("The accessor declarations consist of a "); - OutputHelper.WriteLine("get-accessor-declaration, a set-accessor"); - OutputHelper.WriteLine("declaration, or both."); + // Section 10.6 + // The accessor declarations consist of a + // get-accessor-declaration, a set-accessor + // declaration, or both. Assert.IsTrue(PropertiesTestClass034.testMethod()); } [TestMethod] public void Properties035_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("The accessor declarations consist of a "); - OutputHelper.WriteLine("get-accessor-declaration, a set-accessor"); - OutputHelper.WriteLine("declaration, or both."); + // Section 10.6 + // The accessor declarations consist of a + // get-accessor-declaration, a set-accessor + // declaration, or both. Assert.IsTrue(PropertiesTestClass035.testMethod()); } [TestMethod] public void Properties036_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass036.testMethod()); } [TestMethod] public void Properties037_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass037.testMethod()); } [TestMethod] public void Properties038_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass038.testMethod()); } [TestMethod] public void Properties043_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass043.testMethod()); } [TestMethod] public void Properties046_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass046.testMethod()); } [TestMethod] public void Properties048_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass048.testMethod()); } [TestMethod] public void Properties050_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass050.testMethod()); } [TestMethod] public void Properties053_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass053.testMethod()); } [TestMethod] public void Properties054_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass054.testMethod()); } [TestMethod] public void Properties056_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass056.testMethod()); } [TestMethod] public void Properties058_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass058.testMethod()); } [TestMethod] public void Properties059_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass059.testMethod()); } [TestMethod] public void Properties060_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass060.testMethod()); } [TestMethod] public void Properties062_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass062.testMethod()); } [TestMethod] public void Properties068_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass068.testMethod()); } [TestMethod] public void Properties071_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass071.testMethod()); } [TestMethod] public void Properties072_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass072.testMethod()); } [TestMethod] public void Properties073_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass073.testMethod()); } [TestMethod] public void Properties074_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass074.testMethod()); } [TestMethod] public void Properties075_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass075.testMethod()); } [TestMethod] public void Properties078_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass078.testMethod()); } [TestMethod] public void Properties089_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass089.testMethod()); } [TestMethod] public void Properties090_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass090.testMethod()); } [TestMethod] public void Properties097_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass097.testMethod()); } [TestMethod] public void Properties109_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass109.testMethod()); } [TestMethod] public void Properties110_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass110.testMethod()); } [TestMethod] public void Properties121_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass121.testMethod()); } [TestMethod] public void Properties122_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass122.testMethod()); } [TestMethod] public void Properties123_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); - OutputHelper.WriteLine("This test is an expected fail"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor + // This test is an expected fail Assert.IsFalse(PropertiesTestClass123.testMethod()); } [TestMethod] public void Properties124_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); - OutputHelper.WriteLine("This test is an expected fail"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor + // This test is an expected fail Assert.IsFalse(PropertiesTestClass124.testMethod()); } [TestMethod] public void Properties125_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass125.testMethod()); } [TestMethod] public void Properties126_Test() { - OutputHelper.WriteLine("Section 10.6 "); - OutputHelper.WriteLine("Each accessor declaration consists of an"); - OutputHelper.WriteLine("optional accessor-modifier, followed by the"); - OutputHelper.WriteLine("keyword get or set, followed by an accessor"); + // Section 10.6 + // Each accessor declaration consists of an + // optional accessor-modifier, followed by the + // keyword get or set, followed by an accessor Assert.IsTrue(PropertiesTestClass126.testMethod()); } diff --git a/Tests/NFUnitTestClasses/UnitTestStaticTests.cs b/Tests/NFUnitTestClasses/UnitTestStaticTests.cs index 41702ea0..80617079 100644 --- a/Tests/NFUnitTestClasses/UnitTestStaticTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestStaticTests.cs @@ -16,99 +16,99 @@ class UnitTestStaticTests [TestMethod] public void Static_Inst01_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" When a static member is referenced in a member-access"); - OutputHelper.WriteLine(" of the form E.M, E must denote a type. It is an error for"); - OutputHelper.WriteLine(" E to denote an instance."); + // Section 10.2 + // When a static member is referenced in a member-access + // of the form E.M, E must denote a type. It is an error for + // E to denote an instance. Assert.IsTrue(Static_InstTestClass01.testMethod()); } [TestMethod] public void Static_Inst07_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" A static field identifies exactly one storage location."); - OutputHelper.WriteLine(" No matter how many instances of a class are created,"); - OutputHelper.WriteLine(" there is only ever one copy of a static field."); + // Section 10.2 + // A static field identifies exactly one storage location. + // No matter how many instances of a class are created, + // there is only ever one copy of a static field. Assert.IsTrue(Static_InstTestClass07.testMethod()); } [TestMethod] public void Static_Inst14_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" When an instance member is referenced in a member-access"); - OutputHelper.WriteLine(" of the form E.M, E must denote an instance. It is an error "); - OutputHelper.WriteLine(" for E to denote a type."); + // Section 10.2 + // When an instance member is referenced in a member-access + // of the form E.M, E must denote an instance. It is an error + // for E to denote a type. Assert.IsTrue(Static_InstTestClass14.testMethod()); } [TestMethod] public void Static_Inst18_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" Every instance of a class contains a separate copy "); - OutputHelper.WriteLine(" of all instance fields of the class."); + // Section 10.2 + // Every instance of a class contains a separate copy + // of all instance fields of the class. Assert.IsTrue(Static_InstTestClass18.testMethod()); } [TestMethod] public void Static_Inst19_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" An instance function member (method, property "); - OutputHelper.WriteLine(" accessor, indexer accessor, constructor, or "); - OutputHelper.WriteLine(" destructor) operates on a given instance of "); - OutputHelper.WriteLine(" the class, and this instance can be accessed as"); - OutputHelper.WriteLine(" this."); + // Section 10.2 + // An instance function member (method, property + // accessor, indexer accessor, constructor, or + // destructor) operates on a given instance of + // the class, and this instance can be accessed as + // this. Assert.IsTrue(Static_InstTestClass19.testMethod()); } [TestMethod] public void Static_Inst20_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" An instance function member (method, property "); - OutputHelper.WriteLine(" accessor, indexer accessor, constructor, or "); - OutputHelper.WriteLine(" destructor) operates on a given instance of "); - OutputHelper.WriteLine(" the class, and this instance can be accessed as"); - OutputHelper.WriteLine(" this."); + // Section 10.2 + // An instance function member (method, property + // accessor, indexer accessor, constructor, or + // destructor) operates on a given instance of + // the class, and this instance can be accessed as + // this. Assert.IsTrue(Static_InstTestClass20.testMethod()); } [TestMethod] public void Static_Inst21_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" An instance function member (method, property "); - OutputHelper.WriteLine(" accessor, indexer accessor, constructor, or "); - OutputHelper.WriteLine(" destructor) operates on a given instance of "); - OutputHelper.WriteLine(" the class, and this instance can be accessed as"); - OutputHelper.WriteLine(" this."); + // Section 10.2 + // An instance function member (method, property + // accessor, indexer accessor, constructor, or + // destructor) operates on a given instance of + // the class, and this instance can be accessed as + // this. Assert.IsTrue(Static_InstTestClass21.testMethod()); } [TestMethod] public void Static_Inst22_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" An instance function member (method, property "); - OutputHelper.WriteLine(" accessor, indexer accessor, constructor, or "); - OutputHelper.WriteLine(" destructor) operates on a given instance of "); - OutputHelper.WriteLine(" the class, and this instance can be accessed as"); - OutputHelper.WriteLine(" this."); + // Section 10.2 + // An instance function member (method, property + // accessor, indexer accessor, constructor, or + // destructor) operates on a given instance of + // the class, and this instance can be accessed as + // this. Assert.IsTrue(Static_InstTestClass22.testMethod()); } [TestMethod] public void Static_Inst23_Test() { - OutputHelper.WriteLine(" Section 10.2 "); - OutputHelper.WriteLine(" An instance function member (method, property "); - OutputHelper.WriteLine(" accessor, indexer accessor, constructor, or "); - OutputHelper.WriteLine(" destructor) operates on a given instance of "); - OutputHelper.WriteLine(" the class, and this instance can be accessed as"); - OutputHelper.WriteLine(" this."); + // Section 10.2 + // An instance function member (method, property + // accessor, indexer accessor, constructor, or + // destructor) operates on a given instance of + // the class, and this instance can be accessed as + // this. Assert.IsTrue(Static_InstTestClass23.testMethod()); } diff --git a/Tests/NFUnitTestConversions/UnitTestExprefTests.cs b/Tests/NFUnitTestConversions/UnitTestExprefTests.cs index 2400dcb3..8102410f 100644 --- a/Tests/NFUnitTestConversions/UnitTestExprefTests.cs +++ b/Tests/NFUnitTestConversions/UnitTestExprefTests.cs @@ -16,7 +16,7 @@ class UnitTestExprefTests [TestMethod] public void Expref_obj_ref_Test() { - OutputHelper.WriteLine(" Converting from 'object' to a reference object. "); + // Converting from 'object' to a reference object. Assert.IsTrue(ExprefTestClass_obj_ref.testMethod()); } @@ -24,7 +24,7 @@ public void Expref_obj_ref_Test() public void Expref_obj_ref_exc_Test() { - OutputHelper.WriteLine(" Converting from 'object' to a reference object. "); + // Converting from 'object' to a reference object. Assert.IsTrue(ExprefTestClass_obj_ref_exc.testMethod()); } @@ -32,7 +32,7 @@ public void Expref_obj_ref_exc_Test() public void Expref_class_class_Test() { - OutputHelper.WriteLine(" Tests that you can convert from a base class to a derived class"); + // Tests that you can convert from a base class to a derived class Assert.IsTrue(ExprefTestClass_class_class.testMethod()); } @@ -40,7 +40,7 @@ public void Expref_class_class_Test() public void Expref_class_class_exc_Test() { - OutputHelper.WriteLine(" Tests that you can convert from a base class to a derived class"); + // Tests that you can convert from a base class to a derived class Assert.IsTrue(ExprefTestClass_class_class_exc.testMethod()); } @@ -48,44 +48,44 @@ public void Expref_class_class_exc_Test() public void Expref_inter_struct_exc_Test() { - OutputHelper.WriteLine(" Tests that you can convert from an interface to a struct that implements it."); + // Tests that you can convert from an interface to a struct that implements it. Assert.IsTrue(ExprefTestClass_inter_struct_exc.testMethod()); } [TestMethod] public void Expref_class_inter_Test() { - OutputHelper.WriteLine(" Tests converting from a class to an interface that the class does not implement (but a derived class might)."); + // Tests converting from a class to an interface that the class does not implement (but a derived class might). Assert.IsTrue(ExprefTestClass_class_inter.testMethod()); } [TestMethod] public void Expref_class_inter_exc_Test() { - OutputHelper.WriteLine(" Tests converting from a class to an interface that the class does not implement (but a derived class might)."); + // Tests converting from a class to an interface that the class does not implement (but a derived class might). Assert.IsTrue(ExprefTestClass_class_inter_exc.testMethod()); } [TestMethod] public void Expref_inter_class_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); - OutputHelper.WriteLine("From any interface-type S to any class-type T, provided T is not sealed, or provided T implements S."); - OutputHelper.WriteLine("If T implements S:"); + // Tests converting from an interface to a class + // From any interface-type S to any class-type T, provided T is not sealed, or provided T implements S. + // If T implements S: Assert.IsTrue(ExprefTestClass_inter_class.testMethod()); } [TestMethod] public void Expref_inter_class2_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); + // Tests converting from an interface to a class Assert.IsTrue(ExprefTestClass_inter_class2.testMethod()); } [TestMethod] public void Expref_inter_class2_exc1_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); + // Tests converting from an interface to a class Assert.IsTrue(ExprefTestClass_inter_class2_exc1.testMethod()); } @@ -93,7 +93,7 @@ public void Expref_inter_class2_exc1_Test() public void Expref_inter_class2_exc2_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); + // Tests converting from an interface to a class Assert.IsTrue(ExprefTestClass_inter_class2_exc2.testMethod()); } @@ -101,98 +101,98 @@ public void Expref_inter_class2_exc2_Test() public void Expref_inter_class_exc_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); + // Tests converting from an interface to a class Assert.IsTrue(ExprefTestClass_inter_class_exc.testMethod()); } [TestMethod] public void Expref_inter_class_sealed_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); + // Tests converting from an interface to a class Assert.IsTrue(ExprefTestClass_inter_class_sealed.testMethod()); } [TestMethod] public void Expref_inter_class_sealed_exc_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to a class"); + // Tests converting from an interface to a class Assert.IsTrue(ExprefTestClass_inter_class_sealed_exc.testMethod()); } [TestMethod] public void Expref_inter_inter_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to an interface"); + // Tests converting from an interface to an interface Assert.IsTrue(ExprefTestClass_inter_inter.testMethod()); } [TestMethod] public void Expref_inter_inter_exc_Test() { - OutputHelper.WriteLine(" Tests converting from an interface to an interface"); + // Tests converting from an interface to an interface Assert.IsTrue(ExprefTestClass_inter_inter_exc.testMethod()); } [TestMethod] public void Impenum_zero_Test() { - OutputHelper.WriteLine("Tests whether 0 can be converted to various enum types..."); + // Tests whether 0 can be converted to various enum types... Assert.IsTrue(ImpenumTestClass_zero.testMethod()); } [TestMethod] public void Impref_ref_obj_Test() { - OutputHelper.WriteLine(" Converting from a reference object to 'object'"); + // Converting from a reference object to 'object' Assert.IsTrue(ImprefTestClass_ref_obj.testMethod()); } [TestMethod] public void Impref_class_class_Test() { - OutputHelper.WriteLine(" Tests that you can convert from a class to a base class. "); + // Tests that you can convert from a class to a base class. Assert.IsTrue(ImprefTestClass_class_class.testMethod()); } [TestMethod] public void Impref_class_inter_Test() { - OutputHelper.WriteLine(" Tests that you can convert from a class to an interface that it implements. "); + // Tests that you can convert from a class to an interface that it implements. Assert.IsTrue(ImprefTestClass_class_inter.testMethod()); } [TestMethod] public void Impref_struct_inter_Test() { - OutputHelper.WriteLine(" Tests that you can convert from a struct to an interface that it implements. "); + // Tests that you can convert from a struct to an interface that it implements. Assert.IsTrue(ImprefTestClass_struct_inter.testMethod()); } [TestMethod] public void Impref_array_array_Test() { - OutputHelper.WriteLine(" Tests that you can convert from an array of one class to an array of another class..."); + // Tests that you can convert from an array of one class to an array of another class... Assert.IsTrue(ImprefTestClass_array_array.testMethod()); } [TestMethod] public void Impref_array_cloneable_Test() { - OutputHelper.WriteLine(" Tests that you can convert from an array to System.ICloneable;"); + // Tests that you can convert from an array to System.ICloneable; Assert.IsTrue(ImprefTestClass_array_cloneable.testMethod()); } [TestMethod] public void Impref_null_ref_Test() { - OutputHelper.WriteLine(" Tests that you can convert from null to several reference types"); + // Tests that you can convert from null to several reference types Assert.IsTrue(ImprefTestClass_null_ref.testMethod()); } [TestMethod] public void Impref_delegate_to_SystemDotDelegate_Test() { - OutputHelper.WriteLine(" Tests that you can convert from a delegate type to System.Delegate"); + // Tests that you can convert from a delegate type to System.Delegate Assert.IsTrue(ImprefTestClass_delegate_to_SystemDotDelegate.testMethod()); } diff --git a/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs b/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs index 64eb9a11..a4591558 100644 --- a/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs +++ b/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs @@ -16,179 +16,179 @@ public class UnitTestDelegatesTests [TestMethod] public void Delegate_delegate01_Test() { - OutputHelper.WriteLine(" Verify that both static and instance methods can be called from delegates."); + // Verify that both static and instance methods can be called from delegates. Assert.IsTrue(Delegate_TestClass_delegate01.testMethod()); } [TestMethod] public void Delegate_delegate02_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate02.testMethod()); } [TestMethod] public void Delegate_delegate03_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate03.testMethod()); } [TestMethod] public void Delegate_delegate04_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator."); + // Verify that delegate can be assigned by ternary operator. Assert.IsTrue(Delegate_TestClass_delegate04.testMethod()); } [TestMethod] public void Delegate_delegate05_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator."); + // Verify that delegate can be assigned by ternary operator. Assert.IsTrue(Delegate_TestClass_delegate05.testMethod()); } [TestMethod] public void Delegate_delegate06_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator. Assign null instead of usable value."); + // Verify that delegate can be assigned by ternary operator. Assign null instead of usable value. Assert.IsTrue(Delegate_TestClass_delegate06.testMethod()); } [TestMethod] public void Delegate_delegate07_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator. Use null instead of a usable value."); + // Verify that delegate can be assigned by ternary operator. Use null instead of a usable value. Assert.IsTrue(Delegate_TestClass_delegate07.testMethod()); } [TestMethod] public void Delegate_delegate08_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator. Assign null instead of usable value."); + // Verify that delegate can be assigned by ternary operator. Assign null instead of usable value. Assert.IsTrue(Delegate_TestClass_delegate08.testMethod()); } [TestMethod] public void Delegate_delegate09_Test() { - OutputHelper.WriteLine(" Verify that delegates can be compared for equality."); + // Verify that delegates can be compared for equality. Assert.IsTrue(Delegate_TestClass_delegate09.testMethod()); } [TestMethod] public void Delegate_delegate10_Test() { - OutputHelper.WriteLine(" Verify that delegates can be aggregated in arrays and compared for equality."); + // Verify that delegates can be aggregated in arrays and compared for equality. Assert.IsTrue(Delegate_TestClass_delegate10.testMethod()); } [TestMethod] public void Delegate_delegate11_Test() { - OutputHelper.WriteLine(" Verify that delegates can be members of classes."); + // Verify that delegates can be members of classes. Assert.IsTrue(Delegate_TestClass_delegate11.testMethod()); } [TestMethod] public void Delegate_delegate12_Test() { - OutputHelper.WriteLine(" Verify that both static and instance methods can be called from delegates."); + // Verify that both static and instance methods can be called from delegates. Assert.IsTrue(Delegate_TestClass_delegate12.testMethod()); } [TestMethod] public void Delegate_delegate13_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate13.testMethod()); } [TestMethod] public void Delegate_delegate14_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate14.testMethod()); } [TestMethod] public void Delegate_delegate14a_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate14a.testMethod()); } [TestMethod] public void Delegate_delegate14b_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate14b.testMethod()); } [TestMethod] public void Delegate_delegate14c_Test() { - OutputHelper.WriteLine(" Verify that delegate can be initialized to null."); + // Verify that delegate can be initialized to null. Assert.IsTrue(Delegate_TestClass_delegate14c.testMethod()); } [TestMethod] public void Delegate_delegate15_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator."); + // Verify that delegate can be assigned by ternary operator. Assert.IsTrue(Delegate_TestClass_delegate15.testMethod()); } [TestMethod] public void Delegate_delegate16_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator."); + // Verify that delegate can be assigned by ternary operator. Assert.IsTrue(Delegate_TestClass_delegate16.testMethod()); } [TestMethod] public void Delegate_delegate17_Test() { - OutputHelper.WriteLine(" Verify that delegate can be assigned by ternary operator. Assign null instead of usable value."); + // Verify that delegate can be assigned by ternary operator. Assign null instead of usable value. Assert.IsTrue(Delegate_TestClass_delegate17.testMethod()); } [TestMethod] public void Delegate_delegate18_Test() { - OutputHelper.WriteLine(" Make sure a delegate list filled with nulls is detectable as foo == null"); + // Make sure a delegate list filled with nulls is detectable as foo == null Assert.IsTrue(Delegate_TestClass_delegate18.testMethod()); } [TestMethod] public void Delegate_delegate19_Test() { - OutputHelper.WriteLine(" Verify that delegates can be aggregated in arrays and compared for equality."); + // Verify that delegates can be aggregated in arrays and compared for equality. Assert.IsTrue(Delegate_TestClass_delegate19.testMethod()); } [TestMethod] public void Delegate_delegate20_Test() { - OutputHelper.WriteLine(" Verify that delegates can be compared for equality."); + // Verify that delegates can be compared for equality. Assert.IsTrue(Delegate_TestClass_delegate20.testMethod()); } [TestMethod] public void Delegate_delegate21_Test() { - OutputHelper.WriteLine(" Verify that delegates can be aggregated in arrays and compared for equality."); + // Verify that delegates can be aggregated in arrays and compared for equality. Assert.IsTrue(Delegate_TestClass_delegate21.testMethod()); } [TestMethod] public void Delegate_delegate23_Test() { - OutputHelper.WriteLine(" Verify that delegates can be aggregated using the + operator;"); + // Verify that delegates can be aggregated using the + operator; Assert.IsTrue(Delegate_TestClass_delegate23.testMethod()); } [TestMethod] public void Delegate_delegate24_Test() { - OutputHelper.WriteLine(" Verify that delegates can be aggregated using the + operator;"); + // Verify that delegates can be aggregated using the + operator; Assert.IsTrue(Delegate_TestClass_delegate24.testMethod()); } [TestMethod] public void Delegate_delegate25_Test() { - OutputHelper.WriteLine(" Verify that delegates can be removed using the - operator;"); + // Verify that delegates can be removed using the - operator; Assert.IsTrue(Delegate_TestClass_delegate25.testMethod()); } [TestMethod] public void Delegate_delegate26_Test() { - OutputHelper.WriteLine("Bug 214780 - async delegates to methods with out parameters don't work"); - OutputHelper.WriteLine("This test is expected to fail."); + // Bug 214780 - async delegates to methods with out parameters don't work + // This test is expected to fail. Assert.IsFalse(Delegate_TestClass_delegate26.testMethod()); } /* This test is skipped because it causes a Metadat processor error, it fails in the baseline. [TestMethod] public void Delegate_delegate28_Test() { - OutputHelper.WriteLine("Verify Delegate with 257 args. This is because more than 257 causes the"); - OutputHelper.WriteLine("compiler to take a different code path."); + // Verify Delegate with 257 args. This is because more than 257 causes the + // compiler to take a different code path. Assert.IsTrue(Delegate_TestClass_delegate28.testMethod()) { return MFTestResults.Pass; @@ -199,13 +199,13 @@ public void Delegate_delegate28_Test() [TestMethod] public void Delegate_delegate30_Test() { - OutputHelper.WriteLine(" Verify that both static and instance struct methods can be called from delegates."); + // Verify that both static and instance struct methods can be called from delegates. Assert.IsTrue(Delegate_TestClass_delegate30.testMethod()); } [TestMethod] public void Delegate_delegate31_Test() { - OutputHelper.WriteLine(" Verify that virtual struct methods can be called from delegates."); + // Verify that virtual struct methods can be called from delegates. Assert.IsTrue(Delegate_TestClass_delegate31.testMethod()); } /*These are skipped due to their use of Volatile variables which are not supported @@ -213,7 +213,7 @@ public void Delegate_delegate31_Test() [TestMethod] public void Delegate_delegate32_Test() { - OutputHelper.WriteLine("Delegate Invocation using BeginInvoke"); + // Delegate Invocation using BeginInvoke Assert.IsTrue(Delegate_TestClass_delegate32.testMethod()) { return MFTestResults.Pass; @@ -223,7 +223,7 @@ public void Delegate_delegate32_Test() [TestMethod] public void Delegate_delegate34_Test() { - OutputHelper.WriteLine("Delegate Invocation using BeginInvoke"); + // Delegate Invocation using BeginInvoke Assert.IsTrue(Delegate_TestClass_delegate34.testMethod()) { return MFTestResults.Pass; @@ -234,31 +234,31 @@ public void Delegate_delegate34_Test() [TestMethod] public void Delegate_delegate36_Test() { - OutputHelper.WriteLine("params modifier should not be considered when matching a delegate with a method"); + // params modifier should not be considered when matching a delegate with a method Assert.IsTrue(Delegate_TestClass_delegate36.testMethod()); } [TestMethod] public void Delegate_delegate60_Test() { - OutputHelper.WriteLine("A delegate declaration defines a class that derives from System.Delegate"); + // A delegate declaration defines a class that derives from System.Delegate Assert.IsTrue(Delegate_TestClass_delegate60.testMethod()); } [TestMethod] public void Delegate_delegate62_Test() { - OutputHelper.WriteLine("The compiler is expected to warn that the new keyword id not rquired as we're not hiding an inherited member"); + // The compiler is expected to warn that the new keyword id not rquired as we're not hiding an inherited member Assert.IsTrue(Delegate_TestClass_delegate62.testMethod()); } [TestMethod] public void Delegate_delegate64_Test() { - OutputHelper.WriteLine("Compiler is expected to warn when new is not used when hiding a member delegate of the base class"); + // Compiler is expected to warn when new is not used when hiding a member delegate of the base class Assert.IsTrue(Delegate_TestClass_delegate64.testMethod()); } [TestMethod] public void Delegate_delegate65_Test() { - OutputHelper.WriteLine("Make sure delegates can be hidden."); + // Make sure delegates can be hidden. Assert.IsTrue(Delegate_TestClass_delegate65.testMethod()); } /*These tests are skipped because the use the == operator in an unsupported way @@ -266,7 +266,7 @@ public void Delegate_delegate65_Test() [TestMethod] public void Delegate_delegate66_Test() { - OutputHelper.WriteLine("Two compatible delegate types can be compared for equality."); + // Two compatible delegate types can be compared for equality. Assert.IsTrue(Delegate_TestClass_delegate66.testMethod()) { return MFTestResults.Pass; @@ -276,7 +276,7 @@ public void Delegate_delegate66_Test() [TestMethod] public void Delegate_delegate70_Test() { - OutputHelper.WriteLine("Two compatible delegate types can be compared for equality (or inequality)."); + // Two compatible delegate types can be compared for equality (or inequality). Assert.IsTrue(Delegate_TestClass_delegate70.testMethod()) { return MFTestResults.Pass; @@ -287,13 +287,13 @@ public void Delegate_delegate70_Test() [TestMethod] public void Delegate_delegate71_Test() { - OutputHelper.WriteLine("Verify simple +="); + // Verify simple += Assert.IsTrue(Delegate_TestClass_delegate71.testMethod()); } [TestMethod] public void Delegate_delegate72_Test() { - OutputHelper.WriteLine(" Verify that delegates can be removed using the -= operator;"); + // Verify that delegates can be removed using the -= operator; Assert.IsTrue(Delegate_TestClass_delegate72.testMethod()); } /* These tests are skipped because they use == in an unsupported way @@ -301,7 +301,7 @@ public void Delegate_delegate72_Test() [TestMethod] public void Delegate_delegate73_Test() { - OutputHelper.WriteLine("Verify equality and inequality after using += and -= on delegates"); + // Verify equality and inequality after using += and -= on delegates Assert.IsTrue(Delegate_TestClass_delegate73.testMethod()) { return MFTestResults.Pass; @@ -311,7 +311,7 @@ public void Delegate_delegate73_Test() [TestMethod] public void Delegate_delegate74_Test() { - OutputHelper.WriteLine("Verify ability to call members of System.Delegate on delegate types"); + // Verify ability to call members of System.Delegate on delegate types Assert.IsTrue(Delegate_TestClass_delegate74.testMethod()) { return MFTestResults.Pass; @@ -321,8 +321,8 @@ public void Delegate_delegate74_Test() [TestMethod] public void Delegate_delegate75_Test() { - OutputHelper.WriteLine("Verify ability to call members of System.Delegate on delegate types"); - OutputHelper.WriteLine("and that ordinality is maintained in concatenated invocation lists"); + // Verify ability to call members of System.Delegate on delegate types + // and that ordinality is maintained in concatenated invocation lists Assert.IsTrue(Delegate_TestClass_delegate75.testMethod()) { return MFTestResults.Pass; @@ -332,8 +332,8 @@ public void Delegate_delegate75_Test() [TestMethod] public void Delegate_delegate76_Test() { - OutputHelper.WriteLine("Verify ability to call members of System.Delegate on delegate types"); - OutputHelper.WriteLine("and that ordinality is maintained in concatenated invocation lists"); + // Verify ability to call members of System.Delegate on delegate types + // and that ordinality is maintained in concatenated invocation lists Assert.IsTrue(Delegate_TestClass_delegate76.testMethod()) { return MFTestResults.Pass; @@ -344,61 +344,61 @@ public void Delegate_delegate76_Test() [TestMethod] public void Delegate_delegate77_Test() { - OutputHelper.WriteLine("Verify that ordinality is maintained in concatenated invocation lists"); - OutputHelper.WriteLine("and that the invocation list members are called synchronously"); + // Verify that ordinality is maintained in concatenated invocation lists + // and that the invocation list members are called synchronously Assert.IsTrue(Delegate_TestClass_delegate77.testMethod()); } [TestMethod] public void Delegate_delegate78_Test() { - OutputHelper.WriteLine("Verify that ordinality is maintained in concatenated invocation lists"); - OutputHelper.WriteLine("and that the invocation list members are called synchronously and"); - OutputHelper.WriteLine("that ref parameters are modified through the invocation chain."); + // Verify that ordinality is maintained in concatenated invocation lists + // and that the invocation list members are called synchronously and + // that ref parameters are modified through the invocation chain. Assert.IsTrue(Delegate_TestClass_delegate78.testMethod()); } [TestMethod] public void Delegate_delegate79_Test() { - OutputHelper.WriteLine("Verify that ordinality is maintained in concatenated invocation lists"); - OutputHelper.WriteLine("and that the invocation list members are called synchronously and"); - OutputHelper.WriteLine("that out parameters are set by the last member in the invocation chain."); + // Verify that ordinality is maintained in concatenated invocation lists + // and that the invocation list members are called synchronously and + // that out parameters are set by the last member in the invocation chain. Assert.IsTrue(Delegate_TestClass_delegate79.testMethod()); } [TestMethod] public void Delegate_delegate80_Test() { - OutputHelper.WriteLine("Verify that System.Exceptions not caught in invoked method are bubbled up"); - OutputHelper.WriteLine("and the remaining methods in the invocation list are not invoked."); + // Verify that System.Exceptions not caught in invoked method are bubbled up + // and the remaining methods in the invocation list are not invoked. Assert.IsTrue(Delegate_TestClass_delegate80.testMethod()); } [TestMethod] public void Delegate_delegate81_Test() { - OutputHelper.WriteLine("Sample from section 15.3 of Delegate_TestClass_?_A#LS"); + // Sample from section 15.3 of Delegate_TestClass_?_A#LS Assert.IsTrue(Delegate_TestClass_delegate81.testMethod()); } [TestMethod] public void Delegate_delegate_modifier09_Test() { - OutputHelper.WriteLine("only new, public, private, protected and internal are allowed as modifiers"); + // only new, public, private, protected and internal are allowed as modifiers Assert.IsTrue(Delegate_TestClass_delegate_modifier09.testMethod()); } [TestMethod] public void Delegate_delegate_modifier10_Test() { - OutputHelper.WriteLine("only new, public, private, protected and internal are allowed as modifiers"); + // only new, public, private, protected and internal are allowed as modifiers Assert.IsTrue(Delegate_TestClass_delegate_modifier10.testMethod()); } [TestMethod] public void Delegate_delegate_modifier11_Test() { - OutputHelper.WriteLine("only new, public, private, protected and internal are allowed as modifiers"); + // only new, public, private, protected and internal are allowed as modifiers Assert.IsTrue(Delegate_TestClass_delegate_modifier11.testMethod()); } [TestMethod] public void Delegate_delegate_modifier12_Test() { - OutputHelper.WriteLine("only new, public, private, protected and internal are allowed as modifiers"); + // only new, public, private, protected and internal are allowed as modifiers Assert.IsTrue(Delegate_TestClass_delegate_modifier12.testMethod()); } @@ -408,10 +408,10 @@ public void Delegate_delegate_modifier12_Test() delegate int Delegate_TestClass_delegate01_1(); public class Delegate_TestClass_delegate01_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -426,8 +426,7 @@ static public int Main_old() retval -= foo(); foo = new Delegate_TestClass_delegate01_1(Delegate_TestClass_delegate01_2.far); retval -= foo(); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -438,10 +437,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate02_1(); public class Delegate_TestClass_delegate02_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -458,8 +457,7 @@ static public int Main_old() foo = null; foo = new Delegate_TestClass_delegate02_1(Delegate_TestClass_delegate02_2.far); retval -= foo(); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -471,10 +469,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate03_2 { public static int retval = 0x03; - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -491,8 +489,7 @@ static public int Main_old() { Delegate_TestClass_delegate03_2.retval -= 0x03; } - if(Delegate_TestClass_delegate03_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate03_2.retval; } public static bool testMethod() @@ -503,10 +500,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate04_1(); public class Delegate_TestClass_delegate04_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -523,8 +520,7 @@ static public int Main_old() retval -= foo(); foo = !loo() ? new Delegate_TestClass_delegate04_1(p.bar) : new Delegate_TestClass_delegate04_1(Delegate_TestClass_delegate04_2.far); retval -= foo(); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -535,10 +531,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate05_1(); public class Delegate_TestClass_delegate05_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -555,8 +551,7 @@ static public int Main_old() retval -= foo(); foo = !loo() ? null : new Delegate_TestClass_delegate05_1(Delegate_TestClass_delegate05_2.far); retval -= foo(); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -567,10 +562,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate06_1(); public class Delegate_TestClass_delegate06_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -601,8 +596,7 @@ static public int Main_old() { retval -= 0x02; } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -613,10 +607,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate07_1(); public class Delegate_TestClass_delegate07_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -640,8 +634,7 @@ static public int Main_old() { retval -= 0x02; } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -652,10 +645,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate08_1(); public class Delegate_TestClass_delegate08_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -676,8 +669,7 @@ static public int Main_old() if (foo == null) foo = new Delegate_TestClass_delegate08_1(Delegate_TestClass_delegate08_2.far); retval -= foo(); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -688,10 +680,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate09_1(); public class Delegate_TestClass_delegate09_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -716,8 +708,7 @@ static public int Main_old() retval -= 0x08; retval -= foo2(); OutputHelper.WriteLine(retval.ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -728,10 +719,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate10_1(); public class Delegate_TestClass_delegate10_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -753,8 +744,7 @@ static public int Main_old() retval -= 0x08; retval -= foo[0](); OutputHelper.WriteLine(retval.ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -765,10 +755,10 @@ public static bool testMethod() public delegate int Delegate_TestClass_delegate11_1(); public class Delegate_TestClass_delegate11_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } public Delegate_TestClass_delegate11_1 foo = null; @@ -786,8 +776,7 @@ static public int Main_old() p.foo = new Delegate_TestClass_delegate11_1(p.bar); retval -= p.foo(); OutputHelper.WriteLine(retval.ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -799,10 +788,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate12_2 { public static int retval = 0x06; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } } @@ -820,8 +809,7 @@ static public int Main_old() multifoo = new Delegate_TestClass_delegate12_1(Delegate_TestClass_delegate12_2.far); multifoo += foo; multifoo(); - if(Delegate_TestClass_delegate12_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate12_2.retval; } public static bool testMethod() @@ -833,10 +821,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate13_2 { public static int retval = 0x04; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } } @@ -852,8 +840,7 @@ static public int Main_old() foo = new Delegate_TestClass_delegate13_1(Delegate_TestClass_delegate13_2.far); foo += new Delegate_TestClass_delegate13_1(p.bar); foo(); - if(Delegate_TestClass_delegate13_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate13_2.retval; } public static bool testMethod() @@ -865,10 +852,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate14_2 { public static int retval = 0x03; - public void bar() { OutputHelper.WriteLine("bar"); retval += 0x10; } + public void bar() { retval += 0x10; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval += 0x20; } } @@ -885,8 +872,7 @@ static public int Main_old() { Delegate_TestClass_delegate14_2.retval -= 0x03; } - if(Delegate_TestClass_delegate14_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate14_2.retval; } public static bool testMethod() @@ -898,10 +884,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate14a_2 { public static int retval = 0x02; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } } @@ -912,8 +898,7 @@ static public int Main_old() Delegate_TestClass_delegate14a_1 foo = new Delegate_TestClass_delegate14a_1(Delegate_TestClass_delegate14a_2.far); foo += (Delegate_TestClass_delegate14a_1)null; foo(); - if(Delegate_TestClass_delegate14a_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate14a_2.retval; } public static bool testMethod() @@ -925,10 +910,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate14b_2 { public static int retval = 0x02; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } } @@ -939,8 +924,7 @@ static public int Main_old() Delegate_TestClass_delegate14b_1 foo = null; foo += new Delegate_TestClass_delegate14b_1(Delegate_TestClass_delegate14b_2.far); foo(); - if(Delegate_TestClass_delegate14b_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate14b_2.retval; } public static bool testMethod() @@ -952,10 +936,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate14c_2 { public static int retval = 0x03; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } } @@ -968,8 +952,7 @@ static public int Main_old() foo += (Delegate_TestClass_delegate14c_1)null; foo += new Delegate_TestClass_delegate14c_1(Delegate_TestClass_delegate14c_2.far); foo(); - if(Delegate_TestClass_delegate14c_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate14c_2.retval; } public static bool testMethod() @@ -981,16 +964,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate15_2 { public static int retval = 63; - public void bar1() { OutputHelper.WriteLine("bar1"); retval -= 0x01; } + public void bar1() { retval -= 0x01; } static public void far1() { - OutputHelper.WriteLine("far1"); + // far1 retval -= 0x02; } - public void bar2() { OutputHelper.WriteLine("bar2"); retval -= 10; } + public void bar2() { retval -= 10; } static public void far2() { - OutputHelper.WriteLine("far2"); + // far2 retval -= 20; } } @@ -1016,8 +999,7 @@ static public int Main_old() left = new Delegate_TestClass_delegate15_1(Delegate_TestClass_delegate15_2.far2); foo = loo() ? left += new Delegate_TestClass_delegate15_1(p.bar2) : right += new Delegate_TestClass_delegate15_1(Delegate_TestClass_delegate15_2.far1); foo(); - if(Delegate_TestClass_delegate15_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate15_2.retval; } public static bool testMethod() @@ -1029,10 +1011,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate16_2 { public static int retval = 0x09; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } } @@ -1056,8 +1038,7 @@ static public int Main_old() right = new Delegate_TestClass_delegate16_1(Delegate_TestClass_delegate16_2.far); foo = !loo() ? null : right += new Delegate_TestClass_delegate16_1(p.bar); foo(); - if(Delegate_TestClass_delegate16_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate16_2.retval; } public static bool testMethod() @@ -1069,16 +1050,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate17_2 { public static int retval = 13; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } - public void bar2() { OutputHelper.WriteLine("bar2"); retval -= 10; } + public void bar2() { retval -= 10; } static public void far2() { - OutputHelper.WriteLine("far2"); + // far2 retval -= 20; } } @@ -1118,8 +1099,7 @@ static public int Main_old() { Delegate_TestClass_delegate17_2.retval -= 10; } - if(Delegate_TestClass_delegate17_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate17_2.retval; } public static bool testMethod() @@ -1131,16 +1111,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate18_2 { public static int retval = 23; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 0x01; } + public void bar() { retval -= 0x01; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 0x02; } - public void bar1() { OutputHelper.WriteLine("bar1"); retval -= 10; } + public void bar1() { retval -= 10; } static public void far1() { - OutputHelper.WriteLine("far1"); + // far1 retval -= 20; } } @@ -1167,8 +1147,7 @@ static public int Main_old() } foo(); - if(Delegate_TestClass_delegate18_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate18_2.retval; } public static bool testMethod() @@ -1180,10 +1159,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate19_2 { public static int retval = 33; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } } @@ -1211,8 +1190,7 @@ static public int Main_old() if (foo[1] == foo[2]) Delegate_TestClass_delegate19_2.retval -= 20; foo[1](); - if(Delegate_TestClass_delegate19_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate19_2.retval; } public static bool testMethod() @@ -1224,16 +1202,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate20_2 { public static int retval = 1333; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } - public void bar1() { OutputHelper.WriteLine("bar1"); retval -= 10; } + public void bar1() { retval -= 10; } static public void far1() { - OutputHelper.WriteLine("far1"); + // far1 retval -= 20; } } @@ -1265,8 +1243,7 @@ static public int Main_old() if (foo3 == foo4) Delegate_TestClass_delegate20_2.retval -= 1000; foo3(); - if(Delegate_TestClass_delegate20_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate20_2.retval; } public static bool testMethod() @@ -1278,10 +1255,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate21_2 { public static int retval = 33; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } } @@ -1307,8 +1284,7 @@ static public int Main_old() if (foo[0] == foo[1]) Delegate_TestClass_delegate21_2.retval -= 20; foo[0](); - if(Delegate_TestClass_delegate21_2.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return Delegate_TestClass_delegate21_2.retval; } public static bool testMethod() @@ -1320,10 +1296,10 @@ public static bool testMethod() public class Delegate_TestClass_delegate23_A { public static int retval = 3; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } } @@ -1337,8 +1313,7 @@ static public int Main_old() Delegate_TestClass_delegate23_Del foo2 = new Delegate_TestClass_delegate23_Del(p.bar); Delegate_TestClass_delegate23_Del foo3 = foo1 + foo2; foo3(); - if(Delegate_TestClass_delegate23_A.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + Delegate_TestClass_delegate23_A.retval.ToString()); + return Delegate_TestClass_delegate23_A.retval; } public static bool testMethod() @@ -1350,16 +1325,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate24_A { public static int retval = 0x0F; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } - public void bar2() { OutputHelper.WriteLine("bar2"); retval -= 4; } + public void bar2() { retval -= 4; } static public void far2() { - OutputHelper.WriteLine("far2"); + // far2 retval -= 8; } } @@ -1373,8 +1348,7 @@ static public int Main_old() Delegate_TestClass_delegate24_Del foo2 = new Delegate_TestClass_delegate24_Del(p.bar2) + new Delegate_TestClass_delegate24_Del(Delegate_TestClass_delegate24_A.far2); Delegate_TestClass_delegate24_Del foo3 = foo1 + foo2; foo3(); - if(Delegate_TestClass_delegate24_A.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + Delegate_TestClass_delegate24_A.retval.ToString()); + return Delegate_TestClass_delegate24_A.retval; } public static bool testMethod() @@ -1386,16 +1360,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate25_A { public static int retval = 0x3F; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } - public void bar2() { OutputHelper.WriteLine("bar2"); retval -= 4; } + public void bar2() { retval -= 4; } static public void far2() { - OutputHelper.WriteLine("far2"); + // far2 retval -= 8; } } @@ -1419,8 +1393,7 @@ static public int Main_old() Delegate_TestClass_delegate25_A.retval -= 0x20; Delegate_TestClass_delegate25_A.retval += 0x0C; foo4(); - if(Delegate_TestClass_delegate25_A.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + Delegate_TestClass_delegate25_A.retval.ToString()); + return Delegate_TestClass_delegate25_A.retval; } public static bool testMethod() @@ -1440,8 +1413,7 @@ public static int Main_old(String[] args) IAsyncResult ar = hd.BeginInvoke(out i, null, null); i = 1; hd.EndInvoke(out i, ar); - if (0 == i) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, i==" + i.ToString()); + return i; } catch (System.Exception) @@ -1471,7 +1443,7 @@ public static int Main_old(String[] args) HD hd = new HD(Delegate_TestClass_delegate28.Hello); int i = 1; i = hd(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257); - if (0 == i) OutputHelper.WriteLine("PASS"); + if (0 == i) // PASS else OutputHelper.WriteLine("FAIL, i==" + i.ToString()); return i; } @@ -1494,10 +1466,10 @@ public static bool testMethod() delegate int Delegate_TestClass_delegate30_1(); public struct Delegate_TestClass_delegate30_2 { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } static public int far() { - OutputHelper.WriteLine("far"); + // far return 0x02; } } @@ -1534,7 +1506,7 @@ interface I } public struct Delegate_TestClass_delegate31_2 : I { - public int bar() { OutputHelper.WriteLine("bar"); return 0x01; } + public int bar() { return 0x01; } } public class Delegate_TestClass_delegate31 { @@ -1547,11 +1519,11 @@ static public int Main_old() retval -= foo(); if (retval == 0) { - OutputHelper.WriteLine("PASS"); + // PASS } else { - OutputHelper.WriteLine("FAIL"); + // FAIL } return retval; } @@ -1657,12 +1629,7 @@ public static int Main_old(String[] args) retval -= 0x04; if (cd is System.MulticastDelegate) retval -= 0x08; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() @@ -1748,12 +1715,7 @@ public static int Main_old(String[] args) bmd = new Delegate_TestClass_delegate65_1.Delegate_TestClass_delegate65_Del(bc.DelegatedMethod); if (bmd(2, 0.5f) == 2.5) retval -= 0x04; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() @@ -1784,8 +1746,8 @@ public static int Main_old(String[] args) retval -= 0x01; if (md2 == md1) retval -= 0x02; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else {OutputHelper.WriteLine("FAIL, 0x{0:X}"); + if (0 == retval) // PASS + else {// FAIL, 0x{0:X} return retval; } public static bool testMethod() @@ -1819,8 +1781,8 @@ public static int Main_old(String[] args) retval -= 0x01; if (md2 != md1) retval -= 0x02; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else {OutputHelper.WriteLine("FAIL, 0x{0:X}"); + if (0 == retval) // PASS + else {// FAIL, 0x{0:X} return retval; } public static bool testMethod() @@ -1862,12 +1824,7 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() @@ -1882,16 +1839,16 @@ public static bool testMethod() public class Delegate_TestClass_delegate72_A { public static int retval = 0x3F; - public void bar() { OutputHelper.WriteLine("bar"); retval -= 1; } + public void bar() { retval -= 1; } static public void far() { - OutputHelper.WriteLine("far"); + // far retval -= 2; } - public void bar2() { OutputHelper.WriteLine("bar2"); retval -= 4; } + public void bar2() { retval -= 4; } static public void far2() { - OutputHelper.WriteLine("far2"); + // far2 retval -= 8; } } @@ -1916,8 +1873,7 @@ static public int Main_old() Delegate_TestClass_delegate72_A.retval -= 0x20; Delegate_TestClass_delegate72_A.retval += 0x0C; foo4(); - if(Delegate_TestClass_delegate72_A.retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval==" + Delegate_TestClass_delegate72_A.retval.ToString()); + return Delegate_TestClass_delegate72_A.retval; } public static bool testMethod() @@ -1964,8 +1920,8 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else {OutputHelper.WriteLine("FAIL, 0x{0:X}"); + if (0 == retval) // PASS + else {// FAIL, 0x{0:X} return retval; } public static bool testMethod() @@ -2010,8 +1966,8 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else {OutputHelper.WriteLine("FAIL, 0x{0:X}"); + if (0 == retval) // PASS + else {// FAIL, 0x{0:X} return retval; } public static bool testMethod() @@ -2077,8 +2033,8 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else {OutputHelper.WriteLine("FAIL, 0x{0:X}"); + if (0 == retval) // PASS + else {// FAIL, 0x{0:X} return retval; } public static bool testMethod() @@ -2095,22 +2051,22 @@ public class Delegate_TestClass_delegate76 public delegate double MyDelegate2(int integerPortion, float fraction); public double DelegatedMethod1(int intPart, float frac) { - OutputHelper.WriteLine("DelegatedMethod1"); + // DelegatedMethod1 return intPart + frac + 5; } public double DelegatedMethod2(int intPart, float frac) { - OutputHelper.WriteLine("DelegatedMethod2"); + // DelegatedMethod2 return intPart + frac + 10; } public double DelegatedMethod3(int intPart, float frac) { - OutputHelper.WriteLine("DelegatedMethod3"); + // DelegatedMethod3 return intPart + frac + 15; } public double DelegatedMethod4(int intPart, float frac) { - OutputHelper.WriteLine("DelegatedMethod4"); + // DelegatedMethod4 return intPart + frac + 20; } public static int Main_old(String[] args) @@ -2146,8 +2102,8 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else {OutputHelper.WriteLine("FAIL, 0x{0:X}"); + if (0 == retval) // PASS + else {// FAIL, 0x{0:X} return retval; } public static bool testMethod() @@ -2218,12 +2174,7 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() @@ -2296,12 +2247,7 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() @@ -2378,12 +2324,7 @@ public static int Main_old(String[] args) { retval -= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() @@ -2461,12 +2402,7 @@ public static int Main_old(String[] args) { retval ^= 0x20; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL, 0x{0:X}"); - OutputHelper.WriteLine(retval.ToString()); - } + return retval; } public static bool testMethod() diff --git a/Tests/NFUnitTestEnum/UnitTestEnumTests.cs b/Tests/NFUnitTestEnum/UnitTestEnumTests.cs index 185872ba..647eb5df 100644 --- a/Tests/NFUnitTestEnum/UnitTestEnumTests.cs +++ b/Tests/NFUnitTestEnum/UnitTestEnumTests.cs @@ -16,234 +16,234 @@ public class UnitTestEnumTests [TestMethod] public void Enum_enum01_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum01.testMethod()); } [TestMethod] public void Enum_enum02_Test() { - OutputHelper.WriteLine("Make sure that basic enum-with-base-type declarations, definitions, and assignments work."); + // Make sure that basic enum-with-base-type declarations, definitions, and assignments work. Assert.IsTrue(Enum_TestClass_enum02.testMethod()); } [TestMethod] public void Enum_enum07_Test() { - OutputHelper.WriteLine("Make sure that basic enum-with-base-type declarations, definitions, and assignments work."); + // Make sure that basic enum-with-base-type declarations, definitions, and assignments work. Assert.IsTrue(Enum_TestClass_enum07.testMethod()); } [TestMethod] public void Enum_enum09_Test() { - OutputHelper.WriteLine("Make sure that basic enum-with-base-type declarations, definitions, and assignments work."); + // Make sure that basic enum-with-base-type declarations, definitions, and assignments work. Assert.IsTrue(Enum_TestClass_enum09.testMethod()); } [TestMethod] public void Enum_enum10_Test() { - OutputHelper.WriteLine("Make sure that basic enum-with-base-type declarations, definitions, and assignments work."); + // Make sure that basic enum-with-base-type declarations, definitions, and assignments work. Assert.IsTrue(Enum_TestClass_enum10.testMethod()); } [TestMethod] public void Enum_enum11_Test() { - OutputHelper.WriteLine("Make sure that basic enum-with-base-type declarations, definitions, and assignments work."); + // Make sure that basic enum-with-base-type declarations, definitions, and assignments work. Assert.IsTrue(Enum_TestClass_enum11.testMethod()); } [TestMethod] public void Enum_enum27_Test() { - OutputHelper.WriteLine("Check that enumerator values are initialized as expected"); + // Check that enumerator values are initialized as expected Assert.IsTrue(Enum_TestClass_enum27.testMethod()); } [TestMethod] public void Enum_enum28_Test() { - OutputHelper.WriteLine("Check that enumerator values are initialized as expected"); + // Check that enumerator values are initialized as expected Assert.IsTrue(Enum_TestClass_enum28.testMethod()); } [TestMethod] public void Enum_enum29_Test() { - OutputHelper.WriteLine("The values of the enumerators need not be distinct"); + // The values of the enumerators need not be distinct Assert.IsTrue(Enum_TestClass_enum29.testMethod()); } [TestMethod] public void Enum_enum30_Test() { - OutputHelper.WriteLine("Check the point of definition of an enumerator"); + // Check the point of definition of an enumerator Assert.IsTrue(Enum_TestClass_enum30.testMethod()); } [TestMethod] public void Enum_enum31_Test() { - OutputHelper.WriteLine("Check the point of definition of an enumerator"); + // Check the point of definition of an enumerator Assert.IsTrue(Enum_TestClass_enum31.testMethod()); } [TestMethod] public void Enum_enum33_Test() { - OutputHelper.WriteLine("Enums obey local scope rules. An enum of the same name may be defined in an inner scope."); + // Enums obey local scope rules. An enum of the same name may be defined in an inner scope. Assert.IsTrue(Enum_TestClass_enum33.testMethod()); } [TestMethod] public void Enum_enum34_Test() { - OutputHelper.WriteLine("Enums can be converted to int."); + // Enums can be converted to int. Assert.IsTrue(Enum_TestClass_enum34.testMethod()); } [TestMethod] public void Enum_enum35_Test() { - OutputHelper.WriteLine("If no enumerator-definitions with = appear, then the"); - OutputHelper.WriteLine(" values of the corresponding constants begin at zero and"); + // If no enumerator-definitions with = appear, then the + // values of the corresponding constants begin at zero and Assert.IsTrue(Enum_TestClass_enum35.testMethod()); } [TestMethod] public void Enum_enum36_Test() { - OutputHelper.WriteLine("If no enumerator-definitions with = appear, then the"); - OutputHelper.WriteLine(" values of the corresponding constants begin at zero and"); + // If no enumerator-definitions with = appear, then the + // values of the corresponding constants begin at zero and Assert.IsTrue(Enum_TestClass_enum36.testMethod()); } [TestMethod] public void Enum_enum37_Test() { - OutputHelper.WriteLine("If no enumerator-definitions with = appear, then the"); - OutputHelper.WriteLine(" values of the corresponding constants begin at zero and"); + // If no enumerator-definitions with = appear, then the + // values of the corresponding constants begin at zero and Assert.IsTrue(Enum_TestClass_enum37.testMethod()); } [TestMethod] public void Enum_enum38_Test() { - OutputHelper.WriteLine("Enums can be declared in any scopt that a class can be declared in."); + // Enums can be declared in any scopt that a class can be declared in. Assert.IsTrue(Enum_TestClass_enum38.testMethod()); } [TestMethod] public void Enum_enum39_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum39.testMethod()); } [TestMethod] public void Enum_enum40_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum40.testMethod()); } [TestMethod] public void Enum_enum41_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum41.testMethod()); } [TestMethod] public void Enum_enum42_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum42.testMethod()); } [TestMethod] public void Enum_enum43_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum43.testMethod()); } [TestMethod] public void Enum_enum43u_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum43u.testMethod()); } [TestMethod] public void Enum_enum44_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum44.testMethod()); } [TestMethod] public void Enum_enum45_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum45.testMethod()); } [TestMethod] public void Enum_enum46_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum46.testMethod()); } [TestMethod] public void Enum_enum46u_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum46u.testMethod()); } [TestMethod] public void Enum_enum47_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum47.testMethod()); } [TestMethod] public void Enum_enum47u_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum47u.testMethod()); } [TestMethod] public void Enum_enum48_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum48.testMethod()); } [TestMethod] public void Enum_enum48u_Test() { - OutputHelper.WriteLine("If the constant-expression initilizing an enumerator is of integral type,"); - OutputHelper.WriteLine("it must be within the range of values that can be represented by the underlying type."); + // If the constant-expression initilizing an enumerator is of integral type, + // it must be within the range of values that can be represented by the underlying type. Assert.IsTrue(Enum_TestClass_enum48u.testMethod()); } [TestMethod] public void Enum_enum54_Test() { - OutputHelper.WriteLine("++ and -- operators can be used with objects of enumeration type. Check postfix form."); + // ++ and -- operators can be used with objects of enumeration type. Check postfix form. Assert.IsTrue(Enum_TestClass_enum54.testMethod()); } [TestMethod] public void Enum_enum55_Test() { - OutputHelper.WriteLine("++ and -- operators can be used with objects of enumeration type. Check postfix form."); + // ++ and -- operators can be used with objects of enumeration type. Check postfix form. Assert.IsTrue(Enum_TestClass_enum55.testMethod()); } [TestMethod] public void Enum_enum56_Test() { - OutputHelper.WriteLine("++ and -- operators can be used with objects of enumeration type. Check postfix form."); + // ++ and -- operators can be used with objects of enumeration type. Check postfix form. Assert.IsTrue(Enum_TestClass_enum56.testMethod()); } [TestMethod] public void Enum_enum57_Test() { - OutputHelper.WriteLine("++ and -- operators can be used with objects of enumeration type. Check postfix form."); + // ++ and -- operators can be used with objects of enumeration type. Check postfix form. Assert.IsTrue(Enum_TestClass_enum57.testMethod()); } [TestMethod] public void Enum_enum58_Test() { - OutputHelper.WriteLine("Bitwise operators AND, OR, XOR, and NOT can be used with objects of enumeration type."); + // Bitwise operators AND, OR, XOR, and NOT can be used with objects of enumeration type. Assert.IsTrue(Enum_TestClass_enum58.testMethod()); } @@ -255,86 +255,86 @@ public void Enum_enum62_Test() [TestMethod] public void Enum_enum63_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum63.testMethod()); } [TestMethod] public void Enum_enum64_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum64.testMethod()); } [TestMethod] public void Enum_enum65_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum65.testMethod()); } [TestMethod] public void Enum_enum66_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum66.testMethod()); } [TestMethod] public void Enum_enum67_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum67.testMethod()); } [TestMethod] public void Enum_enum68_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum68.testMethod()); } [TestMethod] public void Enum_enum69_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum69.testMethod()); } [TestMethod] public void Enum_enum70_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); + // Make sure that a basic enum declaration, definition, and assignment work. Assert.IsTrue(Enum_TestClass_enum70.testMethod()); } [TestMethod] public void Enum_enum71_Test() { - OutputHelper.WriteLine("Make sure that a basic enum declaration, definition, and assignment work."); - OutputHelper.WriteLine("This test is expeced to fail"); + // Make sure that a basic enum declaration, definition, and assignment work. + // This test is expeced to fail Assert.IsFalse(Enum_TestClass_enum71.testMethod()); } [TestMethod] public void Enum_enum72_Test() { - OutputHelper.WriteLine("Enum_TestClass_? bitwise and on enums"); + // Enum_TestClass_? bitwise and on enums Assert.IsTrue(Enum_TestClass_enum72.testMethod()); } [TestMethod] public void Enum_enum73_Test() { - OutputHelper.WriteLine("Enum_TestClass_? bitwise or on enums"); + // Enum_TestClass_? bitwise or on enums Assert.IsTrue(Enum_TestClass_enum73.testMethod()); } [TestMethod] public void Enum_enum74_Test() { - OutputHelper.WriteLine("Enum_TestClass_? bitwise xor on enums"); + // Enum_TestClass_? bitwise xor on enums Assert.IsTrue(Enum_TestClass_enum74.testMethod()); } [TestMethod] public void Enum_enum75_Test() { - OutputHelper.WriteLine("Enum_TestClass_? bitwise not on enums"); + // Enum_TestClass_? bitwise not on enums Assert.IsTrue(Enum_TestClass_enum75.testMethod()); } [TestMethod] public void Enum_enum77_Test() { - OutputHelper.WriteLine("Enum_TestClass_? bitwise not on enums"); + // Enum_TestClass_? bitwise not on enums Assert.IsTrue(Enum_TestClass_enum77.testMethod()); } [TestMethod] @@ -345,69 +345,69 @@ public void Enum_enum78_Test() [TestMethod] public void Enum_enum83_Test() { - OutputHelper.WriteLine("Enum member list can end with a comma"); + // Enum member list can end with a comma Assert.IsTrue(Enum_TestClass_enum83.testMethod()); } [TestMethod] public void Enum_enum86_Test() { - OutputHelper.WriteLine("[Access] modifiers of an enum declaration have the same meaning"); - OutputHelper.WriteLine("as those of a class declaration."); + // [Access] modifiers of an enum declaration have the same meaning + // as those of a class declaration. Assert.IsTrue(Enum_TestClass_enum86.testMethod()); } [TestMethod] public void Enum_enum93_Test() { - OutputHelper.WriteLine("Example from Enums chapter in CLS"); + // Example from Enums chapter in CLS Assert.IsTrue(Enum_TestClass_enum93.testMethod()); } [TestMethod] public void Enum_enum94_Test() { - OutputHelper.WriteLine("...any value of the underlying type of an enum can be cast to the enum type."); + // ...any value of the underlying type of an enum can be cast to the enum type. Assert.IsTrue(Enum_TestClass_enum94.testMethod()); } [TestMethod] public void EnumFlags01_Test() { - OutputHelper.WriteLine("check FlagAttribute with enum"); + // check FlagAttribute with enum TestClassEnumFlags01.TestMethod(); } [TestMethod] public void EnumFlags02_Test() { - OutputHelper.WriteLine("check FlagAttribute with enum"); + // check FlagAttribute with enum TestClassEnumFlags02.TestMethod(); } [TestMethod] public void EnumFlags03_Test() { - OutputHelper.WriteLine("check FlagAttribute with enum"); + // check FlagAttribute with enum TestClassEnumFlags03.TestMethod(); } [TestMethod] public void EnumFlags04_Test() { - OutputHelper.WriteLine("check FlagAttribute with enum with conversion"); + // check FlagAttribute with enum with conversion TestClassEnumFlags04.TestMethod(); } [TestMethod] public void EnumFlags05_Test() { - OutputHelper.WriteLine("check Enum.HasFlag"); + // check Enum.HasFlag TestClassEnumFlags05.TestMethod(); } [TestMethod] public void EnumFlags06_Test() { - OutputHelper.WriteLine("check Enum.HasFlag throws exception"); + // check Enum.HasFlag throws exception TestClassEnumFlags06.TestMethod(); } [TestMethod] public void Enum_EqualsTest_01() { - OutputHelper.WriteLine("Check Equals with Enums"); + // Check Equals with Enums Enum_TestClass_Equals.TestMethod(); } @@ -445,7 +445,7 @@ public enum e1 { one = 1, two = 2, three = 3 }; public static int Main_old() { e1 v_e1 = e1.two; - OutputHelper.WriteLine("v_e1 == "); + // v_e1 == OutputHelper.WriteLine(v_e1.ToString()); return 0; } @@ -466,13 +466,13 @@ public static int Main_old() e2 v_e2 = e2.two; e3 v_e3 = e3.two; e4 v_e4 = e4.two; - OutputHelper.WriteLine("v_e1 == "); + // v_e1 == OutputHelper.WriteLine(v_e1.ToString()); - OutputHelper.WriteLine("v_e2 == "); + // v_e2 == OutputHelper.WriteLine(v_e2.ToString()); - OutputHelper.WriteLine("v_e3 == "); + // v_e3 == OutputHelper.WriteLine(v_e3.ToString()); - OutputHelper.WriteLine("v_e4 == "); + // v_e4 == OutputHelper.WriteLine(v_e4.ToString()); return 0; } @@ -488,7 +488,7 @@ public enum e1 { one = 1, two = 2, three = 3 }; public static int Main_old() { int i = (int)e1.two; - OutputHelper.WriteLine("i == "); + // i == OutputHelper.WriteLine(i.ToString()); return i - 2; } @@ -505,7 +505,7 @@ public enum e1 : int { one = 1, two = 2, three = 3 }; public static int Main_old() { int i = (int)e1.two; - OutputHelper.WriteLine("i == "); + // i == OutputHelper.WriteLine(i.ToString()); return i - 2; } @@ -522,7 +522,7 @@ public enum e1 : short { one = 1, two = 2, three = 3 }; public static int Main_old() { int i = (short)e1.two; - OutputHelper.WriteLine("i == "); + // i == OutputHelper.WriteLine(i.ToString()); return i - 2; } @@ -539,7 +539,7 @@ public enum e1 : byte { one = 1, two = 2, three = 3 }; public static int Main_old() { int i = (byte)e1.two; - OutputHelper.WriteLine("i == "); + // i == OutputHelper.WriteLine(i.ToString()); return i - 2; } @@ -558,42 +558,42 @@ public static int Main_old() { if ((int)Enum_TestClass_enum27_Enum1.zero != 0) { - OutputHelper.WriteLine("Enumerator zero = "); + // Enumerator zero = OutputHelper.WriteLine((Enum_TestClass_enum27_Enum1.zero).ToString()); retval |= 0x01; } if ((int)Enum_TestClass_enum27_Enum1.one != 1) { - OutputHelper.WriteLine("Enumerator one = "); + // Enumerator one = OutputHelper.WriteLine((Enum_TestClass_enum27_Enum1.one).ToString()); retval |= 0x02; } if ((int)Enum_TestClass_enum27_Enum1.three != 3) { - OutputHelper.WriteLine("Enumerator three = "); + // Enumerator three = OutputHelper.WriteLine((Enum_TestClass_enum27_Enum1.three).ToString()); retval |= 0x04; } if ((int)Enum_TestClass_enum27_Enum1.four != 4) { - OutputHelper.WriteLine("Enumerator four = "); + // Enumerator four = OutputHelper.WriteLine((Enum_TestClass_enum27_Enum1.four).ToString()); retval |= 0x08; } if ((int)Enum_TestClass_enum27_Enum1.minus7 != -7) { - OutputHelper.WriteLine("Enumerator minus7 = "); + // Enumerator minus7 = OutputHelper.WriteLine((Enum_TestClass_enum27_Enum1.minus7).ToString()); retval |= 0x10; } if ((int)Enum_TestClass_enum27_Enum1.minus6 != -6) { - OutputHelper.WriteLine("Enumerator minus6 = "); + // Enumerator minus6 = OutputHelper.WriteLine((Enum_TestClass_enum27_Enum1.minus6).ToString()); retval |= 0x20; } @@ -616,47 +616,46 @@ public static int Main_old() { if (!((Enum_TestClass_enum28_Enum1)Enum_TestClass_enum28_Enum1.zero == (Enum_TestClass_enum28_Enum1)0)) { - OutputHelper.WriteLine("Enumerator zero = "); + // Enumerator zero = OutputHelper.WriteLine((Enum_TestClass_enum28_Enum1.zero).ToString()); retval |= 0x01; } if (Enum_TestClass_enum28_Enum1.one != (Enum_TestClass_enum28_Enum1)1) { - OutputHelper.WriteLine("Enumerator one = "); + // Enumerator one = OutputHelper.WriteLine((Enum_TestClass_enum28_Enum1.one).ToString()); retval |= 0x02; } if (Enum_TestClass_enum28_Enum1.three != (Enum_TestClass_enum28_Enum1)3) { - OutputHelper.WriteLine("Enumerator three = "); + // Enumerator three = OutputHelper.WriteLine((Enum_TestClass_enum28_Enum1.three).ToString()); retval |= 0x04; } if (Enum_TestClass_enum28_Enum1.four != (Enum_TestClass_enum28_Enum1)4) { - OutputHelper.WriteLine("Enumerator four = "); + // Enumerator four = OutputHelper.WriteLine((Enum_TestClass_enum28_Enum1.four).ToString()); retval |= 0x08; } if (Enum_TestClass_enum28_Enum1.minus7 != (Enum_TestClass_enum28_Enum1)(-7)) { - OutputHelper.WriteLine("Enumerator minus7 = "); + // Enumerator minus7 = OutputHelper.WriteLine((Enum_TestClass_enum28_Enum1.minus7).ToString()); retval |= 0x10; } if (Enum_TestClass_enum28_Enum1.minus6 != (Enum_TestClass_enum28_Enum1)(-6)) { - OutputHelper.WriteLine("Enumerator minus6 = "); + // Enumerator minus6 = OutputHelper.WriteLine((Enum_TestClass_enum28_Enum1.minus6).ToString()); retval |= 0x20; } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -674,12 +673,10 @@ public static int Main_old() { if (Enum_TestClass_enum29_Enum1.one != Enum_TestClass_enum29_Enum1.zero) { - OutputHelper.WriteLine("Enumerator zero and one not synonymous"); + // Enumerator zero and one not synonymous retval = 1; } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -697,12 +694,10 @@ public static int Main_old() { if ((int)Enum_TestClass_enum30_Enum1.three != 3) { - OutputHelper.WriteLine("Enumerator zero and one not synonymous"); + // Enumerator zero and one not synonymous retval = 1; } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -718,7 +713,7 @@ public class Enum_TestClass_enum31 public enum Enum_TestClass_enum31_Enum1 { }; public static int Main_old() { - OutputHelper.WriteLine("PASS"); + // PASS return retval; } public static bool testMethod() @@ -735,7 +730,7 @@ public class Enum_TestClass_enum33 public enum Enum_TestClass_enum33_Enum1 { yes = 1, no = yes - 1 }; public static int Main_old() { - OutputHelper.WriteLine("PASS"); + // PASS return retval; } public static bool testMethod() @@ -753,7 +748,7 @@ public static int Main_old() { int i = (int)color.yellow; //ok: yellow converted to int value 1 //by integral promotion" - OutputHelper.WriteLine("PASS"); + // PASS return retval; } public static bool testMethod() @@ -782,12 +777,6 @@ public static int Main_old() if ((int)E.f == 3) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -820,12 +809,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum36_Enum.E.f == 3) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -860,12 +843,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum37_Enum.E.f == 3) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -899,12 +876,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum38_Enum1.f == 3) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -933,12 +904,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum39_Enum1.f == 255) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -967,12 +932,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum40_Enum1.f == 32767) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1001,12 +960,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum41_Enum1.f == 0x7FFFFFFF) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1035,12 +988,6 @@ public static int Main_old() if ((long)Enum_TestClass_enum42_Enum1.f == 0x7FFFFFFFFFFFFFFF) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1070,12 +1017,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum43_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1105,12 +1046,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum43u_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1140,12 +1075,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum44_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1175,12 +1104,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum45_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1210,12 +1133,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum46_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1244,12 +1161,6 @@ public static int Main_old() if ((uint)Enum_TestClass_enum46u_Enum1.f == 0xFFFFFFFF) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1279,12 +1190,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum47_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1314,12 +1219,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum47u_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1349,12 +1248,6 @@ public static int Main_old() if ((int)Enum_TestClass_enum48_Enum2.f == 5) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else - { - OutputHelper.WriteLine("FAIL\nretval == "); - OutputHelper.WriteLine((retval).ToString()); - } return retval; } public static bool testMethod() @@ -1384,8 +1277,6 @@ public static int Main_old() if ((ulong)Enum_TestClass_enum48u_Enum1.f == 0xFFFFFFFFFFFFFFFFL) retval -= 0x01; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL\nretval == " + retval.ToString()); return retval; } public static bool testMethod() @@ -1506,8 +1397,7 @@ public static int Main_old() e5ul--; if ((int)e5ul == (int)Enum_TestClass_enum54_Enum5ul.a - 1) retval -= 0x04000000; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, 0x{0:X} " + retval.ToString()); + return retval; } public static bool testMethod() @@ -1628,9 +1518,7 @@ public static int Main_old() --e5ul; if ((int)e5ul == (int)Enum_TestClass_enum55_Enum5ul.a - 2) retval -= 0x4000000; - OutputHelper.WriteLine((retval).ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -1753,9 +1641,6 @@ public static int Main_old() if ((int)e5ul == (int)Enum_TestClass_enum56_Enum5ul.a - 1) retval -= 0x4000000; - OutputHelper.WriteLine((retval).ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -1876,8 +1761,7 @@ public static int Main_old() e5ul--; e5ul--; e5ul--; e5ul--; if ((int)e5ul == (int)Enum_TestClass_enum57_Enum5ul.a - 1) retval -= 0x4000000; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, 0x{0:X} " + retval.ToString()); + return retval; } public static bool testMethod() @@ -1982,8 +1866,7 @@ public static int Main_old() e5ul &= ~Enum_TestClass_enum58_Enum5ul.b; if ((int)e5ul == 0) retval -= 0x100; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2011,8 +1894,7 @@ public static int Main_old() int nInt = (int)tt[1]; OutputHelper.WriteLine(nInt.ToString()); int i = (int)tt[0] + (int)tt[1] + nInt - 300; - if (0 == i) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return i; } public static bool testMethod() @@ -2031,8 +1913,7 @@ public static int Main_old() OutputHelper.WriteLine("v_e1 == " + ((int)v_e1).ToString() + ", v == " + ((int)v).ToString()); if (v_e1 < v) retval = 0; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2051,8 +1932,7 @@ public static int Main_old() OutputHelper.WriteLine("v_e1 == " + ((int)v_e1).ToString() + ", v == " + ((int)v).ToString()); if (v_e1 > v) retval = 0; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2078,8 +1958,7 @@ public static int Main_old() retval -= 2; if (v_e1 == v) retval -= 4; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2105,8 +1984,7 @@ public static int Main_old() OutputHelper.WriteLine("v_e1 == " + ((int)v_e1).ToString() + ", v == " + ((int)v).ToString()); if (v_e1 <= v) retval -= 4; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2122,8 +2000,7 @@ public static int Main_old() int retval = 1; if (e1.two < e1.three) retval = 0; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2139,8 +2016,7 @@ public static int Main_old() int retval = 1; if (e1.three > e1.two) retval = 0; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2159,11 +2035,11 @@ public static int Main_old() || e1.two >= e1.three ) { - OutputHelper.WriteLine("FAIL"); + // FAIL return -1; } - OutputHelper.WriteLine("PASS"); + // PASS return 0; } public static bool testMethod() @@ -2182,11 +2058,11 @@ public static int Main_old() || e1.two <= e1.one ) { - OutputHelper.WriteLine("FAIL"); + // FAIL return -1; } - OutputHelper.WriteLine("PASS"); + // PASS return 0; } public static bool testMethod() @@ -2209,8 +2085,7 @@ public static int Main_old() if (s1.Equals("two") && s2.Equals("three")) retval = 0; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); + return retval; } public static bool testMethod() @@ -2244,8 +2119,6 @@ public static int Main_old() if ((e1.three & e1.two) == e1.two) retval -= 0x20; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -2279,8 +2152,6 @@ public static int Main_old() if ((e1.three | e1.two) == e1.three) retval -= 0x20; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -2314,8 +2185,6 @@ public static int Main_old() if ((e1.three ^ e1.two) == e1.one) retval -= 0x20; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -2339,8 +2208,6 @@ public static int Main_old() if ((~(e1.one | e1.two) & e1.three) == e1.zero) retval -= 4; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -2374,8 +2241,6 @@ public static int Main_old() if ((v + 2) == e1.three) retval -= 0x20; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -2399,11 +2264,11 @@ public static int Main_old(String[] s) } catch (System.Exception e) { - OutputHelper.WriteLine("Caught System.Exception: Failed"); + // Caught System.Exception: Failed OutputHelper.WriteLine(e.ToString()); return 1; } - OutputHelper.WriteLine("No System.Exception: Passed"); + // No System.Exception: Passed return 0; } public static bool testMethod() @@ -2486,8 +2351,6 @@ public static int Main_old() retval -= 0x40; if (d.CheckE5()) retval -= 0x80; - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, 0x{0:X} " + retval.ToString()); return retval; } public static bool testMethod() diff --git a/Tests/NFUnitTestException/UnitTestExceptionTests.cs b/Tests/NFUnitTestException/UnitTestExceptionTests.cs index 2d092c0e..103f94b0 100644 --- a/Tests/NFUnitTestException/UnitTestExceptionTests.cs +++ b/Tests/NFUnitTestException/UnitTestExceptionTests.cs @@ -25,116 +25,116 @@ public void TestTimeoutException() [TestMethod] public void Exc_excep01_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught by the matching catch"); + // This test will confirm that the the thrown exception is caught by the matching catch Assert.IsTrue(Exc_TestClass_excep01.testMethod()); } [TestMethod] public void Exc_excep02_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught by the matching catch, not the base class catch blocks"); + // This test will confirm that the the thrown exception is caught by the matching catch, not the base class catch blocks Assert.IsTrue(Exc_TestClass_excep02.testMethod()); } [TestMethod] public void Exc_excep04_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught and the error code can be set"); + // This test will confirm that the the thrown exception is caught and the error code can be set Assert.IsTrue(Exc_TestClass_excep04.testMethod()); } [TestMethod] public void Exc_excep05_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught by the matching catch, not the base class catch"); + // This test will confirm that the the thrown exception is caught by the matching catch, not the base class catch Assert.IsTrue(Exc_TestClass_excep05.testMethod()); } [TestMethod] public void Exc_excep06_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught by the base class catch"); + // This test will confirm that the the thrown exception is caught by the base class catch Assert.IsTrue(Exc_TestClass_excep06.testMethod()); } [TestMethod] public void Exc_excep07_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught by the base class catch()"); + // This test will confirm that the the thrown exception is caught by the base class catch() Assert.IsTrue(Exc_TestClass_excep07.testMethod()); } [TestMethod] public void Exc_excep09_Test() { - OutputHelper.WriteLine("This test will confirm that the catch() functions."); + // This test will confirm that the catch() functions. Assert.IsTrue(Exc_TestClass_excep09.testMethod()); } [TestMethod] public void Exc_excep10_Test() { - OutputHelper.WriteLine("This test will confirm that the thrown exception is handled in the catch()"); - OutputHelper.WriteLine("when no matching catch is available."); + // This test will confirm that the thrown exception is handled in the catch() + // when no matching catch is available. Assert.IsTrue(Exc_TestClass_excep10.testMethod()); } [TestMethod] public void Exc_excep11_Test() { - OutputHelper.WriteLine("This test will confirm that the the thrown exception is caught by the matching catch, not the catch()"); + // This test will confirm that the the thrown exception is caught by the matching catch, not the catch() Assert.IsTrue(Exc_TestClass_excep11.testMethod()); } [TestMethod] public void Exc_excep27_Test() { - OutputHelper.WriteLine("Throwing an exception transfers control to a handler."); + // Throwing an exception transfers control to a handler. Assert.IsTrue(Exc_TestClass_excep27.testMethod()); } [TestMethod] public void Exc_excep28_Test() { - OutputHelper.WriteLine("When an exception is thrown, control is transferred to a handler"); + // When an exception is thrown, control is transferred to a handler Assert.IsTrue(Exc_TestClass_excep28.testMethod()); } [TestMethod] public void Exc_excep30_Test() { - OutputHelper.WriteLine("A throw-expression with no operand rethrows the exception being handled."); + // A throw-expression with no operand rethrows the exception being handled. Assert.IsTrue(Exc_TestClass_excep30.testMethod()); } [TestMethod] public void Exc_excep31_Test() { - OutputHelper.WriteLine("A throw-expression with no operand does not copy the exception being handled."); + // A throw-expression with no operand does not copy the exception being handled. Assert.IsTrue(Exc_TestClass_excep31.testMethod()); } [TestMethod] public void Exc_excep33_Test() { - OutputHelper.WriteLine("The exception thrown by a rethrow is the one most recently caught and not finished."); + // The exception thrown by a rethrow is the one most recently caught and not finished. Assert.IsTrue(Exc_TestClass_excep33.testMethod()); } [TestMethod] public void Exc_excep34_Test() { - OutputHelper.WriteLine("When initialization is complete for the formal parameter of a catch clause, an exception is considered caught."); + // When initialization is complete for the formal parameter of a catch clause, an exception is considered caught. Assert.IsTrue(Exc_TestClass_excep34.testMethod()); } [TestMethod] public void Exc_excep35_Test() { - OutputHelper.WriteLine("A handler is not allowed to catch an expression thrown outside"); - OutputHelper.WriteLine("its function-try-block and any function called from its function-"); - OutputHelper.WriteLine("try-block."); + // A handler is not allowed to catch an expression thrown outside + // its function-try-block and any function called from its function- + // try-block. Assert.IsTrue(Exc_TestClass_excep35.testMethod()); } [TestMethod] public void Exc_excep40_Test() { - OutputHelper.WriteLine("If no match is found among the handlers for a try-block, the"); - OutputHelper.WriteLine("search for a matching handler continues in a dynamically"); - OutputHelper.WriteLine("surrounding try-block."); + // If no match is found among the handlers for a try-block, the + // search for a matching handler continues in a dynamically + // surrounding try-block. Assert.IsTrue(Exc_TestClass_excep40.testMethod()); } [TestMethod] public void Exc_excep41_Test() { - OutputHelper.WriteLine("If no match is found among the handlers for a try-block, the"); - OutputHelper.WriteLine("search for a matching handler continues in a dynamically"); - OutputHelper.WriteLine("surrounding try-block."); + // If no match is found among the handlers for a try-block, the + // search for a matching handler continues in a dynamically + // surrounding try-block. Assert.IsTrue(Exc_TestClass_excep41.testMethod()); } @@ -145,7 +145,7 @@ public void Exc_excep41_Test() [TestMethod] public void Exc_excep42_Test() { - OutputHelper.WriteLine("Handle throws up to 255 levels deep."); + // Handle throws up to 255 levels deep. Assert.IsTrue(Exc_TestClass_excep42.testMethod()) { return MFTestResults.Pass; @@ -156,7 +156,7 @@ public void Exc_excep42_Test() [TestMethod] public void Exc_excep42b_Test() { - OutputHelper.WriteLine("Handle throws up to 33 levels deep."); + // Handle throws up to 33 levels deep. Assert.IsTrue(Exc_TestClass_excep42b.testMethod()); } @@ -167,7 +167,7 @@ public void Exc_excep42b_Test() [TestMethod] public void Exc_excep43_Test() { - OutputHelper.WriteLine("Handle throws up to 255 levels deep, but don't catch. VM should not die."); + // Handle throws up to 255 levels deep, but don't catch. VM should not die. Assert.IsTrue(Exc_TestClass_excep43.testMethod()) { return MFTestResults.Pass; @@ -178,76 +178,76 @@ public void Exc_excep43_Test() [TestMethod] public void Exc_excep56_Test() { - OutputHelper.WriteLine("Should get unreachable code warning, but nothing more."); + // Should get unreachable code warning, but nothing more. Assert.IsTrue(Exc_TestClass_excep56.testMethod()); } [TestMethod] public void Exc_excep57_Test() { - OutputHelper.WriteLine("Should get unreachable code warning, but nothing more."); + // Should get unreachable code warning, but nothing more. Assert.IsTrue(Exc_TestClass_excep57.testMethod()); } [TestMethod] public void Exc_excep58_Test() { - OutputHelper.WriteLine("Any finally clauses associated with try statements will be executed before catch clause execution"); + // Any finally clauses associated with try statements will be executed before catch clause execution Assert.IsTrue(Exc_TestClass_excep58.testMethod()); } [TestMethod] public void Exc_excep59_Test() { - OutputHelper.WriteLine("Any finally clauses associated with try statements will be executed before catch clause execution"); + // Any finally clauses associated with try statements will be executed before catch clause execution Assert.IsTrue(Exc_TestClass_excep59.testMethod()); } [TestMethod] public void Exc_excep60_Test() { - OutputHelper.WriteLine("Inner exceptions can be chained"); + // Inner exceptions can be chained Assert.IsTrue(Exc_TestClass_excep60.testMethod()); } [TestMethod] public void Exc_excep61_Test() { - OutputHelper.WriteLine("Inner exceptions can be chained to arbitrary length"); + // Inner exceptions can be chained to arbitrary length Assert.IsTrue(Exc_TestClass_excep61.testMethod()); } [TestMethod] public void Exc_excep62_Test() { - OutputHelper.WriteLine("Any finally clauses associated with try statements will be executed before catch clause execution"); + // Any finally clauses associated with try statements will be executed before catch clause execution Assert.IsTrue(Exc_TestClass_excep62.testMethod()); } //[TestMethod] //public void Exc_excep63_Test() //{ - // OutputHelper.WriteLine("If a catch search reaches a static ctor then a Exception is thrown,"); - // OutputHelper.WriteLine("at the point of static ctor invocation. The inner exception is the original exception."); + // // If a catch search reaches a static ctor then a Exception is thrown, + // // at the point of static ctor invocation. The inner exception is the original exception. - // OutputHelper.WriteLine("an exception thrown in a static constructor brings up a dialog box in Visual Studio."); - // OutputHelper.WriteLine("Disable this test so that it doesn't hose VS until it is fixed."); + // // an exception thrown in a static constructor brings up a dialog box in Visual Studio. + // // Disable this test so that it doesn't hose VS until it is fixed. // // TODO: check this // Assert.IsTrue(Exc_TestClass_excep63.testMethod()); // { - // OutputHelper.WriteLine("This is bug number: 21724 Resolved By Design."); - // OutputHelper.WriteLine("This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. "); - // OutputHelper.WriteLine("When this bug is fixed change this back to pass and chang eht known failure to fail"); + // // This is bug number: 21724 Resolved By Design. + // // This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. + // // When this bug is fixed change this back to pass and chang eht known failure to fail // } //} //[TestMethod] //public void Exc_excep64_Test() //{ - // OutputHelper.WriteLine("If a catch search reaches a static field initializer then a Exception is thrown,"); - // OutputHelper.WriteLine("at the point of static ctor invocation. The inner exception is the original exception."); + // // If a catch search reaches a static field initializer then a Exception is thrown, + // // at the point of static ctor invocation. The inner exception is the original exception. - // OutputHelper.WriteLine("an exception thrown in a static constructor brings up a dialog box in Visual Studio."); - // OutputHelper.WriteLine("Disable this test so that it doesn't hose VS until it is fixed."); + // // an exception thrown in a static constructor brings up a dialog box in Visual Studio. + // // Disable this test so that it doesn't hose VS until it is fixed. // // TODO: check this // Assert.IsTrue(Exc_TestClass_excep64.testMethod()); // { - // OutputHelper.WriteLine("This is bug number: 21724 Resolved By Design."); - // OutputHelper.WriteLine("This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. "); + // // This is bug number: 21724 Resolved By Design. + // // This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. // } //} @@ -260,8 +260,8 @@ public void Exc_excep62_Test() [TestMethod] public void Exc_excep65_Test() { - OutputHelper.WriteLine("If a catch search reaches a static ctor then a Exception is thrown,"); - OutputHelper.WriteLine("at the point of static ctor invocation. The inner exception is the original exception."); + // If a catch search reaches a static ctor then a Exception is thrown, + // at the point of static ctor invocation. The inner exception is the original exception. Assert.IsTrue(Exc_TestClass_excep65.testMethod()) { @@ -279,12 +279,12 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exception("An exception has occurred"); } catch (Exception s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); retval = 0; } @@ -308,18 +308,18 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep02_E1("An exception has occurred"); } catch (Exc_TestClass_excep02_E1 s) { - OutputHelper.WriteLine("In Exc_TestClass_excep02_E1 catch block."); + // In Exc_TestClass_excep02_E1 catch block. OutputHelper.WriteLine(s.Message); retval = 0; } catch (Exception) { - OutputHelper.WriteLine("FAIL - In Exception catch block."); + // FAIL - In Exception catch block. retval = 2; } //catch (Exception e) @@ -343,24 +343,22 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exception("An exception has occurred"); } catch (Exception s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); retval -= 1; } } finally { - OutputHelper.WriteLine("Entering finally block"); + // Entering finally block retval -= 2; } - OutputHelper.WriteLine("Ready to return."); - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval=={0} " + retval.ToString()); + // Ready to return. return retval; } public static bool testMethod() @@ -383,24 +381,24 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep05_E1("An exception has occurred"); } catch (Exc_TestClass_excep05_E1 s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); retval--; } catch (Exception) { - OutputHelper.WriteLine("FAIL -- Should not enter catch (Exception) block"); + // FAIL -- Should not enter catch (Exception) block retval++; } } finally { - OutputHelper.WriteLine("In finally block"); + // In finally block --retval; } return retval; @@ -423,12 +421,12 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep06_E1("An exception has occurred"); } catch (Exception s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); retval = 0; } @@ -454,18 +452,18 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. } catch (Exception s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); retval++; } } finally { - OutputHelper.WriteLine("In finally block"); + // In finally block retval--; } return retval; @@ -482,12 +480,12 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exception("An exception has occurred"); } catch { - OutputHelper.WriteLine("In catch block."); + // In catch block. retval = 0; } return retval; @@ -510,17 +508,17 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exception("An exception has occurred"); } catch (Exc_TestClass_excep10_E1) { - OutputHelper.WriteLine("FAIL -- Should not enter catch (Exception a) block."); + // FAIL -- Should not enter catch (Exception a) block. retval = 1; } catch { - OutputHelper.WriteLine("In catch block."); + // In catch block. retval -= 1; } return retval; @@ -537,18 +535,18 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exception("An exception has occurred"); } catch (Exception r) { - OutputHelper.WriteLine("In catch (Exception r) block."); + // In catch (Exception r) block. OutputHelper.WriteLine(r.Message); retval -= 1; } catch { - OutputHelper.WriteLine("FAIL -- Should not enter catch () block."); + // FAIL -- Should not enter catch () block. retval += 1; } return retval; @@ -622,9 +620,9 @@ public static int Main_old() tossval = b.toss(0); if (tossval != 0) { - OutputHelper.WriteLine("toss(0) returned "); + // toss(0) returned OutputHelper.WriteLine(tossval.ToString()); - OutputHelper.WriteLine(" instead of 0."); + // instead of 0. } else { @@ -633,9 +631,9 @@ public static int Main_old() tossval = b.toss(1); if (tossval != 1) { - OutputHelper.WriteLine("toss(1) returned "); + // toss(1) returned OutputHelper.WriteLine(tossval.ToString()); - OutputHelper.WriteLine(" instead of 1."); + // instead of 1. } else { @@ -644,16 +642,14 @@ public static int Main_old() tossval = b.toss(2); if (tossval != 2) { - OutputHelper.WriteLine("toss(2) returned "); + // toss(2) returned OutputHelper.WriteLine(tossval.ToString()); - OutputHelper.WriteLine(" instead of 2."); + // instead of 2. } else { retval -= 1; } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -702,8 +698,6 @@ public static int Main_old() Exc_TestClass_excep30_C1 t = new Exc_TestClass_excep30_C1(); if (t.f00() == 30) // If the throw was handled properly... retval = 0; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -758,8 +752,6 @@ public static int Main_old() Exc_TestClass_excep31_C1 t = new Exc_TestClass_excep31_C1(); if (t.f00() == 0) // If the throw was handled properly... retval = 0; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -811,23 +803,21 @@ public static int Main_old() } catch (Exc_TestClass_excep33_E2) { - OutputHelper.WriteLine("Unexpected Exc_TestClass_excep33_E2 catch."); + // Unexpected Exc_TestClass_excep33_E2 catch. } catch (Exc_TestClass_excep33_E3) { - OutputHelper.WriteLine("Unexpected Exc_TestClass_excep33_E3 catch."); + // Unexpected Exc_TestClass_excep33_E3 catch. } catch (Exc_TestClass_excep33_E4) { - OutputHelper.WriteLine("Caught in Exc_TestClass_excep33_E4, as expected."); + // Caught in Exc_TestClass_excep33_E4, as expected. retval = 0; } catch { - OutputHelper.WriteLine("Unexpected ... catch."); + // Unexpected ... catch. } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -871,19 +861,17 @@ public static int Main_old() } catch (Exc_TestClass_excep34_E2) { - OutputHelper.WriteLine("Unexpected Exc_TestClass_excep34_E2 catch.\n"); + // Unexpected Exc_TestClass_excep34_E2 catch.\n } catch (Exc_TestClass_excep34_E3) { - OutputHelper.WriteLine("Caught in Exc_TestClass_excep34_E3 as expected.\n"); + // Caught in Exc_TestClass_excep34_E3 as expected.\n retval = 0; } catch { - OutputHelper.WriteLine("Unexpected ... catch.\n"); + // Unexpected ... catch.\n } - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -922,8 +910,6 @@ public static int Main_old() { } retval = Exc_TestClass_excep35_V.counter; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -1002,8 +988,6 @@ public static int Main_old() f.f03(); if (Exc_TestClass_excep40_F.xpath == 1) retval -= 2; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -1028,13 +1012,13 @@ public void f01() { try { - OutputHelper.WriteLine("In f01(), throwing an Exc_TestClass_excep41_E3..."); + // In f01(), throwing an Exc_TestClass_excep41_E3... throw new Exc_TestClass_excep41_E3(); - OutputHelper.WriteLine("After throw in f01(). SHOULD NOT BE HERE!"); + // After throw in f01(). SHOULD NOT BE HERE! } catch (Exc_TestClass_excep41_E1) { - OutputHelper.WriteLine("In catch in f01()"); + // In catch in f01() xpath += 4; } } @@ -1042,13 +1026,13 @@ public void f00() { try { - OutputHelper.WriteLine("Calling f01()..."); + // Calling f01()... f01(); - OutputHelper.WriteLine("Returned from f01()"); + // Returned from f01() } catch (Exc_TestClass_excep41_E4) { - OutputHelper.WriteLine("In catch in f00()"); + // In catch in f00() xpath += 2; } } @@ -1061,19 +1045,17 @@ public static int Main_old() Exc_TestClass_excep41_F f = new Exc_TestClass_excep41_F(); try { - OutputHelper.WriteLine("Calling f00()..."); + // Calling f00()... f.f00(); - OutputHelper.WriteLine("Returned from f00()..."); + // Returned from f00()... } catch (Exc_TestClass_excep41_E3) { - OutputHelper.WriteLine("In catch in f00()"); + // In catch in f00() Exc_TestClass_excep41_F.xpath += 1; } if (Exc_TestClass_excep41_F.xpath == 1) retval--; - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, xpath=={0} " + (Exc_TestClass_excep41_F.xpath).ToString()); return retval; } public static bool testMethod() @@ -1102,7 +1084,7 @@ public void f255(int i) OutputHelper.WriteLine("i==" + i.ToString()); if (i == 255) { - OutputHelper.WriteLine("Throwing Exc_TestClass_excep42_E1"); + // Throwing Exc_TestClass_excep42_E1 tb = 0; throw s; } @@ -1376,17 +1358,14 @@ public static int Main_old() } catch (Exc_TestClass_excep42_E1) { - OutputHelper.WriteLine("Caught Exc_TestClass_excep42_E1"); + // Caught Exc_TestClass_excep42_E1 retval = Exc_TestClass_excep42_F.tb; } catch { - OutputHelper.WriteLine("Did not catch Exc_TestClass_excep42_E1"); + // Did not catch Exc_TestClass_excep42_E1 retval = -1; } - OutputHelper.WriteLine(retval.ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -1415,7 +1394,7 @@ public void f033(int i) OutputHelper.WriteLine("i==" + i.ToString()); if (i == 33) { - OutputHelper.WriteLine("Throwing Exc_TestClass_excep42b_E1"); + // Throwing Exc_TestClass_excep42b_E1 tb = 0; throw s; } @@ -1467,17 +1446,14 @@ public static int Main_old() } catch (Exc_TestClass_excep42b_E1) { - OutputHelper.WriteLine("Caught Exc_TestClass_excep42b_E1"); + // Caught Exc_TestClass_excep42b_E1 retval = Exc_TestClass_excep42b_F.tb; } catch { - OutputHelper.WriteLine("Did not catch Exc_TestClass_excep42b_E1"); + // Did not catch Exc_TestClass_excep42b_E1 retval = -1; } - OutputHelper.WriteLine(retval.ToString()); - if (retval == 0) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL"); return retval; } public static bool testMethod() @@ -1781,7 +1757,7 @@ public static int Main_old() retval = 0; } - if (retval == 0) OutputHelper.WriteLine("PASS"); + if (retval == 0) // PASS else OutputHelper.WriteLine("FAIL, retval=={0 }" + retval.ToString()); return retval; } @@ -1799,19 +1775,17 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block."); + // In try block. } finally { goto lab1; //This should cause an error - OutputHelper.WriteLine("Entering finally block"); + // Entering finally block retval -= 1; lab1: retval -= 2; } - OutputHelper.WriteLine("Ready to return."); - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval=={0} " + retval.ToString()); + // Ready to return. return retval; } public static bool testMethod() @@ -1826,12 +1800,12 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block."); + // In try block. } finally { goto lab4; //This should cause an error - OutputHelper.WriteLine("Entering finally block"); + // Entering finally block retval -= 1; lab1: retval -= 2; @@ -1842,9 +1816,7 @@ public static int Main_old() lab4: retval -= 5; } - OutputHelper.WriteLine("Ready to return."); - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval=={0}" + retval.ToString()); + // Ready to return. return retval; } public static bool testMethod() @@ -1867,7 +1839,7 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep58_E1("An exception has occurred"); } //catch (Exception s){ @@ -1876,7 +1848,7 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In inner finally block"); + // In inner finally block retval ^= 0x01; } } @@ -1884,22 +1856,20 @@ public static int Main_old() { if (0 == (retval & 0x01)) retval ^= 0x02; - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); } catch (Exception) { - OutputHelper.WriteLine("FAIL -- Should not enter catch (Exception) block"); + // FAIL -- Should not enter catch (Exception) block retval++; } finally { - OutputHelper.WriteLine("In outer finally block"); + // In outer finally block if (0 == (retval & 0x03)) retval ^= 0x04; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == " + retval.ToString()); return retval; } public static bool testMethod() @@ -1924,7 +1894,7 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep59_E1("An exception has occurred"); } //catch (Exception s) @@ -1934,7 +1904,7 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In innermost finally block"); + // In innermost finally block retval ^= 0x01; } } @@ -1944,7 +1914,7 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In middle finally block"); + // In middle finally block if (0 == (retval & 0x01)) retval ^= 0x02; } @@ -1953,22 +1923,20 @@ public static int Main_old() { if (0 == (retval & 0x03)) retval ^= 0x04; - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); } catch (Exception) { - OutputHelper.WriteLine("FAIL -- Should not enter catch (Exception) block"); + // FAIL -- Should not enter catch (Exception) block retval++; } finally { - OutputHelper.WriteLine("In outer finally block"); + // In outer finally block if (0 == (retval & 0x07)) retval ^= 0x08; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == " + retval.ToString()); return retval; } public static bool testMethod() @@ -1993,7 +1961,7 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep60_E1("An exception has occurred"); } //catch (Exception s) @@ -2003,13 +1971,13 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In innermost finally block"); + // In innermost finally block retval ^= 0x01; } } catch (Exc_TestClass_excep60_E1 s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); if (0 == (retval & 0x01)) retval ^= 0x02; @@ -2017,7 +1985,7 @@ public static int Main_old() } finally { - OutputHelper.WriteLine("In middle finally block"); + // In middle finally block if (0 == (retval & 0x03)) retval ^= 0x04; } @@ -2026,7 +1994,7 @@ public static int Main_old() { if (0 == (retval & 0x07)) retval ^= 0x08; - OutputHelper.WriteLine("In outer catch block."); + // In outer catch block. if (typeof(Exc_TestClass_excep60_E1) == s.InnerException.GetType()) retval ^= 0x10; } @@ -2036,12 +2004,10 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In outer finally block"); + // In outer finally block if (0 == (retval & 0x1F)) retval ^= 0x20; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == 0x" + retval.ToString()); return retval; } public static bool testMethod() @@ -2066,24 +2032,24 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exc_TestClass_excep61_E1("An exception has occurred"); } catch (Exc_TestClass_excep61_E1 s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); throw new Exception("Setting InnerException #1", s); } finally { - OutputHelper.WriteLine("In innermost finally block"); + // In innermost finally block retval ^= 0x01; } } catch (Exception s) { - OutputHelper.WriteLine("In catch block."); + // In catch block. OutputHelper.WriteLine(s.Message); if (0 == (retval & 0x01)) retval ^= 0x02; @@ -2091,7 +2057,7 @@ public static int Main_old() } finally { - OutputHelper.WriteLine("In middle finally block"); + // In middle finally block if (0 == (retval & 0x03)) retval ^= 0x04; } @@ -2100,7 +2066,7 @@ public static int Main_old() { if (0 == (retval & 0x07)) retval ^= 0x08; - OutputHelper.WriteLine("In outer catch block."); + // In outer catch block. if (typeof(Exception) == s.InnerException.GetType()) retval ^= 0x10; if (typeof(Exc_TestClass_excep61_E1) == s.InnerException.InnerException.GetType()) @@ -2112,12 +2078,10 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In outer finally block"); + // In outer finally block if (0 == (retval & 0x1F)) retval ^= 0x40; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == 0x" + retval.ToString()); return retval; } public static bool testMethod() @@ -2138,7 +2102,7 @@ public static int Main_old() { try { - OutputHelper.WriteLine("In try block, ready to throw."); + // In try block, ready to throw. throw new Exception("An exception has occurred"); } catch (Exception s) @@ -2152,12 +2116,10 @@ public static int Main_old() //} finally { - OutputHelper.WriteLine("In outer finally block"); + // In outer finally block if (0 == (retval & 0x01)) retval ^= 0x02; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == 0x" + retval.ToString()); return retval; } public static bool testMethod() @@ -2179,9 +2141,9 @@ static Exc_TestClass_excep63_SC() } public static void InitHelper() { - OutputHelper.WriteLine("This is bug number: 21724 Resolved By Design."); - OutputHelper.WriteLine("This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. "); - OutputHelper.WriteLine("When this bug is fixed change remove the comment below."); + // This is bug number: 21724 Resolved By Design. + // This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. + // When this bug is fixed change remove the comment below. throw new Exception("Exception in InitHelper"); } @@ -2200,8 +2162,6 @@ public static int Main_old() if (t.InnerException.GetType() == typeof(Exception)) retval ^= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == 0x" + retval.ToString()); return retval; } public static bool testMethod() @@ -2220,9 +2180,9 @@ public class Exc_TestClass_excep64_SC public static int StaticInt = InitHelper(); public static int InitHelper() { - OutputHelper.WriteLine("This is bug number: 21724 Resolved By Design."); - OutputHelper.WriteLine("This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. "); - OutputHelper.WriteLine("When this bug is fixed change this back to pass and chang eht known failure to fail"); + // This is bug number: 21724 Resolved By Design. + // This is bug number: 21724 If a catch search reaches a static ctor then a Exception is thrown at the point of static ctor invocation. The inner exception is the original exception. + // When this bug is fixed change this back to pass and chang eht known failure to fail throw new Exception("Exception in InitHelper"); return 0; @@ -2242,8 +2202,6 @@ public static int Main_old() if (t.InnerException.GetType() == typeof(Exception)) retval ^= 0x01; } - if (0 == retval) OutputHelper.WriteLine("PASS"); - else OutputHelper.WriteLine("FAIL, retval == 0x" + retval.ToString()); return retval; } public static bool testMethod() @@ -2265,7 +2223,7 @@ public class Exc_TestClass_excep65_C1 { retval ^= 0x01; OutputHelper.WriteLine("retval == " + retval.ToString()); - OutputHelper.WriteLine("In// Exc_TestClass_excep65_C1()"); + // In// Exc_TestClass_excep65_C1() } } public class Exc_TestClass_excep65_C2 : Exc_TestClass_excep65_C1 @@ -2275,9 +2233,9 @@ public class Derived : Exc_TestClass_excep65_C2 { ~Derived() { - OutputHelper.WriteLine("In ~Derived()"); + // In ~Derived() DtorHelper(); - OutputHelper.WriteLine("FAIL, did not exit dtor when exception thrown"); + // FAIL, did not exit dtor when exception thrown Exc_TestClass_excep65_C1.retval |= 0x02; } public static void DtorHelper() diff --git a/Tests/NFUnitTestGC/TestGC.cs b/Tests/NFUnitTestGC/TestGC.cs index 0ea02bba..3bf6bfcb 100644 --- a/Tests/NFUnitTestGC/TestGC.cs +++ b/Tests/NFUnitTestGC/TestGC.cs @@ -19,7 +19,7 @@ public void TestGCStress() int maxArraySize = 1024 * 32; object[] arrays = new object[600]; - OutputHelper.WriteLine("Starting TestGCStress"); + // Starting TestGCStress for (int loop = 0; loop < 100; loop++) { @@ -42,7 +42,7 @@ public void TestGCStress() } } - OutputHelper.WriteLine("Completed TestGCStress"); + // Completed TestGCStress } } } diff --git a/Tests/NFUnitTestGC/TestGCWithByteArrays.cs b/Tests/NFUnitTestGC/TestGCWithByteArrays.cs index 579d7ca8..045f1767 100644 --- a/Tests/NFUnitTestGC/TestGCWithByteArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithByteArrays.cs @@ -15,7 +15,7 @@ public class TestGCWithByteArrays [TestMethod] public void TestCompactionForNotFixedArray() { - OutputHelper.WriteLine("Starting TestCompactionForNotFixedArray"); + // Starting TestCompactionForNotFixedArray for (int loop = 0; loop < 10; loop++) { @@ -52,10 +52,10 @@ public void TestCompactionForNotFixedArray() index++; } - OutputHelper.WriteLine("No corruption detected in array"); + // No corruption detected in array } - OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + // Completed TestCompactionForNotFixedArray } void RunAllocations(byte[] arrObj) diff --git a/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs b/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs index e78cd0c5..102064ba 100644 --- a/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs @@ -15,7 +15,7 @@ public class TestGCWithDateTimeArrays [TestMethod] public void TestCompactionForNotFixedDateTimeArray() { - OutputHelper.WriteLine("Starting TestCompactionForNotFixedDateTimeArray"); + // Starting TestCompactionForNotFixedDateTimeArray for (int loop = 0; loop < 10; loop++) { @@ -33,14 +33,14 @@ public void TestCompactionForNotFixedDateTimeArray() testNativeBuffer[i] = new HolderForDateTime(GetRandomDateTime()); } - OutputHelper.WriteLine("Large HolderForDateTime array created"); - OutputHelper.WriteLine("Forcing compaction to occurr"); + // Large HolderForDateTime array created + // Forcing compaction to occurr // Causes compaction InitiateDateTimeCompaction(); - OutputHelper.WriteLine("Compaction occurred"); - OutputHelper.WriteLine("Checking arrays for corrupted data..."); + // Compaction occurred + // Checking arrays for corrupted data... int index = 0; @@ -51,10 +51,10 @@ public void TestCompactionForNotFixedDateTimeArray() index++; } - OutputHelper.WriteLine("No corruption detected in array"); + // No corruption detected in array } - OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + // Completed TestCompactionForNotFixedArray } // This function cause compaction to occur. diff --git a/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs b/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs index df0b9a3d..e11be754 100644 --- a/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs @@ -15,7 +15,7 @@ public class TestGCWithObjectArrays [TestMethod] public void TestCompactionForNotFixedArray() { - OutputHelper.WriteLine("Starting TestCompactionForNotFixedArray"); + // Starting TestCompactionForNotFixedArray for (int loop = 0; loop < 10; loop++) { @@ -52,10 +52,10 @@ public void TestCompactionForNotFixedArray() index++; } - OutputHelper.WriteLine("No corruption detected in array"); + // No corruption detected in array } - OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + // Completed TestCompactionForNotFixedArray } void RunAllocations(object[] arrObj) diff --git a/Tests/NFUnitTestGC/TestGCWithStringArrays.cs b/Tests/NFUnitTestGC/TestGCWithStringArrays.cs index b4372b3c..f69c30e1 100644 --- a/Tests/NFUnitTestGC/TestGCWithStringArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithStringArrays.cs @@ -15,7 +15,7 @@ public class TestGCWithStringArrays [TestMethod] public void TestCompactionForNotFixedStringArray() { - OutputHelper.WriteLine("Starting TestCompactionForNotFixedStringArray"); + // Starting TestCompactionForNotFixedStringArray for (int loop = 0; loop < 10; loop++) { @@ -35,14 +35,14 @@ public void TestCompactionForNotFixedStringArray() testNativeBuffer[i] = new HolderForString(Guid.NewGuid().ToString()); } - OutputHelper.WriteLine("Large HolderForString array created"); - OutputHelper.WriteLine("Forcing compaction to occurr"); + // Large HolderForString array created + // Forcing compaction to occurr // Causes compaction InitiateStringCompaction(); - OutputHelper.WriteLine("Compaction occurred"); - OutputHelper.WriteLine("Checking arrays for corrupted data..."); + // Compaction occurred + // Checking arrays for corrupted data... int index = 0; @@ -57,10 +57,10 @@ public void TestCompactionForNotFixedStringArray() index++; } - OutputHelper.WriteLine("No corruption detected in array"); + // No corruption detected in array } - OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + // Completed TestCompactionForNotFixedArray } // This function cause compaction to occur. diff --git a/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs b/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs index 1294deda..5d272ec3 100644 --- a/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs @@ -15,7 +15,7 @@ public class TestGCWithTimeSpanArrays [TestMethod] public void TestCompactionForNotFixedTimeSpanArray() { - OutputHelper.WriteLine("Starting TestCompactionForNotFixedTimeSpanArray"); + // Starting TestCompactionForNotFixedTimeSpanArray for (int loop = 0; loop < 10; loop++) { @@ -34,14 +34,14 @@ public void TestCompactionForNotFixedTimeSpanArray() testNativeBuffer[i] = new HolderForTimeSpan(GetRandomTimeSpan()); } - OutputHelper.WriteLine("Large HolderForTimeSpan array created"); - OutputHelper.WriteLine("Forcing compaction to occurr"); + // Large HolderForTimeSpan array created + // Forcing compaction to occurr // Causes compaction InitiateTimeSpanCompaction(); - OutputHelper.WriteLine("Compaction occurred"); - OutputHelper.WriteLine("Checking arrays for corrupted data..."); + // Compaction occurred + // Checking arrays for corrupted data... int index = 0; @@ -52,10 +52,10 @@ public void TestCompactionForNotFixedTimeSpanArray() index++; } - OutputHelper.WriteLine("No corruption detected in array"); + // No corruption detected in array } - OutputHelper.WriteLine("Completed TestCompactionForNotFixedArray"); + // Completed TestCompactionForNotFixedArray } private TimeSpan GetRandomTimeSpan() diff --git a/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs b/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs index 4ffb3268..d52cb308 100644 --- a/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs +++ b/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs @@ -17,344 +17,344 @@ public class UnitTestInterfaceTests [TestMethod] public void Interface_base_06_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("If effective visibility is internal, public iface may have an internal base iface "); - OutputHelper.WriteLine("(Bug 86453: has some details on this. But it has to do with class internal)"); + // Section 13.1 Interface declarations + // If effective visibility is internal, public iface may have an internal base iface + // (Bug 86453: has some details on this. But it has to do with class internal) Assert.IsTrue(Interface_TestClass_base_06.testMethod()); } [TestMethod] public void Interface_decl_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared in global namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared in global namespace Assert.IsTrue(Interface_TestClass_decl_01.testMethod()); } [TestMethod] public void Interface_decl_03_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared in class in default global namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared in class in default global namespace Assert.IsTrue(Interface_TestClass_decl_03.testMethod()); } [TestMethod] public void Interface_decl_05_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simple interface declaration with diff types of methods, args, and properties"); + // Section 13.1 Interface declarations + // Simple interface declaration with diff types of methods, args, and properties Assert.IsTrue(Interface_TestClass_decl_05.testMethod()); } [TestMethod] public void Interface_decl_06_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simple interface declaration properties with only gets"); + // Section 13.1 Interface declarations + // Simple interface declaration properties with only gets Assert.IsTrue(Interface_TestClass_decl_06.testMethod()); } [TestMethod] public void Interface_decl_07_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simple interface declaration properties with only sets"); + // Section 13.1 Interface declarations + // Simple interface declaration properties with only sets Assert.IsTrue(Interface_TestClass_decl_07.testMethod()); } [TestMethod] public void Interface_inherit_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify that an interface can be hidden by 'new' member in derived class"); + // Section 13.1 Interface declarations + // Verify that an interface can be hidden by 'new' member in derived class Assert.IsTrue(Interface_TestClass_inherit_01.testMethod()); } [TestMethod] public void Interface_inherit_02_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest form of interface inheritance"); + // Section 13.1 Interface declarations + // Simplest form of interface inheritance Assert.IsTrue(Interface_TestClass_inherit_02.testMethod()); } [TestMethod] public void Interface_inherit_03_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest form of interface inheritance, inheriting multiple interfaces"); + // Section 13.1 Interface declarations + // Simplest form of interface inheritance, inheriting multiple interfaces Assert.IsTrue(Interface_TestClass_inherit_03.testMethod()); } [TestMethod] public void Interface_inherit_04_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest form of interface inheritance, inheriting multiple interfaces"); + // Section 13.1 Interface declarations + // Simplest form of interface inheritance, inheriting multiple interfaces Assert.IsTrue(Interface_TestClass_inherit_04.testMethod()); } [TestMethod] public void Interface_inherit_08_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify that an interface hidden without using new results in warning"); + // Section 13.1 Interface declarations + // Verify that an interface hidden without using new results in warning Assert.IsTrue(Interface_TestClass_inherit_08.testMethod()); } [TestMethod] public void Interface_modifier_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify public and internal interfaces declared in global namespace are valid"); + // Section 13.1 Interface declarations + // Verify public and internal interfaces declared in global namespace are valid Assert.IsTrue(Interface_TestClass_modifier_01.testMethod()); } [TestMethod] public void Interface_modifier_05_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify public and internal interfaces are valid inside classes"); + // Section 13.1 Interface declarations + // Verify public and internal interfaces are valid inside classes Assert.IsTrue(Interface_TestClass_modifier_05.testMethod()); } [TestMethod] public void Interface_modifier_06_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify private and protected interfaces are valid inside classes"); + // Section 13.1 Interface declarations + // Verify private and protected interfaces are valid inside classes Assert.IsTrue(Interface_TestClass_modifier_06.testMethod()); } [TestMethod] public void Interface_modifier_07_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify new interface gens warning if not hiding anything"); + // Section 13.1 Interface declarations + // Verify new interface gens warning if not hiding anything Assert.IsTrue(Interface_TestClass_modifier_07.testMethod()); } [TestMethod] public void Interface_modifier_08_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify new interface is valid inside classes when properly hiding an inherited member"); + // Section 13.1 Interface declarations + // Verify new interface is valid inside classes when properly hiding an inherited member Assert.IsTrue(Interface_TestClass_modifier_08.testMethod()); } [TestMethod] public void Interface_modifier_10_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify protected internal interfaces are valid inside classes"); + // Section 13.1 Interface declarations + // Verify protected internal interfaces are valid inside classes Assert.IsTrue(Interface_TestClass_modifier_10.testMethod()); } [TestMethod] public void Interface_semicolon_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared (with semi-colon) in global namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared (with semi-colon) in global namespace Assert.IsTrue(Interface_TestClass_semicolon_01.testMethod()); } [TestMethod] public void Interface_semicolon_03_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared (with semi-colon) in class in default global namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared (with semi-colon) in class in default global namespace Assert.IsTrue(Interface_TestClass_semicolon_03.testMethod()); } [TestMethod] public void Interface_impl_04_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("A member of an interface-type can be assigned an instance of class that implements it"); + // Section 13.4 Interface implementations + // A member of an interface-type can be assigned an instance of class that implements it Assert.IsTrue(Interface_TestClass_impl_04.testMethod()); } [TestMethod] public void Interface_impl_05_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Warning gets generated when two methods implement an inherited method"); + // Section 13.4 Interface implementations + // Warning gets generated when two methods implement an inherited method Assert.IsTrue(Interface_TestClass_impl_05.testMethod()); } [TestMethod] public void Interface_impl_06_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Using the 'override' keyword allows you to hide previous method implementation"); + // Section 13.4 Interface implementations + // Using the 'override' keyword allows you to hide previous method implementation Assert.IsTrue(Interface_TestClass_impl_06.testMethod()); } [TestMethod] public void Interface_impl_07_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("A class that implements an interface with method, property, event, and indexer"); + // Section 13.4 Interface implementations + // A class that implements an interface with method, property, event, and indexer Assert.IsTrue(Interface_TestClass_impl_07.testMethod()); } [TestMethod] public void Interface_impl_08_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing method that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing method that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_impl_08.testMethod()); } [TestMethod] public void Interface_impl_09_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing property that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing property that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_impl_09.testMethod()); } [TestMethod] public void Interface_impl_10_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing an event that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing an event that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_impl_10.testMethod()); } [TestMethod] public void Interface_impl_11_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing an indexer that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing an indexer that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_impl_11.testMethod()); } [TestMethod] public void Interface_impl_12_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("The members of base class participate in interface mapping"); + // Section 13.4 Interface implementations + // The members of base class participate in interface mapping Assert.IsTrue(Interface_TestClass_impl_12.testMethod()); } [TestMethod] public void Interface_impl_13_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Two interfaces on the same object must resolve to the same reference"); + // Section 13.4 Interface implementations + // Two interfaces on the same object must resolve to the same reference Assert.IsTrue(Interface_TestClass_impl_13.testMethod()); } [TestMethod] public void Interface_implinherit_01_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Interface methods implementation inheritance map as expected (1st/2nd example in 13.4.3)"); + // Section 13.4 Interface implementations + // Interface methods implementation inheritance map as expected (1st/2nd example in 13.4.3) Assert.IsTrue(Interface_TestClass_implinherit_01.testMethod()); } [TestMethod] public void Interface_implinherit_02_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Interface methods implementation inheritance (w/virtual) map as expected (3rd/4th example in 13.4.3)"); + // Section 13.4 Interface implementations + // Interface methods implementation inheritance (w/virtual) map as expected (3rd/4th example in 13.4.3) Assert.IsTrue(Interface_TestClass_implinherit_02.testMethod()); } [TestMethod] public void Interface_explicit_04_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of a method"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of a method Assert.IsTrue(Interface_TestClass_explicit_04.testMethod()); } [TestMethod] public void Interface_explicit_05_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of a property"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of a property Assert.IsTrue(Interface_TestClass_explicit_05.testMethod()); } [TestMethod] public void Interface_explicit_06_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of an event (Bug 89766)"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of an event (Bug 89766) Assert.IsTrue(Interface_TestClass_explicit_06.testMethod()); } [TestMethod] public void Interface_explicit_07_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of an indexer"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of an indexer Assert.IsTrue(Interface_TestClass_explicit_07.testMethod()); } [TestMethod] public void Interface_explicit_10_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (method) can be called through interface instances"); + // Section 13.4 Interface implementations + // Explicitly implemented members (method) can be called through interface instances Assert.IsTrue(Interface_TestClass_explicit_10.testMethod()); } [TestMethod] public void Interface_explicit_11_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (property) can be called through interface instances"); + // Section 13.4 Interface implementations + // Explicitly implemented members (property) can be called through interface instances Assert.IsTrue(Interface_TestClass_explicit_11.testMethod()); } [TestMethod] public void Interface_explicit_12_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (indexer) can be called through interface instances"); + // Section 13.4 Interface implementations + // Explicitly implemented members (indexer) can be called through interface instances Assert.IsTrue(Interface_TestClass_explicit_12.testMethod()); } [TestMethod] public void Interface_explicit_13_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (event) can be called through interface instances (Bug 89766)"); + // Section 13.4 Interface implementations + // Explicitly implemented members (event) can be called through interface instances (Bug 89766) Assert.IsTrue(Interface_TestClass_explicit_13.testMethod()); } [TestMethod] public void Interface_explicit_21_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Hidden base interface members may be implemented in all of the ways used in this"); + // Section 13.4 Interface implementations + // Hidden base interface members may be implemented in all of the ways used in this Assert.IsTrue(Interface_TestClass_explicit_21.testMethod()); } [TestMethod] public void Interface_explicit_25_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implementing overloaded methods should work "); + // Section 13.4 Interface implementations + // Explicitly implementing overloaded methods should work Assert.IsTrue(Interface_TestClass_explicit_25.testMethod()); } [TestMethod] public void Interface_mdfrmeth_09_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("An abstract class can implement an interface's methods as abstract"); + // Section 13.4 Interface implementations + // An abstract class can implement an interface's methods as abstract Assert.IsTrue(Interface_TestClass_mdfrmeth_09.testMethod()); } [TestMethod] public void Interface_ifreimp_01_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("A class that inherits an interface implementation is permitted to re-implement the interface by including it in the base class list"); + // Section 13.4 Interface implementations + // A class that inherits an interface implementation is permitted to re-implement the interface by including it in the base class list // Known failure Assert.IsFalse(Interface_TestClass_ifreimp_01.testMethod()); } @@ -362,8 +362,8 @@ public void Interface_ifreimp_01_Test() [TestMethod] public void Interface_ifreimp_02_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Inherited public member declarations and inherited explicit interface member declarations participate in the interface mapping process for re-implemented interfaces (Bug 90165)"); + // Section 13.4 Interface implementations + // Inherited public member declarations and inherited explicit interface member declarations participate in the interface mapping process for re-implemented interfaces (Bug 90165) // Known failure Assert.IsFalse(Interface_TestClass_ifreimp_02.testMethod()); } @@ -371,426 +371,426 @@ public void Interface_ifreimp_02_Test() [TestMethod] public void Interface_ifreimp_03_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Interface reimplementation also reimplements the interface's base interfaces. Verify mapping is done correctly. (90165)"); - OutputHelper.WriteLine("This Test is an expected fail in the baseline, but has passed in recent testing"); + // Section 13.4 Interface implementations + // Interface reimplementation also reimplements the interface's base interfaces. Verify mapping is done correctly. (90165) + // This Test is an expected fail in the baseline, but has passed in recent testing Assert.IsTrue(Interface_TestClass_ifreimp_03.testMethod()); } [TestMethod] public void Interface_abstract_01_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("An abstract class is permitted to map base-interface methods onto abstract methods"); + // Section 13.4 Interface implementations + // An abstract class is permitted to map base-interface methods onto abstract methods Assert.IsTrue(Interface_TestClass_abstract_01.testMethod()); } [TestMethod] public void Interface_abstract_02_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("The abstract methods implementing interface methods must be overridden by inheriting classes"); + // Section 13.4 Interface implementations + // The abstract methods implementing interface methods must be overridden by inheriting classes Assert.IsTrue(Interface_TestClass_abstract_02.testMethod()); } [TestMethod] public void Interface_abstract_03_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementations are permitted to call abstract methods"); + // Section 13.4 Interface implementations + // Explicit interface member implementations are permitted to call abstract methods Assert.IsTrue(Interface_TestClass_abstract_03.testMethod()); } [TestMethod] public void Interface_indexer_02_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Simplest interface indexer declaration (int)"); + // Section 13.2 Interface members + // Simplest interface indexer declaration (int) Assert.IsTrue(Interface_TestClass_indexer_02.testMethod()); } [TestMethod] public void Interface_indexer_03_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Simplest interface indexer declaration (String)"); + // Section 13.2 Interface members + // Simplest interface indexer declaration (String) Assert.IsTrue(Interface_TestClass_indexer_03.testMethod()); } [TestMethod] public void Interface_indexer_04_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Simplest interface indexer declaration (user-defined struct)"); + // Section 13.2 Interface members + // Simplest interface indexer declaration (user-defined struct) Assert.IsTrue(Interface_TestClass_indexer_04.testMethod()); } [TestMethod] public void Interface_indexer_05_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Interface indexer with multiple parameters in formal-index-parameter-list"); + // Section 13.2 Interface members + // Interface indexer with multiple parameters in formal-index-parameter-list Assert.IsTrue(Interface_TestClass_indexer_05.testMethod()); } [TestMethod] public void Interface_indexer_06_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Interface indexer with just get accessor"); + // Section 13.2 Interface members + // Interface indexer with just get accessor Assert.IsTrue(Interface_TestClass_indexer_06.testMethod()); } [TestMethod] public void Interface_indexer_07_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Interface indexer with just set accessor"); + // Section 13.2 Interface members + // Interface indexer with just set accessor Assert.IsTrue(Interface_TestClass_indexer_07.testMethod()); } [TestMethod] public void Interface_indexer_18_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Using 'new' on an interface member (indexer) that doesn't hide an inherited member should gen warning "); - OutputHelper.WriteLine("(Related Bug: 86609)"); + // Section 13.2 Interface members + // Using 'new' on an interface member (indexer) that doesn't hide an inherited member should gen warning + // (Related Bug: 86609) Assert.IsTrue(Interface_TestClass_indexer_18.testMethod()); } [TestMethod] public void Interface_meth_09_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Using 'new' on an interface member (method) that doesn't hide an inherited member should gen warning (Bug: 86609)"); + // Section 13.2 Interface members + // Using 'new' on an interface member (method) that doesn't hide an inherited member should gen warning (Bug: 86609) Assert.IsTrue(Interface_TestClass_meth_09.testMethod()); } [TestMethod] public void Interface_prop_09_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Using 'new' on an interface member (property) that doesn't hide an inherited member should gen warning (Bug: 86609)"); + // Section 13.2 Interface members + // Using 'new' on an interface member (property) that doesn't hide an inherited member should gen warning (Bug: 86609) Assert.IsTrue(Interface_TestClass_prop_09.testMethod()); } [TestMethod] public void Interface_namesig_02_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Member functions of an interface may have same name if they have diff args"); + // Section 13.2 Interface members + // Member functions of an interface may have same name if they have diff args Assert.IsTrue(Interface_TestClass_namesig_02.testMethod()); } [TestMethod] public void Interface_namesig_03_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Interface member that is hidden by an inheriting interface (without using new) gens warning"); + // Section 13.2 Interface members + // Interface member that is hidden by an inheriting interface (without using new) gens warning Assert.IsTrue(Interface_TestClass_namesig_03.testMethod()); } [TestMethod] public void Interface_namesig_04_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Interface that inherits 2 other interfaces that have a member with same sig"); + // Section 13.2 Interface members + // Interface that inherits 2 other interfaces that have a member with same sig Assert.IsTrue(Interface_TestClass_namesig_04.testMethod()); } [TestMethod] public void Interface_namesig_05_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Interface member that is hidden by an inheriting interface (using new) works correctly"); + // Section 13.2 Interface members + // Interface member that is hidden by an inheriting interface (using new) works correctly Assert.IsTrue(Interface_TestClass_namesig_05.testMethod()); } [TestMethod] public void Interface_events_08_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Using 'new' on an interface member (event) that doesn't hide an inherited member should gen warning (Bug: 118831)"); + // Section 13.2 Interface members + // Using 'new' on an interface member (event) that doesn't hide an inherited member should gen warning (Bug: 118831) Assert.IsTrue(Interface_TestClass_events_08.testMethod()); } [TestMethod] public void Interface_events_09_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Simple Event declaration within an interface"); + // Section 13.2 Interface members + // Simple Event declaration within an interface Assert.IsTrue(Interface_TestClass_events_09.testMethod()); } [TestMethod] public void Interface_maccess_01_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Inherited members with same sig, from diff interfaces, can be accessed through casting"); + // Section 13.2 Interface members + // Inherited members with same sig, from diff interfaces, can be accessed through casting Assert.IsTrue(Interface_TestClass_maccess_01.testMethod()); } [TestMethod] public void Interface_maccess_03_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Inherited members with same method names but diff args can be accessed by casting"); + // Section 13.2 Interface members + // Inherited members with same method names but diff args can be accessed by casting Assert.IsTrue(Interface_TestClass_maccess_03.testMethod()); } [TestMethod] public void Interface_maccess_04_Test() { - OutputHelper.WriteLine("Section 13.2 Interface members"); - OutputHelper.WriteLine("Inherited members with same method names but diff args should work if arg passed is not ambiguous (Regression bug: 90867)"); + // Section 13.2 Interface members + // Inherited members with same method names but diff args should work if arg passed is not ambiguous (Regression bug: 90867) Assert.IsTrue(Interface_TestClass_maccess_04.testMethod()); } [TestMethod] public void Interface_modifier_02_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify private interfaces gen error when declared in global namespace"); + // Section 13.1 Interface declarations + // Verify private interfaces gen error when declared in global namespace Assert.IsTrue(Interface_TestClass_modifier_02.testMethod()); } [TestMethod] public void Interface_modifier_03_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify protected interfaces gen error when declared in global namespace"); + // Section 13.1 Interface declarations + // Verify protected interfaces gen error when declared in global namespace Assert.IsTrue(Interface_TestClass_modifier_03.testMethod()); } [TestMethod] public void Interface_struct_impl_01_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Simple struct implementation of two interfaces"); + // Section 13.4 Interface implementations + // Simple struct implementation of two interfaces Assert.IsTrue(Interface_TestClass_struct_impl_01.testMethod()); } [TestMethod] public void Interface_struct_impl_02_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("A struct that implements an interface also implicitly implements all of the interface's base interfaces"); + // Section 13.4 Interface implementations + // A struct that implements an interface also implicitly implements all of the interface's base interfaces Assert.IsTrue(Interface_TestClass_struct_impl_02.testMethod()); } [TestMethod] public void Interface_struct_impl_04_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("A member of an interface-type can be assigned an instance of a struct that implements it"); + // Section 13.4 Interface implementations + // A member of an interface-type can be assigned an instance of a struct that implements it Assert.IsTrue(Interface_TestClass_struct_impl_04.testMethod()); } [TestMethod] public void Interface_struct_impl_05_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("A struct that implements an interface with a method, property, event, and indexer"); + // Section 13.4 Interface implementations + // A struct that implements an interface with a method, property, event, and indexer Assert.IsTrue(Interface_TestClass_struct_impl_05.testMethod()); } [TestMethod] public void Interface_struct_impl_06_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing a method that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing a method that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_struct_impl_06.testMethod()); } [TestMethod] public void Interface_struct_impl_07_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing a property that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing a property that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_struct_impl_07.testMethod()); } [TestMethod] public void Interface_struct_impl_08_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing an event that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing an event that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_struct_impl_08.testMethod()); } [TestMethod] public void Interface_struct_impl_09_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing an indexer that was defined identically by two different base-interfaces should work"); + // Section 13.4 Interface implementations + // Implementing an indexer that was defined identically by two different base-interfaces should work Assert.IsTrue(Interface_TestClass_struct_impl_09.testMethod()); } [TestMethod] public void Interface_struct_explicit_01_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementations"); + // Section 13.4 Interface implementations + // Explicit interface member implementations Assert.IsTrue(Interface_TestClass_struct_explicit_01.testMethod()); } [TestMethod] public void Interface_struct_explicit_03_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Implementing an iface method in a struct that doesn't list the iface as a base iface but does list a iface that inherits the iface should work"); + // Section 13.4 Interface implementations + // Implementing an iface method in a struct that doesn't list the iface as a base iface but does list a iface that inherits the iface should work Assert.IsTrue(Interface_TestClass_struct_explicit_03.testMethod()); } [TestMethod] public void Interface_struct_explicit_04_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of a method"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of a method Assert.IsTrue(Interface_TestClass_struct_explicit_04.testMethod()); } [TestMethod] public void Interface_struct_explicit_05_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of a property"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of a property Assert.IsTrue(Interface_TestClass_struct_explicit_05.testMethod()); } [TestMethod] public void Interface_struct_explicit_06_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of an event (Bug: 89766)"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of an event (Bug: 89766) Assert.IsTrue(Interface_TestClass_struct_explicit_06.testMethod()); } [TestMethod] public void Interface_struct_explicit_07_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicit interface member implementation of an indexer"); + // Section 13.4 Interface implementations + // Explicit interface member implementation of an indexer Assert.IsTrue(Interface_TestClass_struct_explicit_07.testMethod()); } [TestMethod] public void Interface_struct_explicit_09_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Multiple base interfaces and explicit interface member implementations work"); + // Section 13.4 Interface implementations + // Multiple base interfaces and explicit interface member implementations work Assert.IsTrue(Interface_TestClass_struct_explicit_09.testMethod()); } [TestMethod] public void Interface_struct_explicit_10_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (method) can be called through interface instances"); + // Section 13.4 Interface implementations + // Explicitly implemented members (method) can be called through interface instances Assert.IsTrue(Interface_TestClass_struct_explicit_10.testMethod()); } [TestMethod] public void Interface_struct_explicit_11_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (property) can be called through interface instances (Bug 90570)"); + // Section 13.4 Interface implementations + // Explicitly implemented members (property) can be called through interface instances (Bug 90570) Assert.IsTrue(Interface_TestClass_struct_explicit_11.testMethod()); } [TestMethod] public void Interface_struct_explicit_12_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (indexer) can be called through interface instances (Bug 90570)"); + // Section 13.4 Interface implementations + // Explicitly implemented members (indexer) can be called through interface instances (Bug 90570) Assert.IsTrue(Interface_TestClass_struct_explicit_12.testMethod()); } [TestMethod] public void Interface_struct_explicit_13_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implemented members (event) can be called through interface instances (89766)"); + // Section 13.4 Interface implementations + // Explicitly implemented members (event) can be called through interface instances (89766) Assert.IsTrue(Interface_TestClass_struct_explicit_13.testMethod()); } [TestMethod] public void Interface_struct_explicit_19_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Explicitly implementing member from interface not in base-list (but in base-list of a base interface) should work"); + // Section 13.4 Interface implementations + // Explicitly implementing member from interface not in base-list (but in base-list of a base interface) should work Assert.IsTrue(Interface_TestClass_struct_explicit_19.testMethod()); } [TestMethod] public void Interface_struct_explicit_20_Test() { - OutputHelper.WriteLine("Section 13.4 Interface implementations"); - OutputHelper.WriteLine("Hidden base interface members may be implemented in all of the ways used in this"); + // Section 13.4 Interface implementations + // Hidden base interface members may be implemented in all of the ways used in this Assert.IsTrue(Interface_TestClass_struct_explicit_20.testMethod()); } [TestMethod] public void Interface_struct_decl_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared in a struct in default global namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared in a struct in default global namespace Assert.IsTrue(Interface_TestClass_struct_decl_01.testMethod()); } [TestMethod] public void Interface_struct_decl_02_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared in a struct in a declared namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared in a struct in a declared namespace Assert.IsTrue(Interface_TestClass_decl_02_NS.Interface_TestClass_decl_02.testMethod()); } [TestMethod] public void Interface_struct_inherit_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest form of interface inheritance, inheriting multiple interfaces"); + // Section 13.1 Interface declarations + // Simplest form of interface inheritance, inheriting multiple interfaces Assert.IsTrue(Interface_TestClass_struct_inherit_01.testMethod()); } [TestMethod] public void Interface_struct_modifier_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify public and internal interfaces are valid inside structs"); + // Section 13.1 Interface declarations + // Verify public and internal interfaces are valid inside structs Assert.IsTrue(Interface_TestClass_struct_modifier_01.testMethod()); } [TestMethod] public void Interface_struct_modifier_02_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify private interfaces are valid inside structs"); + // Section 13.1 Interface declarations + // Verify private interfaces are valid inside structs Assert.IsTrue(Interface_TestClass_struct_modifier_02.testMethod()); } [TestMethod] public void Interface_struct_modifier_03_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Verify new interface gens warning if not hiding anything"); + // Section 13.1 Interface declarations + // Verify new interface gens warning if not hiding anything Assert.IsTrue(Interface_TestClass_struct_modifier_03.testMethod()); } [TestMethod] public void Interface_struct_semicolon_01_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared (with semi-colon) in a struct in default global namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared (with semi-colon) in a struct in default global namespace Assert.IsTrue(Interface_TestClass_struct_semicolon_01.testMethod()); } [TestMethod] public void Interface_struct_semicolon_02_Test() { - OutputHelper.WriteLine("Section 13.1 Interface declarations "); - OutputHelper.WriteLine("Simplest interface declared (with semi-colon) in a struct in a declared namespace"); + // Section 13.1 Interface declarations + // Simplest interface declared (with semi-colon) in a struct in a declared namespace Assert.IsTrue(Interface_TestClass_semicolon_02_NS.Interface_TestClass_semicolon_02.testMethod()); } @@ -815,7 +815,7 @@ class Interface_TestClass_decl_01 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -831,7 +831,7 @@ interface Interface_TestClass_decl_03_I } public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -962,7 +962,7 @@ class Interface_TestClass_inherit_04 : Interface_TestClass_inherit_04_C { public void m() { - OutputHelper.WriteLine("This works!"); + // This works! } public static void Main_old() @@ -1067,7 +1067,7 @@ class Interface_TestClass_semicolon_01 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -1083,7 +1083,7 @@ interface Interface_TestClass_semicolon_03_I }; public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -1149,7 +1149,7 @@ class Interface_TestClass_impl_04_C : Interface_TestClass_impl_04_I1 { public void F() { - OutputHelper.WriteLine("Interface_TestClass_impl_04_C.F()"); + // Interface_TestClass_impl_04_C.F() } } class Interface_TestClass_impl_04 @@ -1175,14 +1175,14 @@ class Interface_TestClass_impl_05_C : Interface_TestClass_impl_05_I1 { public void F() { - OutputHelper.WriteLine("Interface_TestClass_impl_05_C.F()"); + // Interface_TestClass_impl_05_C.F() } } class Interface_TestClass_impl_05_D : Interface_TestClass_impl_05_C { public void F() { - OutputHelper.WriteLine("Interface_TestClass_impl_05_D.F()"); + // Interface_TestClass_impl_05_D.F() } } class Interface_TestClass_impl_05 @@ -1211,14 +1211,14 @@ class Interface_TestClass_impl_06_C : Interface_TestClass_impl_06_I1 { public virtual void F() { - OutputHelper.WriteLine("Interface_TestClass_impl_06_C.F()"); + // Interface_TestClass_impl_06_C.F() } } class Interface_TestClass_impl_06_D : Interface_TestClass_impl_06_C { public override void F() { - OutputHelper.WriteLine("Interface_TestClass_impl_06_D.F()"); + // Interface_TestClass_impl_06_D.F() } } class Interface_TestClass_impl_06 @@ -1253,7 +1253,7 @@ class Interface_TestClass_impl_07_1 : Interface_TestClass_impl_07_I public void Method() { - OutputHelper.WriteLine("Method()"); + // Method() } public int Property { @@ -1446,14 +1446,14 @@ class Interface_TestClass_implinherit_01_1 : Interface_TestClass_implinherit_01_ { public void Paint() { - OutputHelper.WriteLine("Interface_TestClass_implinherit_01_1.Paint()"); + // Interface_TestClass_implinherit_01_1.Paint() } } class Interface_TestClass_implinherit_01_2 : Interface_TestClass_implinherit_01_1 { new public void Paint() { - OutputHelper.WriteLine("Interface_TestClass_implinherit_01_2.Paint()"); + // Interface_TestClass_implinherit_01_2.Paint() } } class Interface_TestClass_implinherit_01 @@ -1483,14 +1483,14 @@ class Interface_TestClass_implinherit_02_1 : Interface_TestClass_implinherit_02_ { public virtual void Paint() { - OutputHelper.WriteLine("Interface_TestClass_implinherit_02_1.Paint()"); + // Interface_TestClass_implinherit_02_1.Paint() } } class Interface_TestClass_implinherit_02_2 : Interface_TestClass_implinherit_02_1 { public override void Paint() { - OutputHelper.WriteLine("Interface_TestClass_implinherit_02_2.Paint()"); + // Interface_TestClass_implinherit_02_2.Paint() } } class Interface_TestClass_implinherit_02 @@ -1558,7 +1558,7 @@ class Interface_TestClass_explicit_04_2 : Interface_TestClass_explicit_04_1 { void Interface_TestClass_explicit_04_1.Method() { - OutputHelper.WriteLine("Method()"); + // Method() } } class Interface_TestClass_explicit_04 @@ -2002,7 +2002,7 @@ class Interface_TestClass_ifreimp_01_1 : Interface_TestClass_ifreimp_01_I1 { void Interface_TestClass_ifreimp_01_I1.Paint() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_01_1.Interface_TestClass_ifreimp_01_I1.Paint()"); + // Interface_TestClass_ifreimp_01_1.Interface_TestClass_ifreimp_01_I1.Paint() throw new Exception("Incorrect method got called!"); } } @@ -2010,7 +2010,7 @@ class Interface_TestClass_ifreimp_01_3 : Interface_TestClass_ifreimp_01_1, Inter { public void Paint() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_01_3.Paint()"); + // Interface_TestClass_ifreimp_01_3.Paint() } } class Interface_TestClass_ifreimp_01 @@ -2041,36 +2041,36 @@ class Interface_TestClass_ifreimp_02_2 : Interface_TestClass_ifreimp_02_I1 { void Interface_TestClass_ifreimp_02_I1.F() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_02_2.Interface_TestClass_ifreimp_02_I1.F()"); + // Interface_TestClass_ifreimp_02_2.Interface_TestClass_ifreimp_02_I1.F() throw new Exception("Incorrect method got called!"); } void Interface_TestClass_ifreimp_02_I1.G() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_02_2.Interface_TestClass_ifreimp_02_I1.G()"); + // Interface_TestClass_ifreimp_02_2.Interface_TestClass_ifreimp_02_I1.G() } public void H() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_02_2.H()"); + // Interface_TestClass_ifreimp_02_2.H() throw new Exception("Incorrect method got called!"); } public void I() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_02_2.I()"); + // Interface_TestClass_ifreimp_02_2.I() } } class Interface_TestClass_ifreimp_02_1 : Interface_TestClass_ifreimp_02_2, Interface_TestClass_ifreimp_02_I1 { public void F() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_02_1.F()"); + // Interface_TestClass_ifreimp_02_1.F() } void Interface_TestClass_ifreimp_02_I1.H() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_02_1.Interface_TestClass_ifreimp_02_I1.H()"); + // Interface_TestClass_ifreimp_02_1.Interface_TestClass_ifreimp_02_I1.H() } } class Interface_TestClass_ifreimp_02 @@ -2105,22 +2105,22 @@ class Interface_TestClass_ifreimp_03_C : Interface_TestClass_ifreimp_03_I3 { void Interface_TestClass_ifreimp_03_I2.F() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_03_C.Interface_TestClass_ifreimp_03_I2.F()"); + // Interface_TestClass_ifreimp_03_C.Interface_TestClass_ifreimp_03_I2.F() } void Interface_TestClass_ifreimp_03_I3.G() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_03_C.Interface_TestClass_ifreimp_03_I3.G()"); + // Interface_TestClass_ifreimp_03_C.Interface_TestClass_ifreimp_03_I3.G() } } class Interface_TestClass_ifreimp_03_D : Interface_TestClass_ifreimp_03_C, Interface_TestClass_ifreimp_03_I3 { public void F() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_03_D.F()"); + // Interface_TestClass_ifreimp_03_D.F() } public void G() { - OutputHelper.WriteLine("Interface_TestClass_ifreimp_03_D.G()"); + // Interface_TestClass_ifreimp_03_D.G() } } class Interface_TestClass_ifreimp_03 @@ -2352,11 +2352,11 @@ class Interface_TestClass_namesig_02_c : Interface_TestClass_namesig_02_1 { public void F(int x) { - OutputHelper.WriteLine("F(int x) works!"); + // F(int x) works! } public void F(String x) { - OutputHelper.WriteLine("F(String x) works!"); + // F(String x) works! } } class Interface_TestClass_namesig_02 @@ -2629,7 +2629,7 @@ struct Interface_TestClass_struct_impl_04_C : Interface_TestClass_struct_impl_04 { public void F() { - OutputHelper.WriteLine("Interface_TestClass_struct_impl_04_C.F()"); + // Interface_TestClass_struct_impl_04_C.F() } } class Interface_TestClass_struct_impl_04 @@ -2661,7 +2661,7 @@ struct Interface_TestClass_struct_impl_05_2 : Interface_TestClass_struct_impl_05 public void Method() { - OutputHelper.WriteLine("Method()"); + // Method() } public int Property { @@ -2844,7 +2844,7 @@ struct Interface_TestClass_struct_explicit_04_2 : Interface_TestClass_struct_exp { void Interface_TestClass_struct_explicit_04_1.Method() { - OutputHelper.WriteLine("Method()"); + // Method() } } class Interface_TestClass_struct_explicit_04 @@ -3232,7 +3232,7 @@ class Interface_TestClass_struct_decl_01 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3251,7 +3251,7 @@ struct Interface_TestClass_struct_inherit_01_1 : Interface_TestClass_struct_inhe { public void m() { - OutputHelper.WriteLine("This works!"); + // This works! } } class Interface_TestClass_struct_inherit_01 @@ -3317,7 +3317,7 @@ class Interface_TestClass_struct_semicolon_01 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3432,7 +3432,7 @@ public SampleOrder(DateTime purchase, double cost) // OutputHelper.WriteLine($"Data about {c.Name}"); // OutputHelper.WriteLine($"Joined on {c.DateJoined}. Made {c.PreviousOrders.Count} orders, the last on {c.LastOrder}"); - // OutputHelper.WriteLine("Reminders:"); + // // Reminders: // foreach (var item in c.Reminders) // { @@ -3467,7 +3467,7 @@ class Interface_TestClass_struct_decl_02 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3490,7 +3490,7 @@ class Interface_TestClass_struct_semicolon_02 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3511,7 +3511,7 @@ class Interface_TestClass_decl_02 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3532,7 +3532,7 @@ interface Interface_TestClass_semicolon_04_I }; public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3553,7 +3553,7 @@ class Interface_TestClass_semicolon_02 { public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { @@ -3574,7 +3574,7 @@ interface Interface_TestClass_decl_04_I } public static void Main_old() { - OutputHelper.WriteLine("This works!"); + // This works! } public static bool testMethod() { diff --git a/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs b/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs index 5ac278f8..964c397c 100644 --- a/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs +++ b/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs @@ -24,758 +24,758 @@ public class UnitTestLExicalTest1 [TestMethod] public void Lexical_comments_01_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_01.testMethod()); } [TestMethod] public void Lexical_comments_02_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_02.testMethod()); } [TestMethod] public void Lexical_comments_03_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_03.testMethod()); } [TestMethod] public void Lexical_comments_04_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_04.testMethod()); } [TestMethod] public void Lexical_comments_05_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_05.testMethod()); } [TestMethod] public void Lexical_comments_06_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_06.testMethod()); } [TestMethod] public void Lexical_comments_07_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_07.testMethod()); } [TestMethod] public void Lexical_comments_10_Test() { - OutputHelper.WriteLine("Section 2.4.4 Test"); - OutputHelper.WriteLine("Verifies valid/invalid comment"); + // Section 2.4.4 Test + // Verifies valid/invalid comment Assert.IsTrue(Lexical_TestClass_comments_10.testMethod()); } [TestMethod] public void Lexical_bool_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify true works on bools"); + // Section 2.4.9 Test + // verify true works on bools Assert.IsTrue(Lexical_TestClass_bool_01.testMethod()); } [TestMethod] public void Lexical_bool_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify false works on bools"); + // Section 2.4.9 Test + // verify false works on bools Assert.IsTrue(Lexical_TestClass_bool_02.testMethod()); } [TestMethod] public void Lexical_int_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify 0 as int literal"); + // Section 2.4.9 Test + // verify 0 as int literal Assert.IsTrue(Lexical_TestClass_int_01.testMethod()); } [TestMethod] public void Lexical_int_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify positive int literals"); + // Section 2.4.9 Test + // verify positive int literals Assert.IsTrue(Lexical_TestClass_int_02.testMethod()); } [TestMethod] public void Lexical_int_03_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify negative int literals"); + // Section 2.4.9 Test + // verify negative int literals Assert.IsTrue(Lexical_TestClass_int_03.testMethod()); } [TestMethod] public void Lexical_int_04_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify negative hex literals"); + // Section 2.4.9 Test + // verify negative hex literals Assert.IsTrue(Lexical_TestClass_int_04.testMethod()); } [TestMethod] public void Lexical_int_05_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify positive hex literals"); + // Section 2.4.9 Test + // verify positive hex literals Assert.IsTrue(Lexical_TestClass_int_05.testMethod()); } [TestMethod] public void Lexical_int_06_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify 0 as hex int literal"); + // Section 2.4.9 Test + // verify 0 as hex int literal Assert.IsTrue(Lexical_TestClass_int_06.testMethod()); } [TestMethod] public void Lexical_intsuffix_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("L/l suffix on longs"); + // Section 2.4.9 Test + // L/l suffix on longs Assert.IsTrue(Lexical_TestClass_intsuffix_01.testMethod()); } [TestMethod] public void Lexical_intsuffix_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("LU, Ul,uL,ul,LU,Lu,lU,lu suffix on ulongs"); + // Section 2.4.9 Test + // LU, Ul,uL,ul,LU,Lu,lU,lu suffix on ulongs Assert.IsTrue(Lexical_TestClass_intsuffix_02.testMethod()); } [TestMethod] public void Lexical_intsuffix_03_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("LU, Ul,uL,ul,LU,Lu,lU,lu suffix on ulongs"); + // Section 2.4.9 Test + // LU, Ul,uL,ul,LU,Lu,lU,lu suffix on ulongs Assert.IsTrue(Lexical_TestClass_intsuffix_03.testMethod()); } [TestMethod] public void Lexical_intsuffix_04_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("Verify UL,Ul,uL,ul,LU,Lu,lU,lu suffix are of type ulong"); + // Section 2.4.9 Test + // Verify UL,Ul,uL,ul,LU,Lu,lU,lu suffix are of type ulong Assert.IsTrue(Lexical_TestClass_intsuffix_04.testMethod()); } [TestMethod] public void Lexical_intsuffix_06_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("Verify L, l suffixes are of type uint"); + // Section 2.4.9 Test + // Verify L, l suffixes are of type uint Assert.IsTrue(Lexical_TestClass_intsuffix_06.testMethod()); } [TestMethod] public void Lexical_intsuffix_07_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("Using the lowercase 'l' suffix should generate a level 4 warning (VS7:86407)"); + // Section 2.4.9 Test + // Using the lowercase 'l' suffix should generate a level 4 warning (VS7:86407) Assert.IsTrue(Lexical_TestClass_intsuffix_07.testMethod()); } [TestMethod] public void Lexical_suff_typepick_03_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("Verify that literals with l, L suffixes are typed according to spec"); + // Section 2.4.9 Test + // Verify that literals with l, L suffixes are typed according to spec Assert.IsTrue(Lexical_TestClass_suff_typepick_03.testMethod()); } [TestMethod] public void Lexical_real_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify (+/-) double double literals"); + // Section 2.4.9 Test + // verify (+/-) double double literals Assert.IsTrue(Lexical_TestClass_real_01.testMethod()); } [TestMethod] public void Lexical_real_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); + // Section 2.4.9 Test Assert.IsTrue(Lexical_TestClass_real_02.testMethod()); } [TestMethod] public void Lexical_real_03_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify (-/+) non-double double literals"); + // Section 2.4.9 Test + // verify (-/+) non-double double literals Assert.IsTrue(Lexical_TestClass_real_03.testMethod()); } [TestMethod] public void Lexical_real_04_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify E and e (-/+) as double literals"); + // Section 2.4.9 Test + // verify E and e (-/+) as double literals Assert.IsTrue(Lexical_TestClass_real_04.testMethod()); } [TestMethod] public void Lexical_real_05_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify E and e (-/+) as double literals"); + // Section 2.4.9 Test + // verify E and e (-/+) as double literals Assert.IsTrue(Lexical_TestClass_real_05.testMethod()); } [TestMethod] public void Lexical_real_06_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify E and e (-/+) as double literals"); + // Section 2.4.9 Test + // verify E and e (-/+) as double literals Assert.IsTrue(Lexical_TestClass_real_06.testMethod()); } [TestMethod] public void Lexical_char_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify keyboard symbols as chars"); + // Section 2.4.9 Test + // verify keyboard symbols as chars Assert.IsTrue(Lexical_TestClass_char_01.testMethod()); } [TestMethod] public void Lexical_char_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify all escape sequences in section 2.4.9.4"); + // Section 2.4.9 Test + // verify all escape sequences in section 2.4.9.4 Assert.IsTrue(Lexical_TestClass_char_02.testMethod()); } [TestMethod] public void Lexical_char_03_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("Hex encoded Unicode characters"); + // Section 2.4.9 Test + // Hex encoded Unicode characters Assert.IsTrue(Lexical_TestClass_char_03.testMethod()); } [TestMethod] public void Lexical_realsuffix_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("D/d suffix on double literals"); - OutputHelper.WriteLine("Real suffixes"); + // Section 2.4.9 Test + // D/d suffix on double literals + // Real suffixes Assert.IsTrue(Lexical_TestClass_realsuffix_01.testMethod()); } [TestMethod] public void Lexical_realsuffix_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("F/f suffix on float literals"); - OutputHelper.WriteLine("Real suffixes"); + // Section 2.4.9 Test + // F/f suffix on float literals + // Real suffixes Assert.IsTrue(Lexical_TestClass_realsuffix_02.testMethod()); } [TestMethod] public void Lexical_string_01_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify escape sequences in string literals"); + // Section 2.4.9 Test + // verify escape sequences in string literals Assert.IsTrue(Lexical_TestClass_string_01.testMethod()); } [TestMethod] public void Lexical_string_02_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify hex escape sequences in string literals"); + // Section 2.4.9 Test + // verify hex escape sequences in string literals Assert.IsTrue(Lexical_TestClass_string_02.testMethod()); } [TestMethod] public void Lexical_string_03_Test() { - OutputHelper.WriteLine("Section 2.4.9 Test"); - OutputHelper.WriteLine("verify null strings work"); + // Section 2.4.9 Test + // verify null strings work Assert.IsTrue(Lexical_TestClass_string_03.testMethod()); } [TestMethod] public void Lexical_pre_001_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("simple pre processor"); + // Section 2.3Preprocessing + // simple pre processor Assert.IsTrue(Lexical_TestClass_pre_001.testMethod()); } [TestMethod] public void Lexical_pre_004_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("Verify that class name namespace isn't searched"); + // Section 2.3Preprocessing + // Verify that class name namespace isn't searched Assert.IsTrue(Lexical_TestClass_pre_004.testMethod()); } [TestMethod] public void Lexical_pre_005_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("Verify that invalid syntax doesn't mess up compiler in non-ifdef sections"); + // Section 2.3Preprocessing + // Verify that invalid syntax doesn't mess up compiler in non-ifdef sections Assert.IsTrue(Lexical_TestClass_pre_005.testMethod()); } [TestMethod] public void Lexical_pre_008_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("Verify #elif and #else"); + // Section 2.3Preprocessing + // Verify #elif and #else Assert.IsTrue(Lexical_TestClass_pre_008.testMethod()); } [TestMethod] public void Lexical_preproc_09_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#warning verification"); + // Section 2.3 Preprocessing + // #warning verification Assert.IsTrue(Lexical_TestClass_preproc_09.testMethod()); } [TestMethod] public void Lexical_preproc_30_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verifying comments and #preprocessor items"); - OutputHelper.WriteLine("This define should not be included #define TEST "); + // Section 2.3 Preprocessing + // Verifying comments and #preprocessor items + // This define should not be included #define TEST Assert.IsTrue(Lexical_TestClass_preproc_30.testMethod()); } [TestMethod] public void Lexical_preproc_38_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the code that is skipped because of an #if is not checked by compiler at all"); + // Section 2.3 Preprocessing + // Verify the code that is skipped because of an #if is not checked by compiler at all Assert.IsTrue(Lexical_TestClass_preproc_38.testMethod()); } [TestMethod] public void Lexical_line_02_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#line: Valid integer-literal passed to #line should work correctly with a real warning"); + // Section 2.3 Preprocessing + // #line: Valid integer-literal passed to #line should work correctly with a real warning Assert.IsTrue(Lexical_TestClass_line_02.testMethod()); } [TestMethod] public void Lexical_line_03_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#line: Valid integer-literal passed to #line should work correctly with a #warning directive"); + // Section 2.3 Preprocessing + // #line: Valid integer-literal passed to #line should work correctly with a #warning directive Assert.IsTrue(Lexical_TestClass_line_03.testMethod()); } [TestMethod] public void Lexical_line_06_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#line: Valid integer-literal/string-literal passed to #line should work correctly with a real warning"); + // Section 2.3 Preprocessing + // #line: Valid integer-literal/string-literal passed to #line should work correctly with a real warning Assert.IsTrue(Lexical_TestClass_line_06.testMethod()); } [TestMethod] public void Lexical_line_07_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#line: Valid integer-literal/string-literal passed to #line should work correctly with a #warning directive"); + // Section 2.3 Preprocessing + // #line: Valid integer-literal/string-literal passed to #line should work correctly with a #warning directive Assert.IsTrue(Lexical_TestClass_line_07.testMethod()); } [TestMethod] public void Lexical_line_26_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#line: Should work cleanly inside an #if-#endif block that evaluates to false"); + // Section 2.3 Preprocessing + // #line: Should work cleanly inside an #if-#endif block that evaluates to false Assert.IsTrue(Lexical_TestClass_line_26.testMethod()); } [TestMethod] public void Lexical_line_35_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#line: #line default in a false #if block should compile cleanly"); + // Section 2.3 Preprocessing + // #line: #line default in a false #if block should compile cleanly Assert.IsTrue(Lexical_TestClass_line_35.testMethod()); } [TestMethod] public void Lexical_region_01_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Make sure #region works without banner text"); + // Section 2.3 Preprocessing + // Make sure #region works without banner text Assert.IsTrue(Lexical_TestClass_region_01.testMethod()); } [TestMethod] public void Lexical_region_02_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Make sure #region works with banner text"); + // Section 2.3 Preprocessing + // Make sure #region works with banner text Assert.IsTrue(Lexical_TestClass_region_02.testMethod()); } [TestMethod] public void Lexical_region_05_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Nesting a #region inside another should work "); + // Section 2.3 Preprocessing + // Nesting a #region inside another should work Assert.IsTrue(Lexical_TestClass_region_05.testMethod()); } [TestMethod] public void Lexical_region_06_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Nesting five #region blocks should compile successfully "); + // Section 2.3 Preprocessing + // Nesting five #region blocks should compile successfully Assert.IsTrue(Lexical_TestClass_region_06.testMethod()); } [TestMethod] public void Lexical_region_07_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Nesting two #region blocks within a single #region block should compile successfully "); + // Section 2.3 Preprocessing + // Nesting two #region blocks within a single #region block should compile successfully Assert.IsTrue(Lexical_TestClass_region_07.testMethod()); } [TestMethod] public void Lexical_region_10_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Make sure #region works with banner text enclosed in double-quotes"); + // Section 2.3 Preprocessing + // Make sure #region works with banner text enclosed in double-quotes Assert.IsTrue(Lexical_TestClass_region_10.testMethod()); } [TestMethod] public void Lexical_region_11_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("A single-line comment following a #region should compile successfully"); + // Section 2.3 Preprocessing + // A single-line comment following a #region should compile successfully Assert.IsTrue(Lexical_TestClass_region_11.testMethod()); } [TestMethod] public void Lexical_region_12_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("A single-line comment following an #endregion should compile successfully"); + // Section 2.3 Preprocessing + // A single-line comment following an #endregion should compile successfully Assert.IsTrue(Lexical_TestClass_region_12.testMethod()); } [TestMethod] public void Lexical_region_15_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Any text following the #endregion directive should be ignored"); + // Section 2.3 Preprocessing + // Any text following the #endregion directive should be ignored Assert.IsTrue(Lexical_TestClass_region_15.testMethod()); } [TestMethod] public void Lexical_lineterm_01_Test() { - OutputHelper.WriteLine("Section 2.4 Lexical Analysis"); - OutputHelper.WriteLine("Test different ways to end a line with semi-colon"); + // Section 2.4 Lexical Analysis + // Test different ways to end a line with semi-colon Assert.IsTrue(Lexical_TestClass_lineterm_01.testMethod()); } [TestMethod] public void Lexical_atkeyword_03_Test() { - OutputHelper.WriteLine("Section 2.4 Lexical Analysis - Keywords"); - OutputHelper.WriteLine("The identifiers @test and test should refer to the same variable"); + // Section 2.4 Lexical Analysis - Keywords + // The identifiers @test and test should refer to the same variable Assert.IsTrue(Lexical_TestClass_atkeyword_03.testMethod()); } [TestMethod] public void Lexical_atkeyword_04_Test() { - OutputHelper.WriteLine("Section 2.4 Lexical Analysis - Keywords"); - OutputHelper.WriteLine("Verify that 'if' can be an identifier using unicode escape sequences as well as an @keyword"); + // Section 2.4 Lexical Analysis - Keywords + // Verify that 'if' can be an identifier using unicode escape sequences as well as an @keyword Assert.IsTrue(Lexical_TestClass_atkeyword_04.testMethod()); } [TestMethod] public void Lexical_atkeyword_05_Test() { - OutputHelper.WriteLine("Section 2.4 Lexical Analysis - Keywords"); - OutputHelper.WriteLine("Verify that prefixing an identifer that is prefixed by a double underscore does not generate warning"); + // Section 2.4 Lexical Analysis - Keywords + // Verify that prefixing an identifer that is prefixed by a double underscore does not generate warning Assert.IsTrue(Lexical_TestClass_atkeyword_05.testMethod()); } [TestMethod] public void Lexical_ident_01_Test() { - OutputHelper.WriteLine("Section 2.4.7 Identifiers"); - OutputHelper.WriteLine("identifier-start-character can be alphabetic"); + // Section 2.4.7 Identifiers + // identifier-start-character can be alphabetic Assert.IsTrue(Lexical_TestClass_ident_01.testMethod()); } [TestMethod] public void Lexical_ident_02_Test() { - OutputHelper.WriteLine("Section 2.4.7 Identifiers"); - OutputHelper.WriteLine("identifier-start-character can be an underscore"); + // Section 2.4.7 Identifiers + // identifier-start-character can be an underscore Assert.IsTrue(Lexical_TestClass_ident_02.testMethod()); } [TestMethod] public void Lexical_ident_03_Test() { - OutputHelper.WriteLine("Section 2.4.7 Identifiers"); - OutputHelper.WriteLine("identifier-part-character can be a number"); + // Section 2.4.7 Identifiers + // identifier-part-character can be a number Assert.IsTrue(Lexical_TestClass_ident_03.testMethod()); } [TestMethod] public void Lexical_ident_04_Test() { - OutputHelper.WriteLine("Section 2.4.7 Identifiers"); - OutputHelper.WriteLine("identifier-part-character can be a number (in the middle)"); + // Section 2.4.7 Identifiers + // identifier-part-character can be a number (in the middle) Assert.IsTrue(Lexical_TestClass_ident_04.testMethod()); } [TestMethod] public void Lexical_ident_05_Test() { - OutputHelper.WriteLine("Section 2.4.2 Identifiers"); - OutputHelper.WriteLine("Identifiers that start with double underscores (__) should not generate a warning/error though it used to"); + // Section 2.4.2 Identifiers + // Identifiers that start with double underscores (__) should not generate a warning/error though it used to Assert.IsTrue(Lexical_TestClass_ident_05.testMethod()); } [TestMethod] public void Lexical_ident_06_Test() { - OutputHelper.WriteLine("Section 2.4.2 Identifiers"); - OutputHelper.WriteLine("Identifiers that have embedded double underscores (__) should generate a warning/error though it used to"); + // Section 2.4.2 Identifiers + // Identifiers that have embedded double underscores (__) should generate a warning/error though it used to Assert.IsTrue(Lexical_TestClass_ident_06.testMethod()); } [TestMethod] public void Lexical_ident_07_Test() { - OutputHelper.WriteLine("Section 2.4.2 Identifiers"); - OutputHelper.WriteLine("Identifiers that end with double underscores (__) should generate a warning/error though it used to"); + // Section 2.4.2 Identifiers + // Identifiers that end with double underscores (__) should generate a warning/error though it used to Assert.IsTrue(Lexical_TestClass_ident_07.testMethod()); } [TestMethod] public void Lexical_nullunicode_01_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("A \\u0000 within comments should not stop compiler from reading to EOF"); + // Section 2.5 Lexical Analysis + // A \\u0000 within comments should not stop compiler from reading to EOF Assert.IsTrue(Lexical_TestClass_nullunicode_01.testMethod()); } [TestMethod] public void Lexical_nullunicode_03_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("A \\u0000 in a string should be equal to \x0000 and \0"); + // Section 2.5 Lexical Analysis + // A \\u0000 in a string should be equal to \x0000 and \0 Assert.IsTrue(Lexical_TestClass_nullunicode_03.testMethod()); } [TestMethod] public void Lexical_nullunicode_04_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("A \\u0000 is ignored if within preprocessor-excluded code"); + // Section 2.5 Lexical Analysis + // A \\u0000 is ignored if within preprocessor-excluded code Assert.IsTrue(Lexical_TestClass_nullunicode_04.testMethod()); } [TestMethod] public void Lexical_unicode_02_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("A simple program that is saved as utf-8 with Notepad compiles and runs correctly."); + // Section 2.5 Lexical Analysis + // A simple program that is saved as utf-8 with Notepad compiles and runs correctly. Assert.IsTrue(Lexical_TestClass_unicode_02.testMethod()); } [TestMethod] public void Lexical_unicode_04_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Displaying a unicode character with OutputHelper.WriteLine(().ToString())"); + // Section 2.5 Lexical Analysis + // Displaying a unicode character with OutputHelper.WriteLine(().ToString()) Assert.IsTrue(Lexical_TestClass_unicode_04.testMethod()); } [TestMethod] public void Lexical_unicode_05_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Displaying a unicode character with OutputHelper.WriteLine(().ToString())"); - OutputHelper.WriteLine("Since the correct language is not installed on my machine, should get a 'QQQ' as output"); + // Section 2.5 Lexical Analysis + // Displaying a unicode character with OutputHelper.WriteLine(().ToString()) + // Since the correct language is not installed on my machine, should get a 'QQQ' as output Assert.IsTrue(Lexical_TestClass_unicode_05.testMethod()); } [TestMethod] public void Lexical_unicode_06_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Identifier whose name is defined with \\uXXXX works correctly (Bug 111180)"); + // Section 2.5 Lexical Analysis + // Identifier whose name is defined with \\uXXXX works correctly (Bug 111180) Assert.IsTrue(Lexical_TestClass_unicode_06.testMethod()); } [TestMethod] public void Lexical_unicode_07_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Identifier whose name starts with \\uXXXX works correctly"); + // Section 2.5 Lexical Analysis + // Identifier whose name starts with \\uXXXX works correctly Assert.IsTrue(Lexical_TestClass_unicode_07.testMethod()); } [TestMethod] public void Lexical_unicode_08_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Identifier whose name has a \\uXXXX in the middle of it works correctly"); + // Section 2.5 Lexical Analysis + // Identifier whose name has a \\uXXXX in the middle of it works correctly Assert.IsTrue(Lexical_TestClass_unicode_08.testMethod()); } [TestMethod] public void Lexical_unicode_09_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Identifier whose name ends with a \\uXXXX works correctly "); + // Section 2.5 Lexical Analysis + // Identifier whose name ends with a \\uXXXX works correctly Assert.IsTrue(Lexical_TestClass_unicode_09.testMethod()); } [TestMethod] public void Lexical_unicode_10_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Unicode escape sequence to start preprocessor identifier"); - OutputHelper.WriteLine("Bug #33538 - Fixed"); + // Section 2.5 Lexical Analysis + // Unicode escape sequence to start preprocessor identifier + // Bug #33538 - Fixed Assert.IsTrue(Lexical_TestClass_unicode_10.testMethod()); } [TestMethod] public void Lexical_unicode_11_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Unicode escape sequence to start preprocessor identifier"); - OutputHelper.WriteLine("Bug #33538 - Fixed"); + // Section 2.5 Lexical Analysis + // Unicode escape sequence to start preprocessor identifier + // Bug #33538 - Fixed Assert.IsTrue(Lexical_TestClass_unicode_11.testMethod()); } [TestMethod] public void Lexical_unicode_12_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Unicode escape sequence to start preprocessor identifier"); - OutputHelper.WriteLine("Bug #33538 - Fixed"); + // Section 2.5 Lexical Analysis + // Unicode escape sequence to start preprocessor identifier + // Bug #33538 - Fixed Assert.IsTrue(Lexical_TestClass_unicode_12.testMethod()); } [TestMethod] public void Lexical_unicode_13_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Unicode escape sequence in middle of a #define (#de\\u0066ine)"); - OutputHelper.WriteLine("Bug #33538 - Fixed"); + // Section 2.5 Lexical Analysis + // Unicode escape sequence in middle of a #define (#de\\u0066ine) + // Bug #33538 - Fixed Assert.IsTrue(Lexical_TestClass_unicode_13.testMethod()); } [TestMethod] public void Lexical_unicode_17_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("The literal \\u0000 should not be interpreted as a unicode escape sequence"); + // Section 2.5 Lexical Analysis + // The literal \\u0000 should not be interpreted as a unicode escape sequence Assert.IsTrue(Lexical_TestClass_unicode_17.testMethod()); } [TestMethod] public void Lexical_uni8digit_01_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Identifier whose name is defined with \\uXXXXXXXX works correctly"); + // Section 2.5 Lexical Analysis + // Identifier whose name is defined with \\uXXXXXXXX works correctly Assert.IsTrue(Lexical_TestClass_uni8digit_01.testMethod()); } [TestMethod] public void Lexical_uni8digit_02_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Using OutputHelper.WriteLine with \\uXXXXXXXX works correctly"); + // Section 2.5 Lexical Analysis + // Using OutputHelper.WriteLine with \\uXXXXXXXX works correctly Assert.IsTrue(Lexical_TestClass_uni8digit_02.testMethod()); } [TestMethod] public void Lexical_uni8digit_03_Test() { - OutputHelper.WriteLine("Section 2.5 Lexical Analysis"); - OutputHelper.WriteLine("Verify valid boundaries of values for \\uXXXXXXXX work correctly"); + // Section 2.5 Lexical Analysis + // Verify valid boundaries of values for \\uXXXXXXXX work correctly Assert.IsTrue(Lexical_TestClass_uni8digit_03.testMethod()); } [TestMethod] public void Lexical_atstrings_01_Test() { - OutputHelper.WriteLine("Back-Quoted String Test"); - OutputHelper.WriteLine("Newlines should be valid within @-quoted string literals"); + // Back-Quoted String Test + // Newlines should be valid within @-quoted string literals Assert.IsTrue(Lexical_TestClass_atstrings_01.testMethod()); } [TestMethod] public void Lexical_atstrings_02_Test() { - OutputHelper.WriteLine("Back-Quoted String Test"); - OutputHelper.WriteLine("Unicode escape sequences are not processed within @-quoted string literals"); + // Back-Quoted String Test + // Unicode escape sequences are not processed within @-quoted string literals Assert.IsTrue(Lexical_TestClass_atstrings_02.testMethod()); } [TestMethod] public void Lexical_atstrings_03_Test() { - OutputHelper.WriteLine("Back-Quoted String Test"); - OutputHelper.WriteLine("Slash escape sequences are not processed within @-quoted string literals"); + // Back-Quoted String Test + // Slash escape sequences are not processed within @-quoted string literals Assert.IsTrue(Lexical_TestClass_atstrings_03.testMethod()); } [TestMethod] public void Lexical_atstrings_04_Test() { - OutputHelper.WriteLine("Back-Quoted String Test"); - OutputHelper.WriteLine("Passing @-quoted strings to OutputHelper.WriteLine(().ToString()) should work"); + // Back-Quoted String Test + // Passing @-quoted strings to OutputHelper.WriteLine(().ToString()) should work Assert.IsTrue(Lexical_TestClass_atstrings_04.testMethod()); } [TestMethod] public void Lexical_mscombo_01_Test() { - OutputHelper.WriteLine("XML Doc Test (Just lexical tests, no output validation)"); - OutputHelper.WriteLine("Combination of multi and single line xml doc comments"); + // XML Doc Test (Just lexical tests, no output validation) + // Combination of multi and single line xml doc comments Assert.IsTrue(Lexical_TestClass_mscombo_01.testMethod()); } [TestMethod] public void Lexical_mscombo_05_Test() { - OutputHelper.WriteLine("XML Doc Test (Just lexical tests, no output validation)"); - OutputHelper.WriteLine("Combination of multi and single line xml doc comments"); + // XML Doc Test (Just lexical tests, no output validation) + // Combination of multi and single line xml doc comments Assert.IsTrue(Lexical_TestClass_mscombo_05.testMethod()); } @@ -1560,9 +1560,9 @@ class Lexical_TestClass_preproc_30 public static void Main_old(String[] args) { #if TEST - OutputHelper.WriteLine("Bad"); + // Bad #else - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -1578,7 +1578,7 @@ public static void Main_old(String[] args) #if foo this code should be completely skipped #else - OutputHelper.WriteLine("Else triggered"); + // Else triggered #endif } public static bool testMethod() @@ -1679,7 +1679,7 @@ public class Lexical_TestClass_region_01 public static void Main_old() { #region - OutputHelper.WriteLine("This works!"); + // This works! #endregion } public static bool testMethod() @@ -1693,7 +1693,7 @@ public class Lexical_TestClass_region_02 public static void Main_old() { #region This is the banner text - OutputHelper.WriteLine("This works!"); + // This works! #endregion } public static bool testMethod() @@ -1707,11 +1707,11 @@ public class Lexical_TestClass_region_05 public static void Main_old() { #region - OutputHelper.WriteLine("1"); + // 1 #region - OutputHelper.WriteLine("2"); + // 2 #endregion - OutputHelper.WriteLine("3"); + // 3 #endregion } public static bool testMethod() @@ -1725,23 +1725,23 @@ public class Lexical_TestClass_region_06 public static void Main_old() { #region - OutputHelper.WriteLine("1"); + // 1 #region - OutputHelper.WriteLine("2"); + // 2 #region - OutputHelper.WriteLine("3"); + // 3 #region - OutputHelper.WriteLine("4"); + // 4 #region - OutputHelper.WriteLine("5"); + // 5 #endregion - OutputHelper.WriteLine("6"); + // 6 #endregion - OutputHelper.WriteLine("7"); + // 7 #endregion - OutputHelper.WriteLine("8"); + // 8 #endregion - OutputHelper.WriteLine("9"); + // 9 #endregion } public static bool testMethod() @@ -1755,15 +1755,15 @@ public class Lexical_TestClass_region_07 public static void Main_old() { #region - OutputHelper.WriteLine("1"); + // 1 #region - OutputHelper.WriteLine("2"); + // 2 #endregion - OutputHelper.WriteLine("3"); + // 3 #region - OutputHelper.WriteLine("4"); + // 4 #endregion - OutputHelper.WriteLine("5"); + // 5 #endregion } public static bool testMethod() @@ -1777,7 +1777,7 @@ public class Lexical_TestClass_region_10 public static void Main_old() { #region "This is the banner text" - OutputHelper.WriteLine("This works!"); + // This works! #endregion } public static bool testMethod() @@ -1791,7 +1791,7 @@ public class Lexical_TestClass_region_11 public static void Main_old() { #region // This is a single-line comment - OutputHelper.WriteLine("This works!"); + // This works! #endregion } public static bool testMethod() @@ -1805,7 +1805,7 @@ public class Lexical_TestClass_region_12 public static void Main_old() { #region - OutputHelper.WriteLine("This works!"); + // This works! #endregion // This is a single-line comment } public static bool testMethod() @@ -1823,7 +1823,7 @@ public class Lexical_TestClass_region_15 public static void Main_old() { #region - OutputHelper.WriteLine("This works!"); + // This works! #endregion This text should be ignored } public static bool testMethod() @@ -1836,8 +1836,8 @@ class Lexical_TestClass_lineterm_01 { public static void Main_old(String[] args) { - OutputHelper.WriteLine("1"); // normal - OutputHelper.WriteLine("2"); // space between + // 1 // normal + // 2 // space between OutputHelper.WriteLine("3") ; // ; on the next line OutputHelper.WriteLine("4") @@ -2003,7 +2003,7 @@ public static void Main_old() { // This should not stop the compiler from moving on \u0000 - OutputHelper.WriteLine("Worked"); + // Worked } public static bool testMethod() { @@ -2053,7 +2053,7 @@ class Lexical_TestClass_unicode_02 { public static void Main_old() { - OutputHelper.WriteLine("Worked!"); + // Worked! } public static bool testMethod() { @@ -2069,7 +2069,7 @@ class Lexical_TestClass_unicode_04 { public static void Main_old() { - OutputHelper.WriteLine("\u0057"); + // \u0057 } public static bool testMethod() { @@ -2081,7 +2081,7 @@ class Lexical_TestClass_unicode_05 { public static void Main_old() { - OutputHelper.WriteLine("\u0701"); + // \u0701 } public static bool testMethod() { @@ -2182,7 +2182,7 @@ class Lexical_TestClass_uni8digit_02 { static void Main_old() { - OutputHelper.WriteLine("\U00000057ash"); + // \U00000057ash } public static bool testMethod() { @@ -2293,7 +2293,7 @@ class Lexical_TestClass_unicode_10 public static void Main_old() { #if foobar2 - OutputHelper.WriteLine("Worked!"); + // Worked! #endif } public static bool testMethod() @@ -2307,7 +2307,7 @@ class Lexical_TestClass_unicode_11 public static void Main_old() { #if middlefoobar - OutputHelper.WriteLine("Worked!"); + // Worked! #endif } public static bool testMethod() @@ -2321,7 +2321,7 @@ class Lexical_TestClass_unicode_12 public static void Main_old() { #if endf - OutputHelper.WriteLine("Worked!"); + // Worked! #endif } public static bool testMethod() @@ -2335,7 +2335,7 @@ class Lexical_TestClass_unicode_13 public static void Main_old() { #if endf2 - OutputHelper.WriteLine("Worked!"); + // Worked! #endif } public static bool testMethod() diff --git a/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs b/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs index dfe685a9..1387cd1f 100644 --- a/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs +++ b/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs @@ -73,175 +73,175 @@ class UnitTestLexicalTest2 [TestMethod] public void Lexical_pre_009_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("Verify #define and #undef"); + // Section 2.3Preprocessing + // Verify #define and #undef Assert.IsTrue(Lexical_TestClass_pre_009.testMethod()); } [TestMethod] public void Lexical_pre_012_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("Verify #if operators and parens"); + // Section 2.3Preprocessing + // Verify #if operators and parens Assert.IsTrue(Lexical_TestClass_pre_012.testMethod()); } [TestMethod] public void Lexical_pre_013_Test() { - OutputHelper.WriteLine("Section 2.3Preprocessing"); - OutputHelper.WriteLine("Verify # commands with comments"); + // Section 2.3Preprocessing + // Verify # commands with comments Assert.IsTrue(Lexical_TestClass_pre_013.testMethod()); } [TestMethod] public void Lexical_preproc_03_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#define/#undef - verify #define works"); + // Section 2.3 Preprocessing + // #define/#undef - verify #define works Assert.IsTrue(Lexical_TestClass_preproc_03.testMethod()); } [TestMethod] public void Lexical_preproc_04_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("#define/#undef - verify #undef works"); + // Section 2.3 Preprocessing + // #define/#undef - verify #undef works Assert.IsTrue(Lexical_TestClass_preproc_04.testMethod()); } [TestMethod] public void Lexical_preproc_05_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Exact example used in spec definition - 2.3.1"); + // Section 2.3 Preprocessing + // Exact example used in spec definition - 2.3.1 Assert.IsTrue(Lexical_TestClass_preproc_05.testMethod()); } [TestMethod] public void Lexical_preproc_06_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Using #undef on a non-existing identifier compiles fine"); + // Section 2.3 Preprocessing + // Using #undef on a non-existing identifier compiles fine Assert.IsTrue(Lexical_TestClass_preproc_06.testMethod()); } [TestMethod] public void Lexical_preproc_07_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Nested #if's"); + // Section 2.3 Preprocessing + // Nested #if's Assert.IsTrue(Lexical_TestClass_preproc_07.testMethod()); } [TestMethod] public void Lexical_preproc_15_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the ! operator on #identifiers"); + // Section 2.3 Preprocessing + // Verify the ! operator on #identifiers Assert.IsTrue(Lexical_TestClass_preproc_15.testMethod()); } [TestMethod] public void Lexical_preproc_16_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the ! operator on #identifiers with parenthesis"); + // Section 2.3 Preprocessing + // Verify the ! operator on #identifiers with parenthesis Assert.IsTrue(Lexical_TestClass_preproc_16.testMethod()); } [TestMethod] public void Lexical_preproc_17_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the double ampersand operator works"); + // Section 2.3 Preprocessing + // Verify the double ampersand operator works Assert.IsTrue(Lexical_TestClass_preproc_17.testMethod()); } [TestMethod] public void Lexical_preproc_18_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the double ampersand operator works with parentheses"); + // Section 2.3 Preprocessing + // Verify the double ampersand operator works with parentheses Assert.IsTrue(Lexical_TestClass_preproc_18.testMethod()); } [TestMethod] public void Lexical_preproc_19_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the || operator works "); + // Section 2.3 Preprocessing + // Verify the || operator works Assert.IsTrue(Lexical_TestClass_preproc_19.testMethod()); } [TestMethod] public void Lexical_preproc_20_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the || operator works with parentheses"); + // Section 2.3 Preprocessing + // Verify the || operator works with parentheses Assert.IsTrue(Lexical_TestClass_preproc_20.testMethod()); } [TestMethod] public void Lexical_preproc_21_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the == operator works with/without parentheses"); + // Section 2.3 Preprocessing + // Verify the == operator works with/without parentheses Assert.IsTrue(Lexical_TestClass_preproc_21.testMethod()); } [TestMethod] public void Lexical_preproc_22_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the != operator works with/without parentheses"); + // Section 2.3 Preprocessing + // Verify the != operator works with/without parentheses Assert.IsTrue(Lexical_TestClass_preproc_22.testMethod()); } [TestMethod] public void Lexical_preproc_23_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Grouping operators: ! double ampersand || != == true false"); + // Section 2.3 Preprocessing + // Grouping operators: ! double ampersand || != == true false Assert.IsTrue(Lexical_TestClass_preproc_23.testMethod()); } [TestMethod] public void Lexical_preproc_24_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verifying comments and #preprocessor items"); + // Section 2.3 Preprocessing + // Verifying comments and #preprocessor items Assert.IsTrue(Lexical_TestClass_preproc_24.testMethod()); } [TestMethod] public void Lexical_preproc_25_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verifying comments and #preprocessor items"); + // Section 2.3 Preprocessing + // Verifying comments and #preprocessor items Assert.IsTrue(Lexical_TestClass_preproc_25.testMethod()); } [TestMethod] public void Lexical_preproc_31_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verifying comments and #preprocessor items"); + // Section 2.3 Preprocessing + // Verifying comments and #preprocessor items Assert.IsTrue(Lexical_TestClass_preproc_31.testMethod()); } [TestMethod] public void Lexical_preproc_32_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify the usage of #elif"); + // Section 2.3 Preprocessing + // Verify the usage of #elif Assert.IsTrue(Lexical_TestClass_preproc_32.testMethod()); } [TestMethod] public void Lexical_preproc_39_Test() { - OutputHelper.WriteLine("Section 2.3 Preprocessing"); - OutputHelper.WriteLine("Verify that a # keyword (i.e. for) can be used as a #preprocessor identifier"); + // Section 2.3 Preprocessing + // Verify that a # keyword (i.e. for) can be used as a #preprocessor identifier Assert.IsTrue(Lexical_TestClass_preproc_39.testMethod()); } @@ -322,11 +322,11 @@ public class Lexical_TestClass_preproc_03 { public static void Main_old(String[] args) { - OutputHelper.WriteLine("Starting!"); + // Starting! #if TESTDEF - OutputHelper.WriteLine("Good"); + // Good #else - OutputHelper.WriteLine("Bad"); + // Bad #endif } public static bool testMethod() @@ -340,16 +340,16 @@ public class Lexical_TestClass_preproc_04 { public static void Main_old(String[] args) { - OutputHelper.WriteLine("Starting!"); + // Starting! #if TESTDEF3 - OutputHelper.WriteLine("TESTDEF3 is defined"); + // TESTDEF3 is defined #else - OutputHelper.WriteLine("TESTDEF3 is not defined"); + // TESTDEF3 is not defined #endif #if TESTDEF2 - OutputHelper.WriteLine("TESTDEF2 is defined"); + // TESTDEF2 is defined #else - OutputHelper.WriteLine("TESTDEF2 not defined"); + // TESTDEF2 not defined #endif } public static bool testMethod() @@ -389,13 +389,13 @@ class Lexical_TestClass_preproc_07 { public static void Main_old(String[] args) { - OutputHelper.WriteLine("Starting:"); + // Starting: #if FOO3 - OutputHelper.WriteLine("Inside FOO"); + // Inside FOO #if BAR3 - OutputHelper.WriteLine("Inside BAR"); + // Inside BAR #else - OutputHelper.WriteLine("Inside BAR's else"); + // Inside BAR's else #endif #endif } @@ -410,9 +410,9 @@ class Lexical_TestClass_preproc_15 public static void Main_old(String[] args) { #if !TEST - OutputHelper.WriteLine("Problem"); + // Problem #else - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -427,9 +427,9 @@ class Lexical_TestClass_preproc_16 public static void Main_old(String[] args) { #if !(TEST) - OutputHelper.WriteLine("Problem"); + // Problem #else - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -444,10 +444,10 @@ class Lexical_TestClass_preproc_17 public static void Main_old(String[] args) { #if TEST && TEST2 - OutputHelper.WriteLine("Good"); + // Good #endif #if TEST && TEST3 - OutputHelper.WriteLine("Problem"); + // Problem #endif } public static bool testMethod() @@ -461,10 +461,10 @@ class Lexical_TestClass_preproc_18 public static void Main_old(String[] args) { #if (TEST && TEST2) - OutputHelper.WriteLine("Good"); + // Good #endif #if (TEST && TEST3) - OutputHelper.WriteLine("Problem"); + // Problem #endif } public static bool testMethod() @@ -478,13 +478,13 @@ class Lexical_TestClass_preproc_19 public static void Main_old(String[] args) { #if TEST || TEST2 - OutputHelper.WriteLine("Good"); + // Good #endif #if TEST3 || TEST2 - OutputHelper.WriteLine("Good"); + // Good #endif #if TEST3 || TEST4 - OutputHelper.WriteLine("Problem"); + // Problem #endif } public static bool testMethod() @@ -498,13 +498,13 @@ class Lexical_TestClass_preproc_20 public static void Main_old(String[] args) { #if (TEST || TEST2) - OutputHelper.WriteLine("Good"); + // Good #endif #if (TEST3 || TEST2) - OutputHelper.WriteLine("Good"); + // Good #endif #if (TEST3 || TEST4) - OutputHelper.WriteLine("Problem"); + // Problem #endif } public static bool testMethod() @@ -518,19 +518,19 @@ class Lexical_TestClass_preproc_21 public static void Main_old(String[] args) { #if TEST == TEST2 - OutputHelper.WriteLine("Good"); + // Good #endif #if (TEST == TEST2) - OutputHelper.WriteLine("Good"); + // Good #endif #if TEST==TEST2 - OutputHelper.WriteLine("Good"); + // Good #endif #if (TEST == TEST3) - OutputHelper.WriteLine("Bad"); + // Bad #endif #if TEST3 == TEST - OutputHelper.WriteLine("Bad"); + // Bad #endif } public static bool testMethod() @@ -544,22 +544,22 @@ class Lexical_TestClass_preproc_22 public static void Main_old(String[] args) { #if TEST != TEST2 - OutputHelper.WriteLine("Bad"); + // Bad #endif #if (TEST != TEST2) - OutputHelper.WriteLine("Bad"); + // Bad #endif #if TEST!=TEST2 - OutputHelper.WriteLine("Bad"); + // Bad #endif #if (TEST != TEST3) - OutputHelper.WriteLine("Good"); + // Good #endif #if TEST3 != TEST - OutputHelper.WriteLine("Good"); + // Good #endif #if TEST3!=TEST - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -573,19 +573,19 @@ class Lexical_TestClass_preproc_23 public static void Main_old(String[] args) { #if (TEST && TEST2) || (TEST3 || TEST4) - OutputHelper.WriteLine("1 - Good"); + // 1 - Good #endif #if (TEST3 == TEST4) || (TEST == TEST2) - OutputHelper.WriteLine("2 - Good"); + // 2 - Good #endif #if (TEST != TEST3) && (TEST2 != TEST4) - OutputHelper.WriteLine("3 - Good"); + // 3 - Good #endif #if (! TEST4) && (TEST2 == TEST) - OutputHelper.WriteLine("4 - Good"); + // 4 - Good #endif #if (TEST == true) && (TEST2 != false) - OutputHelper.WriteLine("5 - Good"); + // 5 - Good #endif } public static bool testMethod() @@ -599,7 +599,7 @@ class Lexical_TestClass_preproc_24 public static void Main_old(String[] args) { #if TEST - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -613,7 +613,7 @@ class Lexical_TestClass_preproc_25 public static void Main_old(String[] args) { #if TEST - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -627,9 +627,9 @@ class Lexical_TestClass_preproc_31 public static void Main_old(String[] args) { #if TEST - OutputHelper.WriteLine("Bad"); + // Bad #else - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() @@ -643,9 +643,9 @@ class Lexical_TestClass_preproc_32 public static void Main_old(String[] args) { #if TEST3 - OutputHelper.WriteLine("Bad"); + // Bad #elif TEST2 && TEST - OutputHelper.WriteLine("Good"); + // Good #endif } public static bool testMethod() diff --git a/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs b/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs index 2e38e5fe..06ccae15 100644 --- a/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs +++ b/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs @@ -19,377 +19,377 @@ public class UnitTestNamespaceTests [TestMethod] public void NS_attribute_01_Test() { - OutputHelper.WriteLine("Section 9.1 Compilation Units"); - OutputHelper.WriteLine("Verify that the CLSCompliant attribute is allowed at the assembly level in a comp. unit"); + // Section 9.1 Compilation Units + // Verify that the CLSCompliant attribute is allowed at the assembly level in a comp. unit Assert.IsTrue(NS_TestClass_attribute_01.testMethod()); } [TestMethod] public void NS_attribute_02_Test() { - OutputHelper.WriteLine("Section 9.1 Compilation Units"); - OutputHelper.WriteLine("Verify that the CLSCompliant attribute is allowed at the module level in a comp. unit (cause a warning)"); + // Section 9.1 Compilation Units + // Verify that the CLSCompliant attribute is allowed at the module level in a comp. unit (cause a warning) Assert.IsTrue(NS_TestClass_attribute_02.testMethod()) ; } [TestMethod] public void NS_compunit_01_Test() { - OutputHelper.WriteLine("Section 9.1 Compilation Units"); - OutputHelper.WriteLine("Verify that a program with multiple files depending on each other works"); + // Section 9.1 Compilation Units + // Verify that a program with multiple files depending on each other works Assert.IsTrue(NS_TestClass_compunit_01.testMethod()) ; } [TestMethod] public void NS_compunit_03_Test() { - OutputHelper.WriteLine("Section 9.1 Compilation Units"); - OutputHelper.WriteLine("Verify three source files all requiring each other in circular fashion compiles/runs successfully"); + // Section 9.1 Compilation Units + // Verify three source files all requiring each other in circular fashion compiles/runs successfully Assert.IsTrue(NS_TestClass_compunit_03.testMethod()); } [TestMethod] public void NS_compunit_04_Test() { - OutputHelper.WriteLine("Section 9.1 Compilation Units"); - OutputHelper.WriteLine("Two source files with their own namespaces, each have a class named A, and can be used successfully by a third file"); + // Section 9.1 Compilation Units + // Two source files with their own namespaces, each have a class named A, and can be used successfully by a third file Assert.IsTrue(NS_TestClass_compunit_04.testMethod()); } [TestMethod] public void NS_decl_01_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare the simplest namespace possible (without semi-colon at the end)"); + // Section 9.2 Namespace Declarations + // Declare the simplest namespace possible (without semi-colon at the end) Assert.IsTrue(NS_TestClass_decl_01.A.testMethod()); } [TestMethod] public void NS_decl_02_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare the simplest namespace possible (with semi-colon at the end)"); + // Section 9.2 Namespace Declarations + // Declare the simplest namespace possible (with semi-colon at the end) Assert.IsTrue(NS_TestClass_decl_02.A.testMethod()); } [TestMethod] public void NS_decl_03_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare a namespace inside another namespace"); + // Section 9.2 Namespace Declarations + // Declare a namespace inside another namespace Assert.IsTrue(NS_TestClass_decl_03.A.testMethod()); } [TestMethod] public void NS_decl_04_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare a namespace inside another namespace (with semicolon at end of nested ns decl)"); + // Section 9.2 Namespace Declarations + // Declare a namespace inside another namespace (with semicolon at end of nested ns decl) Assert.IsTrue(NS_TestClass_decl_04.A.testMethod()); } [TestMethod] public void NS_decl_05_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Two separately declared namespaces in one compilation unit (file)"); + // Section 9.2 Namespace Declarations + // Two separately declared namespaces in one compilation unit (file) Assert.IsTrue(NS_TestClass_decl_05.A.testMethod()); } [TestMethod] public void NS_decl_06_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Two separately declared namespaces in one compilation unit (file)"); + // Section 9.2 Namespace Declarations + // Two separately declared namespaces in one compilation unit (file) Assert.IsTrue(NS_TestClass_decl_06.A.testMethod()); } [TestMethod] public void NS_decl_08_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Access class member declared in external namespace directly when adding a Using"); + // Section 9.2 Namespace Declarations + // Access class member declared in external namespace directly when adding a Using Assert.IsTrue(NS_TestClass_decl_08.A.testMethod()); } [TestMethod] public void NS_decl_10_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Namespace identifier with . in it"); + // Section 9.2 Namespace Declarations + // Namespace identifier with . in it Assert.IsTrue(NS_TestClass_decl_10.foo.A.testMethod()); } [TestMethod] public void NS_decl_11_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Namespace identifier with .'s in it and underscores, etc."); + // Section 9.2 Namespace Declarations + // Namespace identifier with .'s in it and underscores, etc. Assert.IsTrue(NS_TestClass_decl_11.foo.A.testMethod()); } [TestMethod] public void NS_decl_12_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Two separate namespace declarations contribute to same declaration space (with using)"); + // Section 9.2 Namespace Declarations + // Two separate namespace declarations contribute to same declaration space (with using) Assert.IsTrue(NS_TestClass_decl_12.foo.A.testMethod()); } [TestMethod] public void NS_decl_13_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Two separate namespace declarations contribute to same declaration space (direct referencing)"); + // Section 9.2 Namespace Declarations + // Two separate namespace declarations contribute to same declaration space (direct referencing) Assert.IsTrue(NS_TestClass_decl_13.foo.A.testMethod()); } [TestMethod] public void NS_decl_14_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Two separate namespace declarations contribute to same declaration space (direct referencing)"); - OutputHelper.WriteLine(" namespace declarations are in two different compilation units (files)"); + // Section 9.2 Namespace Declarations + // Two separate namespace declarations contribute to same declaration space (direct referencing) + // namespace declarations are in two different compilation units (files) Assert.IsTrue(NS_TestClass_decl_14.foo.A.testMethod()); } [TestMethod] public void NS_decl_15_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Two separate namespace declarations contribute to same declaration space (with using)"); - OutputHelper.WriteLine(" namespace declarations are in two different compilation units (files)"); + // Section 9.2 Namespace Declarations + // Two separate namespace declarations contribute to same declaration space (with using) + // namespace declarations are in two different compilation units (files) Assert.IsTrue(NS_TestClass_decl_15.foo.A.testMethod()); } [TestMethod] public void NS_decl_17_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare a namespace called _Foo"); + // Section 9.2 Namespace Declarations + // Declare a namespace called _Foo Assert.IsTrue(NS_TestClass_decl_17.main.testMethod()); } [TestMethod] public void NS_decl_20_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare an empty namespace"); + // Section 9.2 Namespace Declarations + // Declare an empty namespace Assert.IsTrue(NS_TestClass_decl_20.main.testMethod()); } [TestMethod] public void NS_decl_21_Test() { - OutputHelper.WriteLine("Section 9.2 Namespace Declarations"); - OutputHelper.WriteLine("Declare ten empty nested namespaces (with and without semi-colons)"); + // Section 9.2 Namespace Declarations + // Declare ten empty nested namespaces (with and without semi-colons) Assert.IsTrue(NS_TestClass_decl_21.main.testMethod()); } [TestMethod] public void NS_alias_01_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using alias directives "); - OutputHelper.WriteLine("Verify simplest form of alias reference to a namespace"); + // Section 9.3.1 Using alias directives + // Verify simplest form of alias reference to a namespace Assert.IsTrue(NS_TestClass_alias_01.A.testMethod()); } [TestMethod] public void NS_alias_02_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using alias directives "); - OutputHelper.WriteLine("Verify simplest form of alias reference to a namespace with .'s"); + // Section 9.3.1 Using alias directives + // Verify simplest form of alias reference to a namespace with .'s Assert.IsTrue(NS_TestClass_alias_02.A.testMethod()); } [TestMethod] public void NS_alias_03_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using alias directives "); - OutputHelper.WriteLine("Verify simplest form of alias reference to a specific type in a namespace"); + // Section 9.3.1 Using alias directives + // Verify simplest form of alias reference to a specific type in a namespace Assert.IsTrue(NS_TestClass_alias_03.A.testMethod()); } [TestMethod] public void NS_alias_04_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using alias directives "); - OutputHelper.WriteLine("Verify simplest form of alias reference to a specific type in a namespace"); + // Section 9.3.1 Using alias directives + // Verify simplest form of alias reference to a specific type in a namespace Assert.IsTrue(NS_TestClass_alias_04.B.testMethod()); } [TestMethod] public void NS_alias_10_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using alias directives "); - OutputHelper.WriteLine("Third code example in 9.3.1 - unique alias identifiers"); + // Section 9.3.1 Using alias directives + // Third code example in 9.3.1 - unique alias identifiers Assert.IsTrue(NS_TestClass_alias_10.main.testMethod()); } [TestMethod] public void NS_alias_13_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using alias directives "); - OutputHelper.WriteLine("A using-alias-directive can create an alias for the namespace in which it appears"); + // Section 9.3.1 Using alias directives + // A using-alias-directive can create an alias for the namespace in which it appears Assert.IsTrue(NS_TestClass_alias_13.main.testMethod()); } [TestMethod] public void NS_alias_14_Test() { - OutputHelper.WriteLine("Section 9.3.1 Using namespace directives "); - OutputHelper.WriteLine("A using-alias-directive can create an alias for a type declared within the ns in which it appears "); + // Section 9.3.1 Using namespace directives + // A using-alias-directive can create an alias for a type declared within the ns in which it appears Assert.IsTrue(NS_TestClass_alias_14.main.testMethod()); } [TestMethod] public void NS_direct_01_Test() { - OutputHelper.WriteLine("Section 9.3.2 Using namespace directives "); - OutputHelper.WriteLine("The members of a namespace can be accessed directly post using "); + // Section 9.3.2 Using namespace directives + // The members of a namespace can be accessed directly post using Assert.IsTrue(NS_TestClass_direct_01.main.testMethod()); } [TestMethod] public void NS_direct_02_Test() { - OutputHelper.WriteLine("Section 9.3.2 Using namespace directives "); - OutputHelper.WriteLine("A newly declared class will hide a class (with the same name) brought in with a using directive"); + // Section 9.3.2 Using namespace directives + // A newly declared class will hide a class (with the same name) brought in with a using directive Assert.IsTrue(NS_TestClass_direct_02.main.testMethod()); } [TestMethod] public void NS_direct_03_Test() { - OutputHelper.WriteLine("Section 9.3.2 Using namespace directives "); - OutputHelper.WriteLine("Names imported by using-namespace-directive are hidden by same-named members "); + // Section 9.3.2 Using namespace directives + // Names imported by using-namespace-directive are hidden by same-named members Assert.IsTrue(NS_TestClass_direct_03.main.testMethod()); } [TestMethod] public void NS_direct_05_Test() { - OutputHelper.WriteLine("Section 9.3.2 Using namespace directives "); - OutputHelper.WriteLine("Ambiguous reference is overridden by using alias statement"); + // Section 9.3.2 Using namespace directives + // Ambiguous reference is overridden by using alias statement Assert.IsTrue(NS_TestClass_direct_05.main.testMethod()); } [TestMethod] public void NS_typedecl_01_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Ambiguous reference is overridden by using alias statement"); + // Section 9.5 Type declarations + // Ambiguous reference is overridden by using alias statement Assert.IsTrue(NS_TestClass_typedecl_01.testMethod()); } [TestMethod] public void NS_typedecl_06_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a class member as public is okay"); + // Section 9.5 Type declarations + // Declaring a class member as public is okay Assert.IsTrue(NS_TestClass_typedecl_06.testMethod()); } [TestMethod] public void NS_typedecl_07_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a class member as protected internal is okay"); + // Section 9.5 Type declarations + // Declaring a class member as protected internal is okay Assert.IsTrue(NS_TestClass_typedecl_07.testMethod()); } [TestMethod] public void NS_typedecl_08_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a class member as protected is okay"); + // Section 9.5 Type declarations + // Declaring a class member as protected is okay Assert.IsTrue(NS_TestClass_typedecl_08.testMethod()); } [TestMethod] public void NS_typedecl_09_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a class member as internal is okay"); + // Section 9.5 Type declarations + // Declaring a class member as internal is okay Assert.IsTrue(NS_TestClass_typedecl_09.testMethod()); } [TestMethod] public void NS_typedecl_10_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a class member as private is okay"); + // Section 9.5 Type declarations + // Declaring a class member as private is okay Assert.IsTrue(NS_TestClass_typedecl_10.testMethod()); } [TestMethod] public void NS_typedecl_11_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a struct member as public is okay"); + // Section 9.5 Type declarations + // Declaring a struct member as public is okay Assert.IsTrue(NS_TestClass_typedecl_11.testMethod()); } [TestMethod] public void NS_typedecl_12_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a struct member as internal is okay"); + // Section 9.5 Type declarations + // Declaring a struct member as internal is okay Assert.IsTrue(NS_TestClass_typedecl_12.testMethod()); } [TestMethod] public void NS_typedecl_13_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Declaring a struct member as private is okay"); + // Section 9.5 Type declarations + // Declaring a struct member as private is okay Assert.IsTrue(NS_TestClass_typedecl_13.testMethod()); } [TestMethod] public void NS_validaccess_01_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Verify all valid accessibility levels for class declarations are allowed"); + // Section 9.5 Type declarations + // Verify all valid accessibility levels for class declarations are allowed Assert.IsTrue(NS_TestClass_validaccess_01.testMethod()); } [TestMethod] public void NS_validaccess_02_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Verify all valid accessibility levels for struct declarations are allowed"); + // Section 9.5 Type declarations + // Verify all valid accessibility levels for struct declarations are allowed Assert.IsTrue(NS_TestClass_validaccess_02.testMethod()); } [TestMethod] public void NS_validaccess_03_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Verify all valid accessibility levels for interface declarations are allowed"); + // Section 9.5 Type declarations + // Verify all valid accessibility levels for interface declarations are allowed Assert.IsTrue(NS_TestClass_validaccess_03.testMethod()); } [TestMethod] public void NS_validaccess_04_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Verify all valid accessibility levels for enum declarations are allowed"); + // Section 9.5 Type declarations + // Verify all valid accessibility levels for enum declarations are allowed Assert.IsTrue(NS_TestClass_validaccess_04.testMethod()); } [TestMethod] public void NS_validaccess_05_Test() { - OutputHelper.WriteLine("Section 9.5 Type declarations "); - OutputHelper.WriteLine("Verify all valid accessibility levels for delegate declarations are allowed"); + // Section 9.5 Type declarations + // Verify all valid accessibility levels for delegate declarations are allowed Assert.IsTrue(NS_TestClass_validaccess_05.testMethod()); } [TestMethod] public void NS_contexts_025_Test() { - OutputHelper.WriteLine("Verify that you can use the qualifier in a cref attribute of xml docs tag"); + // Verify that you can use the qualifier in a cref attribute of xml docs tag Assert.IsTrue(NS_TestClass_contexts_025.Test.testMethod()); } @@ -403,7 +403,7 @@ public static void Main_old(String[] args) cA.printClassName(); cB.printClassName(); - OutputHelper.WriteLine("Class C"); + // Class C } public static bool testMethod() @@ -426,7 +426,7 @@ public static void Main_old(String[] args) cA.printClassName(); cB.printClassName(); - OutputHelper.WriteLine("Class C"); + // Class C } public static bool testMethod() @@ -626,7 +626,7 @@ class A { public static void Main_old(String[] args) { - OutputHelper.WriteLine("This worked!"); + // This worked! } public static bool testMethod() { @@ -642,7 +642,7 @@ class A { public static void Main_old(String[] args) { - OutputHelper.WriteLine("This worked!"); + // This worked! } public static bool testMethod() { @@ -1191,7 +1191,7 @@ class B : F.A { public static void Main_old(String[] args) { - OutputHelper.WriteLine("Worked!"); + // Worked! } public static bool testMethod() @@ -1362,7 +1362,7 @@ public static int Main_old() A a = new A(); a.i = 25; - OutputHelper.WriteLine("This works!"); + // This works! return 0; } @@ -1397,7 +1397,7 @@ public static int Main_old() { A a = new A(); - OutputHelper.WriteLine("This works!"); + // This works! return 0; } diff --git a/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs b/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs index 540e778d..4478c125 100644 --- a/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs +++ b/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs @@ -10,1015 +10,1015 @@ public class UnitTestStatementTests [TestMethod] public void Statements_Label_001_Test() { - OutputHelper.WriteLine("Label_001.sc"); - OutputHelper.WriteLine("Make sure labels can be declared"); + // Label_001.sc + // Make sure labels can be declared Assert.IsTrue(Statements_TestClass_Label_001.testMethod()); } [TestMethod] public void Statements_Label_002_Test() { - OutputHelper.WriteLine("Label_002.sc"); - OutputHelper.WriteLine("Make sure labels can be referenced. Assumes 'goto'"); + // Label_002.sc + // Make sure labels can be referenced. Assumes 'goto' Assert.IsTrue(Statements_TestClass_Label_002.testMethod()); } [TestMethod] public void Statements_Label_004_Test() { - OutputHelper.WriteLine("Label_004.sc"); - OutputHelper.WriteLine("Make sure labels can be associated with an empty statement"); + // Label_004.sc + // Make sure labels can be associated with an empty statement Assert.IsTrue(Statements_TestClass_Label_004.testMethod()); } [TestMethod] public void Statements_Decl_001_Test() { - OutputHelper.WriteLine("Decl_001.sc"); - OutputHelper.WriteLine("Declare a local variable of an intrinsic type"); + // Decl_001.sc + // Declare a local variable of an intrinsic type Assert.IsTrue(Statements_TestClass_Decl_001.testMethod()); } [TestMethod] public void Statements_Decl_002_Test() { - OutputHelper.WriteLine("Decl_002.sc"); - OutputHelper.WriteLine("Declare a local variable of an intrinsic type and initialize it"); + // Decl_002.sc + // Declare a local variable of an intrinsic type and initialize it Assert.IsTrue(Statements_TestClass_Decl_002.testMethod()); } [TestMethod] public void Statements_Decl_003_Test() { - OutputHelper.WriteLine("Decl_003.sc"); - OutputHelper.WriteLine("Declare a local variable of an intrinsic type and initialize it"); - OutputHelper.WriteLine("with an expression."); + // Decl_003.sc + // Declare a local variable of an intrinsic type and initialize it + // with an expression. Assert.IsTrue(Statements_TestClass_Decl_003.testMethod()); } [TestMethod] public void Statements_Decl_004_Test() { - OutputHelper.WriteLine("Decl_004.sc"); - OutputHelper.WriteLine("Declare a local variable of an external object type"); + // Decl_004.sc + // Declare a local variable of an external object type Assert.IsTrue(Statements_TestClass_Decl_004.testMethod()); } [TestMethod] public void Statements_Decl_007_Test() { - OutputHelper.WriteLine("Decl_007.sc"); - OutputHelper.WriteLine("Declare a series of local variables of an intrinsic type with commas"); + // Decl_007.sc + // Declare a series of local variables of an intrinsic type with commas Assert.IsTrue(Statements_TestClass_Decl_007.testMethod()); } [TestMethod] public void Statements_Decl_009_Test() { - OutputHelper.WriteLine("Decl_009.sc"); - OutputHelper.WriteLine("Declare a series of local variables of an intrinsic type with commas and"); - OutputHelper.WriteLine("initial assignments."); + // Decl_009.sc + // Declare a series of local variables of an intrinsic type with commas and + // initial assignments. Assert.IsTrue(Statements_TestClass_Decl_009.testMethod()); } [TestMethod] public void Statements_Decl_010_Test() { - OutputHelper.WriteLine("Decl_010.sc"); - OutputHelper.WriteLine("Declare a local variable of an intrinsic type as an array"); + // Decl_010.sc + // Declare a local variable of an intrinsic type as an array Assert.IsTrue(Statements_TestClass_Decl_010.testMethod()); } [TestMethod] public void Statements_Decl_012_Test() { - OutputHelper.WriteLine("Decl_012.sc"); - OutputHelper.WriteLine("Declare a local variable of an intrinsic type as an array, allocate and reference it."); + // Decl_012.sc + // Declare a local variable of an intrinsic type as an array, allocate and reference it. Assert.IsTrue(Statements_TestClass_Decl_012.testMethod()); } [TestMethod] public void Statements_Decl_014_Test() { - OutputHelper.WriteLine("Decl_014.sc"); - OutputHelper.WriteLine("Declare a local variable of an intrinsic type as an initialized array"); + // Decl_014.sc + // Declare a local variable of an intrinsic type as an initialized array Assert.IsTrue(Statements_TestClass_Decl_014.testMethod()); } [TestMethod] public void Statements_Decl_016_Test() { - OutputHelper.WriteLine("Decl_016.sc"); - OutputHelper.WriteLine("Correctly declare a local variable of a type that has no default constructor"); - OutputHelper.WriteLine("as an array."); + // Decl_016.sc + // Correctly declare a local variable of a type that has no default constructor + // as an array. Assert.IsTrue(Statements_TestClass_Decl_016.testMethod()); } [TestMethod] public void Statements_Block_001_Test() { - OutputHelper.WriteLine("Block_001.sc"); - OutputHelper.WriteLine("Statements_TestClass_? Several types of statement blocks. Statement blocks"); - OutputHelper.WriteLine("are so fundamental, that most can be tested in one pass."); - OutputHelper.WriteLine("Note that by the nature of this code, many warnings"); - OutputHelper.WriteLine("could/should be generated about items that are never reached."); + // Block_001.sc + // Statements_TestClass_? Several types of statement blocks. Statement blocks + // are so fundamental, that most can be tested in one pass. + // Note that by the nature of this code, many warnings + // could/should be generated about items that are never reached. Assert.IsTrue(Statements_TestClass_Block_001.testMethod()); } [TestMethod] public void Statements_Empty_001_Test() { - OutputHelper.WriteLine("Empty_001.sc"); - OutputHelper.WriteLine("Statements_TestClass_? Several scenarios for empty statement. Emtpy statements"); - OutputHelper.WriteLine("are so fundamental, that most can be tested in one pass."); - OutputHelper.WriteLine("Note that by the nature of this code, many warnings"); - OutputHelper.WriteLine("could/should be generated about items that are never reached."); + // Empty_001.sc + // Statements_TestClass_? Several scenarios for empty statement. Emtpy statements + // are so fundamental, that most can be tested in one pass. + // Note that by the nature of this code, many warnings + // could/should be generated about items that are never reached. Assert.IsTrue(Statements_TestClass_Empty_001.testMethod()); } [TestMethod] public void Statements_Expr_002_Test() { - OutputHelper.WriteLine("Expr_002.sc"); - OutputHelper.WriteLine("Use an expression with side effects."); + // Expr_002.sc + // Use an expression with side effects. Assert.IsTrue(Statements_TestClass_Expr_002.testMethod()); } [TestMethod] public void Statements_Expr_003_Test() { - OutputHelper.WriteLine("Expr_003.sc"); - OutputHelper.WriteLine("Use an expression with side effects and multiple l-values."); + // Expr_003.sc + // Use an expression with side effects and multiple l-values. Assert.IsTrue(Statements_TestClass_Expr_003.testMethod()); } [TestMethod] public void Statements_Expr_004_Test() { - OutputHelper.WriteLine("Expr_004.sc"); - OutputHelper.WriteLine("Run a quick test of common operator/assignment combos"); + // Expr_004.sc + // Run a quick test of common operator/assignment combos Assert.IsTrue(Statements_TestClass_Expr_004.testMethod()); } [TestMethod] public void Statements_Expr_006_Test() { - OutputHelper.WriteLine(" complex assignment"); + // complex assignment Assert.IsTrue(Statements_TestClass_Expr_006.testMethod()); } [TestMethod] public void Statements_if_001_Test() { - OutputHelper.WriteLine("if_001.sc"); - OutputHelper.WriteLine("Simple boolean if with a single statement"); + // if_001.sc + // Simple boolean if with a single statement Assert.IsTrue(Statements_TestClass_if_001.testMethod()); } [TestMethod] public void Statements_if_003_Test() { - OutputHelper.WriteLine("if_003.sc"); - OutputHelper.WriteLine("Simple boolean if with a block statement"); + // if_003.sc + // Simple boolean if with a block statement Assert.IsTrue(Statements_TestClass_if_003.testMethod()); } [TestMethod] public void Statements_if_005_Test() { - OutputHelper.WriteLine("if_005.sc"); - OutputHelper.WriteLine("Simple boolean if with a single statement and else"); + // if_005.sc + // Simple boolean if with a single statement and else Assert.IsTrue(Statements_TestClass_if_005.testMethod()); } [TestMethod] public void Statements_if_007_Test() { - OutputHelper.WriteLine("if_007.sc"); - OutputHelper.WriteLine("Simple boolean if with a block statement"); + // if_007.sc + // Simple boolean if with a block statement Assert.IsTrue(Statements_TestClass_if_007.testMethod()); } [TestMethod] public void Statements_if_009_Test() { - OutputHelper.WriteLine("if_009.sc"); - OutputHelper.WriteLine("Nest ifs with elses without blocks. Statements_TestClass_? that the 'else' ambiguity from"); - OutputHelper.WriteLine("C/C++ is handled the same way (else bound to closest if)"); + // if_009.sc + // Nest ifs with elses without blocks. Statements_TestClass_? that the 'else' ambiguity from + // C/C++ is handled the same way (else bound to closest if) Assert.IsTrue(Statements_TestClass_if_009.testMethod()); } [TestMethod] public void Statements_switch_001_Test() { - OutputHelper.WriteLine("switch_001.sc"); - OutputHelper.WriteLine("Empty switch"); + // switch_001.sc + // Empty switch Assert.IsTrue(Statements_TestClass_switch_001.testMethod()); } [TestMethod] public void Statements_switch_002_Test() { - OutputHelper.WriteLine("switch_002.sc"); - OutputHelper.WriteLine("Default only switch"); + // switch_002.sc + // Default only switch Assert.IsTrue(Statements_TestClass_switch_002.testMethod()); } [TestMethod] public void Statements_switch_003_Test() { - OutputHelper.WriteLine("switch_003.sc"); - OutputHelper.WriteLine("Switch with single case without break - no default"); + // switch_003.sc + // Switch with single case without break - no default Assert.IsTrue(Statements_TestClass_switch_003.testMethod()); } [TestMethod] public void Statements_switch_004_Test() { - OutputHelper.WriteLine("switch_004.sc"); - OutputHelper.WriteLine("Switch with one case, using break"); + // switch_004.sc + // Switch with one case, using break Assert.IsTrue(Statements_TestClass_switch_004.testMethod()); } [TestMethod] public void Statements_switch_005_Test() { - OutputHelper.WriteLine("switch_005.sc"); - OutputHelper.WriteLine("Switch with two cases, using break"); + // switch_005.sc + // Switch with two cases, using break Assert.IsTrue(Statements_TestClass_switch_005.testMethod()); } [TestMethod] public void Statements_switch_006_Test() { - OutputHelper.WriteLine("switch_006.sc"); - OutputHelper.WriteLine("Switch with one case and a default"); + // switch_006.sc + // Switch with one case and a default Assert.IsTrue(Statements_TestClass_switch_006.testMethod()); } [TestMethod] public void Statements_switch_007_Test() { - OutputHelper.WriteLine("switch_007.sc"); - OutputHelper.WriteLine("Switch with two cases and a default"); + // switch_007.sc + // Switch with two cases and a default Assert.IsTrue(Statements_TestClass_switch_007.testMethod()); } [TestMethod] public void Statements_switch_010_Test() { - OutputHelper.WriteLine("switch_010.sc"); - OutputHelper.WriteLine("Switch with a const variable in a case"); + // switch_010.sc + // Switch with a const variable in a case Assert.IsTrue(Statements_TestClass_switch_010.testMethod()); } [TestMethod] public void Statements_switch_012_Test() { - OutputHelper.WriteLine("switch_012.sc"); - OutputHelper.WriteLine("Multiple case labels"); + // switch_012.sc + // Multiple case labels Assert.IsTrue(Statements_TestClass_switch_012.testMethod()); } [TestMethod] public void Statements_switch_013_Test() { - OutputHelper.WriteLine("switch_013.sc"); - OutputHelper.WriteLine("test goto all over"); - OutputHelper.WriteLine("Expected Output"); + // switch_013.sc + // test goto all over + // Expected Output Assert.IsTrue(Statements_TestClass_switch_013.testMethod()); } [TestMethod] public void Statements_switch_015_Test() { - OutputHelper.WriteLine("switch_015.sc"); - OutputHelper.WriteLine("Run a switch over a specific type: byte"); + // switch_015.sc + // Run a switch over a specific type: byte Assert.IsTrue(Statements_TestClass_switch_015.testMethod()); } [TestMethod] public void Statements_switch_016_Test() { - OutputHelper.WriteLine("switch_016.sc"); - OutputHelper.WriteLine("Run a switch over a specific type: char"); + // switch_016.sc + // Run a switch over a specific type: char Assert.IsTrue(Statements_TestClass_switch_016.testMethod()); } [TestMethod] public void Statements_switch_017_Test() { - OutputHelper.WriteLine("switch_017.sc"); - OutputHelper.WriteLine("Run a switch over a specific type: short"); + // switch_017.sc + // Run a switch over a specific type: short Assert.IsTrue(Statements_TestClass_switch_017.testMethod()); } [TestMethod] public void Statements_switch_018_Test() { - OutputHelper.WriteLine("switch_018.sc"); - OutputHelper.WriteLine("Run a switch over a specific type: int"); + // switch_018.sc + // Run a switch over a specific type: int Assert.IsTrue(Statements_TestClass_switch_018.testMethod()); } [TestMethod] public void Statements_switch_019_Test() { - OutputHelper.WriteLine("switch_019.sc"); - OutputHelper.WriteLine("Run a switch over a specific type: long"); + // switch_019.sc + // Run a switch over a specific type: long Assert.IsTrue(Statements_TestClass_switch_019.testMethod()); } [TestMethod] public void Statements_switch_023_Test() { - OutputHelper.WriteLine("switch_023.sc"); - OutputHelper.WriteLine("Run a switch over a specific type: enum"); + // switch_023.sc + // Run a switch over a specific type: enum Assert.IsTrue(Statements_TestClass_switch_023.testMethod()); } [TestMethod] public void Statements_switch_030_Test() { - OutputHelper.WriteLine(" switch on int variable, float case"); + // switch on int variable, float case Assert.IsTrue(Statements_TestClass_switch_030.testMethod()); } [TestMethod] public void Statements_switch_031_Test() { - OutputHelper.WriteLine(" switch with holes in range"); + // switch with holes in range Assert.IsTrue(Statements_TestClass_switch_031.testMethod()); } [TestMethod] public void Statements_switch_032_Test() { - OutputHelper.WriteLine(" switch: default case at top"); + // switch: default case at top Assert.IsTrue(Statements_TestClass_switch_032.testMethod()); } [TestMethod] public void Statements_switch_033_Test() { - OutputHelper.WriteLine(" switch: default case in middle"); + // switch: default case in middle Assert.IsTrue(Statements_TestClass_switch_033.testMethod()); } [TestMethod] public void Statements_switch_034_Test() { - OutputHelper.WriteLine(" switch: default case in middle"); + // switch: default case in middle Assert.IsTrue(Statements_TestClass_switch_034.testMethod()); } [TestMethod] public void Statements_switch_035_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_035.testMethod()); } [TestMethod] public void Statements_switch_036_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_036.testMethod()); } [TestMethod] public void Statements_switch_037_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_037.testMethod()); } [TestMethod] public void Statements_switch_038_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_038.testMethod()); } [TestMethod] public void Statements_switch_039_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_039.testMethod()); } [TestMethod] public void Statements_switch_040_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_040.testMethod()); } [TestMethod] public void Statements_switch_041_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_041.testMethod()); } [TestMethod] public void Statements_switch_042_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_042.testMethod()); } [TestMethod] public void Statements_switch_044_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. Assert.IsTrue(Statements_TestClass_switch_044.testMethod()); } [TestMethod] public void Statements_switch_047_Test() { - OutputHelper.WriteLine("Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of "); - OutputHelper.WriteLine("the switch expression to one of the following possible governing types: sbyte, byte, short,"); - OutputHelper.WriteLine("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if "); - OutputHelper.WriteLine("more than one such implicit conversion exists, a compile-time error occurs."); - OutputHelper.WriteLine("Ensure error is emmited on when more than one implicit conversion to an acceptable governing type is defined"); + // Otherwise, exactly one user-defined implicit conversion (�6.4) must exist from the type of + // the switch expression to one of the following possible governing types: sbyte, byte, short, + // ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if + // more than one such implicit conversion exists, a compile-time error occurs. + // Ensure error is emmited on when more than one implicit conversion to an acceptable governing type is defined Assert.IsTrue(Statements_TestClass_switch_047.testMethod()); } [TestMethod] public void Statements_switch_049_Test() { - OutputHelper.WriteLine("warning CS1522: Empty switch block"); + // warning CS1522: Empty switch block Assert.IsTrue(Statements_TestClass_switch_049.testMethod()); } [TestMethod] public void Statements_switch_string_001_Test() { - OutputHelper.WriteLine(" switch on string: null"); + // switch on string: null Assert.IsTrue(Statements_TestClass_switch_string_001.testMethod()); } [TestMethod] public void Statements_dowhile_001_Test() { - OutputHelper.WriteLine("dowhile_001.sc"); - OutputHelper.WriteLine("do/while with a single statement"); + // dowhile_001.sc + // do/while with a single statement Assert.IsTrue(Statements_TestClass_dowhile_001.testMethod()); } [TestMethod] public void Statements_dowhile_002_Test() { - OutputHelper.WriteLine("dowhile_002.sc"); - OutputHelper.WriteLine("do/while with a compound statement"); + // dowhile_002.sc + // do/while with a compound statement Assert.IsTrue(Statements_TestClass_dowhile_002.testMethod()); } [TestMethod] public void Statements_dowhile_003_Test() { - OutputHelper.WriteLine("dowhile_003.sc"); - OutputHelper.WriteLine("verify known false condition executes only once with single statement"); + // dowhile_003.sc + // verify known false condition executes only once with single statement Assert.IsTrue(Statements_TestClass_dowhile_003.testMethod()); } [TestMethod] public void Statements_dowhile_004_Test() { - OutputHelper.WriteLine("dowhile_004.sc"); - OutputHelper.WriteLine("verify known true condition executes with single statement"); + // dowhile_004.sc + // verify known true condition executes with single statement Assert.IsTrue(Statements_TestClass_dowhile_004.testMethod()); } [TestMethod] public void Statements_dowhile_005_Test() { - OutputHelper.WriteLine("dowhile_005.sc"); - OutputHelper.WriteLine("verify known false condition executes once with compound statements"); + // dowhile_005.sc + // verify known false condition executes once with compound statements Assert.IsTrue(Statements_TestClass_dowhile_005.testMethod()); } [TestMethod] public void Statements_dowhile_006_Test() { - OutputHelper.WriteLine("dowhile_006.sc"); - OutputHelper.WriteLine("verify known true condition executes with compound statements"); + // dowhile_006.sc + // verify known true condition executes with compound statements Assert.IsTrue(Statements_TestClass_dowhile_006.testMethod()); } [TestMethod] public void Statements_for_001_Test() { - OutputHelper.WriteLine("for_001.sc"); - OutputHelper.WriteLine("empty for loop"); + // for_001.sc + // empty for loop Assert.IsTrue(Statements_TestClass_for_001.testMethod()); } [TestMethod] public void Statements_for_003_Test() { - OutputHelper.WriteLine("for_003.sc"); - OutputHelper.WriteLine("empty initializer in for loop"); + // for_003.sc + // empty initializer in for loop Assert.IsTrue(Statements_TestClass_for_003.testMethod()); } [TestMethod] public void Statements_for_004_Test() { - OutputHelper.WriteLine("for_004.sc"); - OutputHelper.WriteLine("empty iterator in for loop"); + // for_004.sc + // empty iterator in for loop Assert.IsTrue(Statements_TestClass_for_004.testMethod()); } [TestMethod] public void Statements_for_006_Test() { - OutputHelper.WriteLine("for_006.sc"); - OutputHelper.WriteLine("Full normal for loop"); + // for_006.sc + // Full normal for loop Assert.IsTrue(Statements_TestClass_for_006.testMethod()); } [TestMethod] public void Statements_for_007_Test() { - OutputHelper.WriteLine("for_007.sc"); - OutputHelper.WriteLine("Full normal for loop with a compound statement"); + // for_007.sc + // Full normal for loop with a compound statement Assert.IsTrue(Statements_TestClass_for_007.testMethod()); } [TestMethod] public void Statements_for_008_Test() { - OutputHelper.WriteLine("for_008.sc"); - OutputHelper.WriteLine("Multiple declarations in initializer"); + // for_008.sc + // Multiple declarations in initializer Assert.IsTrue(Statements_TestClass_for_008.testMethod()); } [TestMethod] public void Statements_for_009_Test() { - OutputHelper.WriteLine("for_009.sc"); - OutputHelper.WriteLine("Statements_TestClass_? statement expression lists in for initializer"); + // for_009.sc + // Statements_TestClass_? statement expression lists in for initializer Assert.IsTrue(Statements_TestClass_for_009.testMethod()); } [TestMethod] public void Statements_for_010_Test() { - OutputHelper.WriteLine("for_010.sc"); - OutputHelper.WriteLine("Statements_TestClass_? statement expression lists in for iterator"); + // for_010.sc + // Statements_TestClass_? statement expression lists in for iterator Assert.IsTrue(Statements_TestClass_for_010.testMethod()); } [TestMethod] public void Statements_for_011_Test() { - OutputHelper.WriteLine("for_011.sc"); - OutputHelper.WriteLine("Statements_TestClass_? statement expression lists in for initializer and iterator"); + // for_011.sc + // Statements_TestClass_? statement expression lists in for initializer and iterator Assert.IsTrue(Statements_TestClass_for_011.testMethod()); } [TestMethod] public void Statements_for_013_Test() { - OutputHelper.WriteLine("for_013.sc"); - OutputHelper.WriteLine("Verify conditional evaluates before iterator"); + // for_013.sc + // Verify conditional evaluates before iterator Assert.IsTrue(Statements_TestClass_for_013.testMethod()); } [TestMethod] public void Statements_for_014_Test() { - OutputHelper.WriteLine("for_014.sc"); - OutputHelper.WriteLine("Verify method calls work ok in all for loop areas"); + // for_014.sc + // Verify method calls work ok in all for loop areas Assert.IsTrue(Statements_TestClass_for_014.testMethod()); } [TestMethod] public void Statements_char_in_string_s01_Test() { - OutputHelper.WriteLine("Optimization to foreach (char c in String) by treating String as a char array"); + // Optimization to foreach (char c in String) by treating String as a char array Assert.IsTrue(Statements_TestClass_char_in_string_s01.testMethod()); } [TestMethod] public void Statements_char_in_string_ex01_Test() { - OutputHelper.WriteLine("Optimization to foreach (char c in String) by treating String as a char array"); + // Optimization to foreach (char c in String) by treating String as a char array Assert.IsTrue(Statements_TestClass_char_in_string_ex01.testMethod()); } [TestMethod] public void Statements_while_001_Test() { - OutputHelper.WriteLine("while_001.sc"); - OutputHelper.WriteLine("while with a single statement"); + // while_001.sc + // while with a single statement Assert.IsTrue(Statements_TestClass_while_001.testMethod()); } [TestMethod] public void Statements_while_002_Test() { - OutputHelper.WriteLine("while_002.sc"); - OutputHelper.WriteLine("while with a compound statement"); + // while_002.sc + // while with a compound statement Assert.IsTrue(Statements_TestClass_while_002.testMethod()); } [TestMethod] public void Statements_while_003_Test() { - OutputHelper.WriteLine("while_003.sc"); - OutputHelper.WriteLine("verify known false condition doesn't execute with single statement"); + // while_003.sc + // verify known false condition doesn't execute with single statement Assert.IsTrue(Statements_TestClass_while_003.testMethod()); } [TestMethod] public void Statements_while_004_Test() { - OutputHelper.WriteLine("while_004.sc"); - OutputHelper.WriteLine("verify known true condition executes with single statement"); + // while_004.sc + // verify known true condition executes with single statement Assert.IsTrue(Statements_TestClass_while_004.testMethod()); } [TestMethod] public void Statements_while_005_Test() { - OutputHelper.WriteLine("while_005.sc"); - OutputHelper.WriteLine("verify known false condition doesn't execute with compound statements"); + // while_005.sc + // verify known false condition doesn't execute with compound statements Assert.IsTrue(Statements_TestClass_while_005.testMethod()); } [TestMethod] public void Statements_while_006_Test() { - OutputHelper.WriteLine("while_006.sc"); - OutputHelper.WriteLine("verify known true condition executes with compound statements"); + // while_006.sc + // verify known true condition executes with compound statements Assert.IsTrue(Statements_TestClass_while_006.testMethod()); } [TestMethod] public void Statements_break_001_Test() { - OutputHelper.WriteLine("break_001.sc"); - OutputHelper.WriteLine("Make sure break works in all basic single statement loops"); + // break_001.sc + // Make sure break works in all basic single statement loops Assert.IsTrue(Statements_TestClass_break_001.testMethod()); } [TestMethod] public void Statements_break_002_Test() { - OutputHelper.WriteLine("break_002.sc"); - OutputHelper.WriteLine("Make sure break works in all basic compound statement loops"); + // break_002.sc + // Make sure break works in all basic compound statement loops Assert.IsTrue(Statements_TestClass_break_002.testMethod()); } [TestMethod] public void Statements_break_003_Test() { - OutputHelper.WriteLine("break_003.sc"); - OutputHelper.WriteLine("Make sure break optional on end of switch"); + // break_003.sc + // Make sure break optional on end of switch Assert.IsTrue(Statements_TestClass_break_003.testMethod()); } [TestMethod] public void Statements_break_006_Test() { - OutputHelper.WriteLine("break_006.sc"); - OutputHelper.WriteLine("break in an if successfully breaks loop"); + // break_006.sc + // break in an if successfully breaks loop Assert.IsTrue(Statements_TestClass_break_006.testMethod()); } [TestMethod] public void Statements_break_007_Test() { - OutputHelper.WriteLine("break_007.sc"); - OutputHelper.WriteLine("break in a blocked if successfully breaks loop"); + // break_007.sc + // break in a blocked if successfully breaks loop Assert.IsTrue(Statements_TestClass_break_007.testMethod()); } [TestMethod] public void Statements_break_010_Test() { - OutputHelper.WriteLine("break_010.sc"); - OutputHelper.WriteLine("Make sure break correctly when nested"); + // break_010.sc + // Make sure break correctly when nested Assert.IsTrue(Statements_TestClass_break_010.testMethod()); } [TestMethod] public void Statements_continue_001_Test() { - OutputHelper.WriteLine("continue_001.sc"); - OutputHelper.WriteLine("Make sure continue works in all basic single statement loops"); + // continue_001.sc + // Make sure continue works in all basic single statement loops Assert.IsTrue(Statements_TestClass_continue_001.testMethod()); } [TestMethod] public void Statements_continue_002_Test() { - OutputHelper.WriteLine("continue_002.sc"); - OutputHelper.WriteLine("Make sure continue works in all basic compound statement loops"); - OutputHelper.WriteLine("Expected Output"); + // continue_002.sc + // Make sure continue works in all basic compound statement loops + // Expected Output Assert.IsTrue(Statements_TestClass_continue_002.testMethod()); } [TestMethod] public void Statements_continue_006_Test() { - OutputHelper.WriteLine("continue_006.sc"); - OutputHelper.WriteLine("continue in an if successfully continues loop"); + // continue_006.sc + // continue in an if successfully continues loop Assert.IsTrue(Statements_TestClass_continue_006.testMethod()); } [TestMethod] public void Statements_continue_007_Test() { - OutputHelper.WriteLine("continue_007.sc"); - OutputHelper.WriteLine("continue in a block if successfully continues loop"); + // continue_007.sc + // continue in a block if successfully continues loop Assert.IsTrue(Statements_TestClass_continue_007.testMethod()); } [TestMethod] public void Statements_continue_010_Test() { - OutputHelper.WriteLine("continue_010.sc"); - OutputHelper.WriteLine("Make sure continue works correctly when nested"); + // continue_010.sc + // Make sure continue works correctly when nested Assert.IsTrue(Statements_TestClass_continue_010.testMethod()); } [TestMethod] public void Statements_goto_001_Test() { - OutputHelper.WriteLine("goto_001.sc"); - OutputHelper.WriteLine("simple goto to adjust flow control"); + // goto_001.sc + // simple goto to adjust flow control Assert.IsTrue(Statements_TestClass_goto_001.testMethod()); } [TestMethod] public void Statements_goto_008_Test() { - OutputHelper.WriteLine("goto_008.sc"); - OutputHelper.WriteLine("goto currect case"); + // goto_008.sc + // goto currect case Assert.IsTrue(Statements_TestClass_goto_008.testMethod()); } [TestMethod] public void Statements_goto_009_Test() { - OutputHelper.WriteLine("goto_009.sc"); - OutputHelper.WriteLine("goto a different case"); - OutputHelper.WriteLine("Expected Output"); + // goto_009.sc + // goto a different case + // Expected Output Assert.IsTrue(Statements_TestClass_goto_009.testMethod()); } [TestMethod] public void Statements_goto_010_Test() { - OutputHelper.WriteLine("goto_010.sc"); - OutputHelper.WriteLine("goto default correctly"); + // goto_010.sc + // goto default correctly Assert.IsTrue(Statements_TestClass_goto_010.testMethod()); } [TestMethod] public void Statements_goto_014_Test() { - OutputHelper.WriteLine("goto_014.sc"); - OutputHelper.WriteLine("simple gotos to test jumping to parent process."); + // goto_014.sc + // simple gotos to test jumping to parent process. Assert.IsTrue(Statements_TestClass_goto_014.testMethod()); } [TestMethod] public void Statements_goto_017_Test() { - OutputHelper.WriteLine(" some gotos"); + // some gotos Assert.IsTrue(Statements_TestClass_goto_017.testMethod()); } [TestMethod] public void Statements_goto_018_Test() { - OutputHelper.WriteLine(" try/catch/finally with goto"); + // try/catch/finally with goto Assert.IsTrue(Statements_TestClass_goto_018.testMethod()); } [TestMethod] public void Statements_return_001_Test() { - OutputHelper.WriteLine("return_001.sc"); - OutputHelper.WriteLine("simple void return on a void method"); + // return_001.sc + // simple void return on a void method Assert.IsTrue(Statements_TestClass_return_001.testMethod()); } [TestMethod] public void Statements_return_004_Test() { - OutputHelper.WriteLine("return_004.sc"); - OutputHelper.WriteLine("simple return a normal type, assigning, and ignoring return value"); + // return_004.sc + // simple return a normal type, assigning, and ignoring return value Assert.IsTrue(Statements_TestClass_return_004.testMethod()); } [TestMethod] public void Statements_return_006_Test() { - OutputHelper.WriteLine("return_006.sc"); - OutputHelper.WriteLine("simple return a type mismatch that has an implicit conversion"); + // return_006.sc + // simple return a type mismatch that has an implicit conversion Assert.IsTrue(Statements_TestClass_return_006.testMethod()); } [TestMethod] public void Statements_return_008_Test() { - OutputHelper.WriteLine("return_008.sc"); - OutputHelper.WriteLine("simple return a type mismatch that has an explicit convertion conversion,"); - OutputHelper.WriteLine("applying the cast"); + // return_008.sc + // simple return a type mismatch that has an explicit convertion conversion, + // applying the cast Assert.IsTrue(Statements_TestClass_return_008.testMethod()); } [TestMethod] public void Statements_return_009_Test() { - OutputHelper.WriteLine("return_009.sc"); - OutputHelper.WriteLine("return of a struct"); + // return_009.sc + // return of a struct Assert.IsTrue(Statements_TestClass_return_009.testMethod()); } [TestMethod] public void Statements_return_010_Test() { - OutputHelper.WriteLine("return_010.sc"); - OutputHelper.WriteLine("return of a class"); + // return_010.sc + // return of a class Assert.IsTrue(Statements_TestClass_return_010.testMethod()); } [TestMethod] public void Statements_return_013_Test() { - OutputHelper.WriteLine("return_013.sc"); - OutputHelper.WriteLine("simple falloff on a void method"); + // return_013.sc + // simple falloff on a void method Assert.IsTrue(Statements_TestClass_return_013.testMethod()); } [TestMethod] public void Statements_return_014_Test() { - OutputHelper.WriteLine("return_014.sc"); - OutputHelper.WriteLine("verify that a 'throw' is adequate for flow control analysis of return type"); + // return_014.sc + // verify that a 'throw' is adequate for flow control analysis of return type Assert.IsTrue(Statements_TestClass_return_014.testMethod()); } [TestMethod] public void Statements_throw_001_Test() { - OutputHelper.WriteLine("throw_001.sc"); - OutputHelper.WriteLine("simple throw"); + // throw_001.sc + // simple throw Assert.IsTrue(Statements_TestClass_throw_001.testMethod()); } [TestMethod] public void Statements_throw_005_Test() { - OutputHelper.WriteLine("throw_005.sc"); - OutputHelper.WriteLine("simple throw with output"); + // throw_005.sc + // simple throw with output Assert.IsTrue(Statements_TestClass_throw_005.testMethod()); } [TestMethod] public void Statements_trycatch_001_Test() { - OutputHelper.WriteLine("trycatch_001.sc"); - OutputHelper.WriteLine("simple throw"); + // trycatch_001.sc + // simple throw Assert.IsTrue(Statements_TestClass_trycatch_001.testMethod()); } [TestMethod] public void Statements_trycatch_006_Test() { - OutputHelper.WriteLine("trycatch_006.sc"); - OutputHelper.WriteLine("simple system generated System.Exception"); + // trycatch_006.sc + // simple system generated System.Exception Assert.IsTrue(Statements_TestClass_trycatch_006.testMethod()); } [TestMethod] public void Statements_trycatch_007_Test() { - OutputHelper.WriteLine("trycatch_007.sc"); - OutputHelper.WriteLine("simple re-throw"); + // trycatch_007.sc + // simple re-throw Assert.IsTrue(Statements_TestClass_trycatch_007.testMethod()); } [TestMethod] public void Statements_tryfinally_001_Test() { - OutputHelper.WriteLine("tryfinally_001.sc"); - OutputHelper.WriteLine("simple finally"); + // tryfinally_001.sc + // simple finally Assert.IsTrue(Statements_TestClass_tryfinally_001.testMethod()); } [TestMethod] public void Statements_tryfinally_002_Test() { - OutputHelper.WriteLine("tryfinally_002.sc"); - OutputHelper.WriteLine("simple finally inside try/catch"); + // tryfinally_002.sc + // simple finally inside try/catch Assert.IsTrue(Statements_TestClass_tryfinally_002.testMethod()); } [TestMethod] public void Statements_tryfinally_003_Test() { - OutputHelper.WriteLine("tryfinally_003.sc"); - OutputHelper.WriteLine("simple finally outside try/catch"); + // tryfinally_003.sc + // simple finally outside try/catch Assert.IsTrue(Statements_TestClass_tryfinally_003.testMethod()); } [TestMethod] public void Statements_tryfinally_004_Test() { - OutputHelper.WriteLine("tryfinally_004.sc"); - OutputHelper.WriteLine("simple finally passed 'over' by a goto"); + // tryfinally_004.sc + // simple finally passed 'over' by a goto Assert.IsTrue(Statements_TestClass_tryfinally_004.testMethod()); } [TestMethod] public void Statements_tryfinally_006_Test() { - OutputHelper.WriteLine("tryfinally_006.sc"); - OutputHelper.WriteLine("simple finally exited by throw"); + // tryfinally_006.sc + // simple finally exited by throw Assert.IsTrue(Statements_TestClass_tryfinally_006.testMethod()); } [TestMethod] public void Statements_tryfinally_007_Test() { - OutputHelper.WriteLine("tryfinally_007.sc"); - OutputHelper.WriteLine("simple finally exited by throw in a called method"); + // tryfinally_007.sc + // simple finally exited by throw in a called method Assert.IsTrue(Statements_TestClass_tryfinally_007.testMethod()); } [TestMethod] public void Statements_tryfinally_008_Test() { - OutputHelper.WriteLine("tryfinally_008.sc"); - OutputHelper.WriteLine("simple finally exited by return"); + // tryfinally_008.sc + // simple finally exited by return Assert.IsTrue(Statements_TestClass_tryfinally_008.testMethod()); } [TestMethod] public void Statements_tryfinally_009_Test() { - OutputHelper.WriteLine("tryfinally_009.sc"); - OutputHelper.WriteLine("simple finally exited by continue"); + // tryfinally_009.sc + // simple finally exited by continue Assert.IsTrue(Statements_TestClass_tryfinally_009.testMethod()); } [TestMethod] public void Statements_tryfinally_010_Test() { - OutputHelper.WriteLine("tryfinally_010.sc"); - OutputHelper.WriteLine("simple finally exited by break"); + // tryfinally_010.sc + // simple finally exited by break Assert.IsTrue(Statements_TestClass_tryfinally_010.testMethod()); } [TestMethod] public void Statements_tryfinally_011_Test() { - OutputHelper.WriteLine("tryfinally_011.sc"); - OutputHelper.WriteLine("simple finally exited by break (where break is outside try)"); + // tryfinally_011.sc + // simple finally exited by break (where break is outside try) Assert.IsTrue(Statements_TestClass_tryfinally_011.testMethod()); } [TestMethod] public void Statements_tryfinally_012_Test() { - OutputHelper.WriteLine("tryfinally_012.sc"); - OutputHelper.WriteLine("simple finally exited by system System.Exception"); + // tryfinally_012.sc + // simple finally exited by system System.Exception Assert.IsTrue(Statements_TestClass_tryfinally_012.testMethod()); } @@ -1031,160 +1031,160 @@ public void Statements_tryfinally_013_Test() [TestMethod] public void Statements_Using_001_Test() { - OutputHelper.WriteLine("using_001.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Cast a class to IDisposable explicitly, use that in the using statement. (1.a)"); + // using_001.cs + // Statements_TestClass_? the using statement. + // Cast a class to IDisposable explicitly, use that in the using statement. (1.a) Assert.IsTrue(Statements_TestClass_Using_001.testMethod()); } [TestMethod] public void Statements_Using_002_Test() { - OutputHelper.WriteLine("using_002.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Use a class directly in using (1.b)"); + // using_002.cs + // Statements_TestClass_? the using statement. + // Use a class directly in using (1.b) Assert.IsTrue(Statements_TestClass_Using_002.testMethod()); } [TestMethod] public void Statements_Using_003_Test() { - OutputHelper.WriteLine("using_003.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Creation of class as part of using statement (1.c)"); + // using_003.cs + // Statements_TestClass_? the using statement. + // Creation of class as part of using statement (1.c) Assert.IsTrue(Statements_TestClass_Using_003.testMethod()); } [TestMethod] public void Statements_Using_005_Test() { - OutputHelper.WriteLine("using_005.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("A class that explicitly implements IDisposable. (1.e)"); + // using_005.cs + // Statements_TestClass_? the using statement. + // A class that explicitly implements IDisposable. (1.e) Assert.IsTrue(Statements_TestClass_Using_005.testMethod()); } [TestMethod] public void Statements_Using_009_Test() { - OutputHelper.WriteLine("using_009.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Statements_TestClass_? the behavior if the used variable is nulled-out in the using block (4)"); + // using_009.cs + // Statements_TestClass_? the using statement. + // Statements_TestClass_? the behavior if the used variable is nulled-out in the using block (4) Assert.IsTrue(Statements_TestClass_Using_009.testMethod()); } [TestMethod] public void Statements_Using_010_Test() { - OutputHelper.WriteLine("using_010.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called during normal exit (5.a)"); + // using_010.cs + // Statements_TestClass_? the using statement. + // Dispose() called during normal exit (5.a) Assert.IsTrue(Statements_TestClass_Using_010.testMethod()); } [TestMethod] public void Statements_Using_011_Test() { - OutputHelper.WriteLine("using_011.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called after throw (5.b)"); - OutputHelper.WriteLine("Expected Output"); + // using_011.cs + // Statements_TestClass_? the using statement. + // Dispose() called after throw (5.b) + // Expected Output Assert.IsTrue(Statements_TestClass_Using_011.testMethod()); } [TestMethod] public void Statements_Using_012_Test() { - OutputHelper.WriteLine("using_012.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called for two objects during normal exit. (5.c)"); + // using_012.cs + // Statements_TestClass_? the using statement. + // Dispose() called for two objects during normal exit. (5.c) Assert.IsTrue(Statements_TestClass_Using_012.testMethod()); } [TestMethod] public void Statements_Using_013_Test() { - OutputHelper.WriteLine("using_013.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called for first objects with System.Exception thrown before second block. (5.d)"); + // using_013.cs + // Statements_TestClass_? the using statement. + // Dispose() called for first objects with System.Exception thrown before second block. (5.d) Assert.IsTrue(Statements_TestClass_Using_013.testMethod()); } [TestMethod] public void Statements_Using_014_Test() { - OutputHelper.WriteLine("using_014.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called for first objects with System.Exception thrown after second block. (5.e)"); + // using_014.cs + // Statements_TestClass_? the using statement. + // Dispose() called for first objects with System.Exception thrown after second block. (5.e) Assert.IsTrue(Statements_TestClass_Using_014.testMethod()); } [TestMethod] public void Statements_Using_015_Test() { - OutputHelper.WriteLine("using_015.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called for both objects when System.Exception thrown inside second block. (5.f)"); + // using_015.cs + // Statements_TestClass_? the using statement. + // Dispose() called for both objects when System.Exception thrown inside second block. (5.f) Assert.IsTrue(Statements_TestClass_Using_015.testMethod()); } [TestMethod] public void Statements_Using_017_Test() { - OutputHelper.WriteLine("using_017.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called for both objects when System.Exception thrown in compound case (5.h)"); + // using_017.cs + // Statements_TestClass_? the using statement. + // Dispose() called for both objects when System.Exception thrown in compound case (5.h) Assert.IsTrue(Statements_TestClass_Using_017.testMethod()); } [TestMethod] public void Statements_Using_018_Test() { - OutputHelper.WriteLine("using_018.cs"); - OutputHelper.WriteLine("Statements_TestClass_? the using statement."); - OutputHelper.WriteLine("Dispose() called for both objects in compound using. (5.g)"); + // using_018.cs + // Statements_TestClass_? the using statement. + // Dispose() called for both objects in compound using. (5.g) Assert.IsTrue(Statements_TestClass_Using_018.testMethod()); } [TestMethod] public void Statements_lock001_Test() { - OutputHelper.WriteLine("The expression of a lock statement must denote a value of a reference-type"); + // The expression of a lock statement must denote a value of a reference-type Assert.IsTrue(Statements_TestClass_lock001.testMethod()); } [TestMethod] public void Statements_lock003_Test() { - OutputHelper.WriteLine("The System.Type object of a class can conveniently be used as the mutual-exclusion lock for static methods of the class"); + // The System.Type object of a class can conveniently be used as the mutual-exclusion lock for static methods of the class Assert.IsTrue(Statements_TestClass_lock003.testMethod()); } [TestMethod] public void Statements_lock004_Test() { - OutputHelper.WriteLine("possible mistaken null statement when semi-column appears directly after lock()"); + // possible mistaken null statement when semi-column appears directly after lock() Assert.IsTrue(Statements_TestClass_lock004.testMethod()); } [TestMethod] public void Statements_lock005_Test() { - OutputHelper.WriteLine("this as the lock expression in a reference type"); + // this as the lock expression in a reference type Assert.IsTrue(Statements_TestClass_lock005.testMethod()); } [TestMethod] public void Statements_lock007_Test() { - OutputHelper.WriteLine("nested lock statements"); + // nested lock statements Assert.IsTrue(Statements_TestClass_lock007.testMethod()); } [TestMethod] public void Statements_enum_002_Test() { - OutputHelper.WriteLine(" enum: comparing constant casted to an enum type to a variable"); + // enum: comparing constant casted to an enum type to a variable Assert.IsTrue(Statements_TestClass_enum_002.testMethod()); } @@ -1192,11 +1192,11 @@ public class Res1 : IDisposable { public void Dispose() { - OutputHelper.WriteLine("Res1.Dispose()"); + // Res1.Dispose() } public void Func() { - OutputHelper.WriteLine("Res1.Func()"); + // Res1.Func() } public void Throw() { @@ -1208,11 +1208,11 @@ public class Res2 : IDisposable { public void Dispose() { - OutputHelper.WriteLine("Res2.Dispose()"); + // Res2.Dispose() } public void Func() { - OutputHelper.WriteLine("Res2.Func()"); + // Res2.Func() } public void Throw() { @@ -1225,11 +1225,11 @@ public class ResExplicit : IDisposable { void IDisposable.Dispose() { - OutputHelper.WriteLine("ResExplicit.Dispose()"); + // ResExplicit.Dispose() } public void Func() { - OutputHelper.WriteLine("ResExplicit.Func()"); + // ResExplicit.Func() } public void Throw() { @@ -1242,11 +1242,11 @@ public class NonRes1 { public void GarbageDisposal() { - OutputHelper.WriteLine("NonRes1.GarbageDisposal()"); + // NonRes1.GarbageDisposal() } public void Func() { - OutputHelper.WriteLine("NonRes1.Func()"); + // NonRes1.Func() } public void Throw() { @@ -1259,11 +1259,11 @@ public class NonRes2 { public void Dispose() { - OutputHelper.WriteLine("NonRes2.Dispose()"); + // NonRes2.Dispose() } public void Func() { - OutputHelper.WriteLine("NonRes2.Func()"); + // NonRes2.Func() } public void Throw() { @@ -1478,17 +1478,17 @@ public static int Main_old(string[] args) f[i] = foo = new Foo(i); if (foo.GetInt() != i) { - OutputHelper.WriteLine("new Foo() didn't take"); + // new Foo() didn't take return (1); } if (f[i].GetInt() != i) { - OutputHelper.WriteLine("Array didn't get updated"); + // Array didn't get updated return (1); } if (f[i] != foo) { - OutputHelper.WriteLine("Array element and foo are different"); + // Array element and foo are different return (i); } } @@ -1761,28 +1761,28 @@ public class Statements_TestClass_Expr_004 public static int Main_old(string[] args) { int i = 0; - OutputHelper.WriteLine("Adding 5"); + // Adding 5 i += 5; // i == 5 if (i != 5) return (1); - OutputHelper.WriteLine("Subtracting 3"); + // Subtracting 3 i -= 3; // i == 2 if (i != 2) return (1); - OutputHelper.WriteLine("Multiplying by 4"); + // Multiplying by 4 i *= 4; // i == 8 if (i != 8) return (1); - OutputHelper.WriteLine("Dividing by 2"); + // Dividing by 2 i /= 2; // i == 4 if (i != 4) return (1); - OutputHelper.WriteLine("Left Shifting 3"); + // Left Shifting 3 i <<= 3; // i == 32 if (i != 32) return (1); - OutputHelper.WriteLine("Right Shifting 2"); + // Right Shifting 2 i >>= 2; // i == 8 if (i != 8) return (1); - OutputHelper.WriteLine("ANDing against logical not"); + // ANDing against logical not i &= ~i; // i = 0 if (i != 0) return (1); - OutputHelper.WriteLine("ORing by 0xBeaf"); + // ORing by 0xBeaf i |= 48815; // i = 0xBeaf if (i != 0xBeaf) return (1); return (true ? 0 : 1); @@ -2114,32 +2114,32 @@ public static int Main_old(string[] args) { case 0: ret--; // 2 - OutputHelper.WriteLine("case 0: "); + // case 0: OutputHelper.WriteLine(ret.ToString()); goto case 9999; case 2: ret--; // 4 - OutputHelper.WriteLine("case 2: "); + // case 2: OutputHelper.WriteLine(ret.ToString()); goto case 255; case 6: // start here ret--; // 5 - OutputHelper.WriteLine("case 5: "); + // case 5: OutputHelper.WriteLine(ret.ToString()); goto case 2; case 9999: ret--; // 1 - OutputHelper.WriteLine("case 9999: "); + // case 9999: OutputHelper.WriteLine(ret.ToString()); goto default; case 0xff: ret--; // 3 - OutputHelper.WriteLine("case 0xff: "); + // case 0xff: OutputHelper.WriteLine(ret.ToString()); goto case 0; default: ret--; - OutputHelper.WriteLine("Default: "); + // Default: OutputHelper.WriteLine(ret.ToString()); if (ret > 0) { @@ -2148,7 +2148,7 @@ public static int Main_old(string[] args) break; case -1: ret = 999; - OutputHelper.WriteLine("case -1: "); + // case -1: OutputHelper.WriteLine(ret.ToString()); break; } @@ -2192,8 +2192,6 @@ private static int DoByte() ret--; break; } - if (ret > 0) - OutputHelper.WriteLine("byte failed"); return (ret); } @@ -2236,8 +2234,6 @@ private static int DoChar() ret--; break; } - if (ret > 0) - OutputHelper.WriteLine("char failed"); return (ret); } public static bool testMethod() @@ -2278,8 +2274,6 @@ private static int DoShort() ret--; break; } - if (ret > 0) - OutputHelper.WriteLine("short failed"); return (ret); } @@ -2322,8 +2316,6 @@ private static int DoInt() ret--; break; } - if (ret > 0) - OutputHelper.WriteLine("int failed"); return (ret); } public static bool testMethod() @@ -2364,8 +2356,6 @@ private static int DoLong() ret--; break; } - if (ret > 0) - OutputHelper.WriteLine("long failed"); return (ret); } @@ -2414,8 +2404,6 @@ private static int DoEnum() ret--; break; } - if (ret > 0) - OutputHelper.WriteLine("enum failed"); return (ret); } public static bool testMethod() @@ -2527,7 +2515,7 @@ public static int Main_old(string[] args) switch (t) { case 1: - OutputHelper.WriteLine("a"); + // a return 0; default: return 1; @@ -2825,7 +2813,7 @@ public static int Main_old(string[] args) switch (s) { case null: - OutputHelper.WriteLine("null"); + // null return 0; default: return 1; @@ -3061,12 +3049,12 @@ public static int Main_old(string[] args) } if (i + 1 != j) { - OutputHelper.WriteLine("Failure: i + 1 != j"); + // Failure: i + 1 != j return (1); } if (j + 1 != k) { - OutputHelper.WriteLine("Failure: j + 1 != k"); + // Failure: j + 1 != k return (1); } return (ret); @@ -3089,12 +3077,12 @@ public static int Main_old(string[] args) } if (i + 1 != j) { - OutputHelper.WriteLine("Failure: i + 1 != j"); + // Failure: i + 1 != j return (1); } if (j + 1 != k) { - OutputHelper.WriteLine("Failure: j + 1 != k"); + // Failure: j + 1 != k return (1); } return (ret); @@ -3118,12 +3106,12 @@ public static int Main_old(string[] args) } if (i + 1 != j) { - OutputHelper.WriteLine("Failure: i + 1 != j"); + // Failure: i + 1 != j return (1); } if (j + 1 != k) { - OutputHelper.WriteLine("Failure: j + 1 != k"); + // Failure: j + 1 != k return (1); } return (ret); @@ -3213,7 +3201,7 @@ public static int Main_old() foreach (char C in Str) { return 1; - OutputHelper.WriteLine("Fail"); + // Fail } } catch (System.Exception) @@ -3307,7 +3295,7 @@ public static int Main_old(string[] args) bool bFalse = false; while (bFalse) { - OutputHelper.WriteLine("Hello World"); + // Hello World return (1); } return (0); @@ -3325,7 +3313,7 @@ public static int Main_old(string[] args) bool bTrue = true; while (bTrue) { - OutputHelper.WriteLine("Hello World"); + // Hello World return (0); } return (1); @@ -3485,19 +3473,19 @@ public static int Main_old(string[] args) { int i = 5; int ret = 0; - OutputHelper.WriteLine("Doing while"); + // Doing while while (--i != 0) continue; if (i != 0) return (1); - OutputHelper.WriteLine("Doing do/while"); + // Doing do/while i = 5; do continue; while (--i != 0); if (i != 0) return (1); - OutputHelper.WriteLine("Doing for"); + // Doing for for (i = 5; i != 0; i--) continue; int[] iArr = new int[20]; @@ -4270,13 +4258,13 @@ private int Method() } catch (System.Exception e) { - OutputHelper.WriteLine("Rethrow"); + // Rethrow throw; } } catch (System.Exception e) { - OutputHelper.WriteLine("Recatch"); + // Recatch return (0); } return (1); @@ -4799,7 +4787,7 @@ public static void Main_old() } catch { - OutputHelper.WriteLine("System.Exception caught"); + // System.Exception caught } } public static bool testMethod() @@ -4847,7 +4835,7 @@ public static void Main_old() } catch { - OutputHelper.WriteLine("System.Exception caught"); + // System.Exception caught } } public static bool testMethod() @@ -4875,7 +4863,7 @@ public static void Main_old() } catch { - OutputHelper.WriteLine("System.Exception caught"); + // System.Exception caught } } public static bool testMethod() @@ -4903,7 +4891,7 @@ public static void Main_old() } catch { - OutputHelper.WriteLine("System.Exception caught"); + // System.Exception caught } } public static bool testMethod() @@ -4929,7 +4917,7 @@ public static void Main_old() } catch { - OutputHelper.WriteLine("System.Exception caught"); + // System.Exception caught } } public static bool testMethod() diff --git a/Tests/NFUnitTestStruct/UnitTestStructs.cs b/Tests/NFUnitTestStruct/UnitTestStructs.cs index 54665ed2..257824c3 100644 --- a/Tests/NFUnitTestStruct/UnitTestStructs.cs +++ b/Tests/NFUnitTestStruct/UnitTestStructs.cs @@ -40,7 +40,7 @@ public void Structs12_Test() [TestMethod] public void Structs13_Test() { - OutputHelper.WriteLine("Expected failure, see 16852 for more details"); + // Expected failure, see 16852 for more details StructsTestClass_13_Notes.Note(); Assert.IsTrue(StructsTestClass_13.testMethod()); @@ -199,7 +199,7 @@ class StructsTestClass_01_Notes { public static void Note() { - OutputHelper.WriteLine(" Declaring a struct with and without a trailing semicolon. "); + // Declaring a struct with and without a trailing semicolon. } } struct StructsTestClass_01_Struct1 @@ -226,7 +226,7 @@ class StructsTestClass_04_Notes { public static void Note() { - OutputHelper.WriteLine(" Verify all valid protection levels for members and methods"); + // Verify all valid protection levels for members and methods } } struct StructsTestClass_04_Struct1 @@ -273,7 +273,7 @@ class StructsTestClass_11_Notes { public static void Note() { - OutputHelper.WriteLine(" Verify struct can implement an interface."); + // Verify struct can implement an interface. } } interface Inter1 @@ -297,7 +297,7 @@ class StructsTestClass_12_Notes { public static void Note() { - OutputHelper.WriteLine(" Verify struct can implement multiple interfaces."); + // Verify struct can implement multiple interfaces. } } interface StructsTestClass_12_Inter1 @@ -331,7 +331,7 @@ class StructsTestClass_13_Notes { public static void Note() { - OutputHelper.WriteLine(" Verify struct can implement multiple interfaces that contain methods with identical signatures."); + // Verify struct can implement multiple interfaces that contain methods with identical signatures. } } interface StructsTestClass_13_Inter1 @@ -375,7 +375,7 @@ class StructsTestClass_14_Notes { public static void Note() { - OutputHelper.WriteLine(" Verify that a struct can contain a class"); + // Verify that a struct can contain a class } } class StructsTestClass_14_Class1 @@ -402,7 +402,7 @@ class StructsTestClass_15_Notes { public static void Note() { - OutputHelper.WriteLine(" Verify that a struct can contain another sruct"); + // Verify that a struct can contain another sruct } } struct StructsTestClass_15_Struct1 @@ -430,7 +430,7 @@ class StructsTestClass_19_Notes { public static void Note() { - OutputHelper.WriteLine("Attempt to use an empty StructsTestClass_19_Struct"); + // Attempt to use an empty StructsTestClass_19_Struct } } struct StructsTestClass_19_Struct1 @@ -454,7 +454,7 @@ class StructsTestClass_21_Notes { public static void Note() { - OutputHelper.WriteLine("attempt to return a struct"); + // attempt to return a struct } } public struct StructsTestClass_21_Struct1 @@ -490,7 +490,7 @@ class StructsTestClass_23_Notes { public static void Note() { - OutputHelper.WriteLine("struct like an object"); + // struct like an object } } struct StructsTestClass_23_Struct1 @@ -515,7 +515,7 @@ class StructsTestClass_24_Notes { public static void Note() { - OutputHelper.WriteLine(" struct values aren't changed when boxed and passed as interfaces."); + // struct values aren't changed when boxed and passed as interfaces. } } public interface Interface1 @@ -557,7 +557,7 @@ class StructsTestClass_26_Notes { public static void Note() { - OutputHelper.WriteLine(" StructsTestClass_26_A ttempt to make a parameterized conStructsTestClass_26_Structor for a StructsTestClass_?_Struct."); + // StructsTestClass_26_A ttempt to make a parameterized conStructsTestClass_26_Structor for a StructsTestClass_?_Struct. } } struct StructsTestClass_26_Struct1 @@ -581,7 +581,7 @@ class StructsTestClass_28_Notes { public static void Note() { - OutputHelper.WriteLine(" Explicit test of object boxing conversions to and from a StructsTestClass_28_Struct."); + // Explicit test of object boxing conversions to and from a StructsTestClass_28_Struct. } } struct StructsTestClass_28_Struct1 @@ -606,7 +606,7 @@ class StructsTestClass_29_Notes { public static void Note() { - OutputHelper.WriteLine(" StructsTestClass_29 conStructsTestClass_29_Structor forwarding works for StructsTestClass_?_Structs"); + // StructsTestClass_29 conStructsTestClass_29_Structor forwarding works for StructsTestClass_?_Structs } } struct Foo @@ -642,7 +642,7 @@ class StructsTestClass_32_Notes { public static void Note() { - OutputHelper.WriteLine(" nested struct should work"); + // nested struct should work } } public struct StructsTestClass_32_Struct @@ -672,7 +672,7 @@ class StructsTestClass_33_Notes { public static void Note() { - OutputHelper.WriteLine(" nested class inside struct should work"); + // nested class inside struct should work } } public struct StructsTestClass_33_Struct @@ -702,7 +702,7 @@ class StructsTestClass_34_Notes { public static void Note() { - OutputHelper.WriteLine(" nested struct should work"); + // nested struct should work } } public struct StructsTestClass_34_Struct @@ -742,7 +742,7 @@ class StructsTestClass_35_Notes { public static void Note() { - OutputHelper.WriteLine(" cast struct to inherited interface type"); + // cast struct to inherited interface type } } public interface StructsTestClass_35_Interface @@ -772,7 +772,7 @@ class StructsTestClass_36_Notes { public static void Note() { - OutputHelper.WriteLine(" cast struct to inherited interface type"); + // cast struct to inherited interface type } } public interface StructsTestClass_36_Interface @@ -802,7 +802,7 @@ class StructsTestClass_37_Notes { public static void Note() { - OutputHelper.WriteLine(" cast struct to inherited interface type"); + // cast struct to inherited interface type } } public interface StructsTestClass_37_Interface @@ -838,7 +838,7 @@ class StructsTestClass_38_Notes { public static void Note() { - OutputHelper.WriteLine(" cast struct to inherited interface type through function"); + // cast struct to inherited interface type through function } } public interface StructsTestClass_38_Interface @@ -880,7 +880,7 @@ class StructsTestClass_40_Notes { public static void Note() { - OutputHelper.WriteLine(" property in struct"); + // property in struct } } public struct StructsTestClass_40_Struct @@ -908,7 +908,7 @@ class StructsTestClass_41_Notes { public static void Note() { - OutputHelper.WriteLine(" indexer in struct"); + // indexer in struct } } public struct StructsTestClass_41_Struct @@ -936,7 +936,7 @@ class StructsTestClass_42_Notes { public static void Note() { - OutputHelper.WriteLine(" interface indexer in StructsTestClass_42_Struct"); + // interface indexer in StructsTestClass_42_Struct } } public interface StructsTestClass_42_Interface @@ -968,7 +968,7 @@ class StructsTestClass_43_Notes { public static void Note() { - OutputHelper.WriteLine(" delegate in struct"); + // delegate in struct } } public struct StructsTestClass_43_Struct @@ -995,7 +995,7 @@ class StructsTestClass_44_Notes { public static void Note() { - OutputHelper.WriteLine(" delegate in struct assing interface as a delegate argument"); + // delegate in struct assing interface as a delegate argument } } public interface StructsTestClass_44_Interface @@ -1026,7 +1026,7 @@ class StructsTestClass_55_Notes { public static void Note() { - OutputHelper.WriteLine("The this object cannot be used before all of its fields are assigned to"); + // The this object cannot be used before all of its fields are assigned to } } public struct StructsTestClass_55 diff --git a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs index 976266d5..df12f3bc 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs @@ -21,11 +21,11 @@ public void DateTime_ConstructorTest1() /// 2. Verifies that the created object is a DateTime /// - OutputHelper.WriteLine("Creating new DateTime Object"); + // Creating new DateTime Object DateTime dt = new DateTime(); OutputHelper.WriteLine(dt.ToString()); Type type = dt.GetType(); - OutputHelper.WriteLine("Verifying its type"); + // Verifying its type Assert.IsType(type, Type.GetType("System.DateTime")); } @@ -38,7 +38,7 @@ public void DateTime_ConstructorTest2() /// /// - OutputHelper.WriteLine("Generating 10 random DateTime and Verifying"); + // Generating 10 random DateTime and Verifying for (int i = 0; i < 10; i++) { DateTime dt = GetRandomDateTime(); @@ -64,7 +64,7 @@ public void DateTime_ConstructorTest3() /// 2. Verifies the DateTimes are equal to DateTime.MinValue, DateTime.MaxValue /// /// - OutputHelper.WriteLine("Creating Minimum DateTime and verifying"); + // Creating Minimum DateTime and verifying DateTime minDT1 = DateTime.MinValue; DateTime minDT2 = new DateTime(); DateTime minDT3 = new DateTime(504911232000000000); @@ -74,14 +74,14 @@ public void DateTime_ConstructorTest3() (DateTime.Compare(minDT2, minDT3) != 0) || (DateTime.Compare(minDT3, minDT4) != 0)) { - OutputHelper.WriteLine("DateTime.MinValue = '" + minDT1.Ticks + "'ticks,"); - OutputHelper.WriteLine(" new DateTime() = '" + minDT2.Ticks + "'ticks,"); - OutputHelper.WriteLine("new DateTime(0) = '" + minDT3.Ticks + "'ticks."); + // DateTime.MinValue = '" + minDT1.Ticks + "'ticks, + // new DateTime() = '" + minDT2.Ticks + "'ticks, + // new DateTime(0) = '" + minDT3.Ticks + "'ticks. throw new Exception("Expected 'DateTime.MinValue' is equal to 'new DateTime()', " + "equal to 'new DateTime(0)', equal to 'new DateTime(1, 1, 1, 0, 0, 0, 0)' but got "); } - OutputHelper.WriteLine("Creating Maximum DateTime and verifying"); + // Creating Maximum DateTime and verifying DateTime maxDateTime = new DateTime(946708127999999999); Assert.IsTrue(DateTime.MaxValue.Equals(maxDateTime)); } @@ -94,13 +94,13 @@ public void DateTime_CompareToTest4() /// 2. Verifies that they CompareTo each other /// /// - OutputHelper.WriteLine("Generating random DateTimes b/n 1000 - 9000"); - OutputHelper.WriteLine("comparing eachother with DateTime.CompareTo and verifying"); + // Generating random DateTimes b/n 1000 - 9000 + // comparing eachother with DateTime.CompareTo and verifying DateTime dt1 = DateTime_btwn_1801_And_2801(); DateTime dt2 = new DateTime(year, month, day, hour, minute, second, millisec); - OutputHelper.WriteLine("Comparing two equal DateTimes"); + // Comparing two equal DateTimes Assert.AreEqual(dt1.CompareTo(dt2), 0); - OutputHelper.WriteLine("Comparing Unequal DateTimes and Verifying"); + // Comparing Unequal DateTimes and Verifying dt2 = dt1.Add(new TimeSpan(1)); Assert.IsFalse(dt1.CompareTo(dt2) >= 0); Assert.IsFalse(dt2.CompareTo(dt1) <= 0); @@ -114,7 +114,7 @@ public void DateTime_EqualsTest5() /// 2. Verifies that they Equals each other /// /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(ticks); Assert.IsTrue(dt1.Equals(dt2)); @@ -128,7 +128,7 @@ public void DateTime_ToStringTest06() /// 2. Verifies that it correctly returns a string from ToString /// /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); int[] intArr = new int[] { dt.Month, dt.Day, dt.Year, dt.Hour, dt.Minute, dt.Second }; string[] strArr = new string[] { "", "", "", "", "", "" }; @@ -164,13 +164,13 @@ public void DateTime_ToStringTest08() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); OutputHelper.WriteLine($"Test DateTime is: {dt}"); - OutputHelper.WriteLine("DateTime.ToString(String) using specified formats and Verifying"); + // DateTime.ToString(String) using specified formats and Verifying // ShortDatePattern string specifier1 = "d"; @@ -214,7 +214,7 @@ public void DateTime_ToStringTest09() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -284,7 +284,7 @@ public void DateTime_ToStringTest10() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -369,7 +369,7 @@ public void DateTime_ToStringTest11() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -457,7 +457,7 @@ public void DateTime_ToStringTest12() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -514,7 +514,7 @@ public void DateTime_ToStringTest13() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -573,7 +573,7 @@ public void DateTime_ToStringTest14() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -640,7 +640,7 @@ public void DateTime_ToStringTest15() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -726,7 +726,7 @@ public void DateTime_ToStringTest16() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -829,7 +829,7 @@ public void DateTime_ToStringTest17() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -890,7 +890,7 @@ public void DateTime_ToStringTest18() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -938,7 +938,7 @@ public void DateTime_ToStringTest19() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -983,7 +983,7 @@ public void DateTime_ToStringTest20() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1044,7 +1044,7 @@ public void DateTime_ToStringTest21() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1129,7 +1129,7 @@ public void DateTime_ToStringTest22() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1188,7 +1188,7 @@ public void DateTime_ToStringTest23() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1263,7 +1263,7 @@ public void DateTime_ToStringTest24() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1309,7 +1309,7 @@ public void DateTime_ToStringTest25() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1364,7 +1364,7 @@ public void DateTime_ToStringTest26() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1424,7 +1424,7 @@ public void DateTime_ToStringTest27() /// 1. Creates a DateTime /// 2. Verifies DateTime.ToString (String) returns correct String using a specified format /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime dt = GetRandomDateTime(); @@ -1465,7 +1465,7 @@ public void DateTime_AddTest8() /// 2. Runs the Add function and verifies output /// /// - OutputHelper.WriteLine("Generating random DateTimes "); + // Generating random DateTimes DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); TimeSpan ts; Random random = new Random(); @@ -1480,7 +1480,7 @@ public void DateTime_AddTest8() { ts = new TimeSpan(random.Next(1000)); } - OutputHelper.WriteLine("Adding '" + ts.ToString() + "' Timespan to '" + dt1.ToString() + "'"); + // Adding '" + ts.ToString() + "' Timespan to '" + dt1.ToString() + "' DateTime dt2 = dt1.Add(ts); Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ts.Ticks)); } @@ -1494,15 +1494,15 @@ public void DateTime_AddDays_PositiveTest9() /// 2. Runs the AddDays function and verifies output /// /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random +ve Days and verifying"); + // Adding Random +ve Days and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double dy = random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + dy + "' days to '" + dt1.ToString() + "'"); + // Adding '" + dy + "' days to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddDays(dy); if (!CheckDeviation((long)(dt1.Ticks + (dy * TimeSpan.TicksPerDay)), dt2.Ticks)) { @@ -1522,17 +1522,17 @@ public void DateTime_AddDays_NegativeTest10() /// /// - OutputHelper.WriteLine("This is fixed, DateTime.AddXXXX methods do not handle negative"); - OutputHelper.WriteLine("values correctly on Device, see 22728 for details"); - OutputHelper.WriteLine("Generating random DateTime"); + // This is fixed, DateTime.AddXXXX methods do not handle negative + // values correctly on Device, see 22728 for details + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random -ve Days and verifying"); + // Adding Random -ve Days and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double dy = -random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + dy + "' days to '" + dt1.ToString() + "'"); + // Adding '" + dy + "' days to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddDays(dy); if (!CheckDeviation((long)(dt1.Ticks + (dy * TimeSpan.TicksPerDay)), dt2.Ticks)) { @@ -1552,15 +1552,15 @@ public void DateTime_AddHours_PositiveTest11() /// /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random +ve Hours and verifying"); + // Adding Random +ve Hours and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double hr = random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + hr + "' hours to '" + dt1.ToString() + "'"); + // Adding '" + hr + "' hours to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddHours(hr); if (!CheckDeviation((long)(dt1.Ticks + (hr * TimeSpan.TicksPerHour)), dt2.Ticks)) { @@ -1580,17 +1580,17 @@ public void DateTime_AddHours_NegativeTest12() /// /// - OutputHelper.WriteLine("This is fixed, DateTime.AddXXXX methods do not handle negative"); - OutputHelper.WriteLine("values correctly on Device, see 22728 for details"); - OutputHelper.WriteLine("Generating random DateTime"); + // This is fixed, DateTime.AddXXXX methods do not handle negative + // values correctly on Device, see 22728 for details + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random -ve Hours and verifying"); + // Adding Random -ve Hours and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double hr = -random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + hr + "' hours to '" + dt1.ToString() + "'"); + // Adding '" + hr + "' hours to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddHours(hr); if (!CheckDeviation((long)(dt1.Ticks + (hr * TimeSpan.TicksPerHour)), dt2.Ticks)) { @@ -1608,15 +1608,15 @@ public void DateTime_AddMilliseconds_PositiveTest13() /// 1. Creates a DateTime /// 2. Runs the AddMilliseconds function and verifies output /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random +ve Milliseconds and verifying"); + // Adding Random +ve Milliseconds and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double msec = random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + msec + "' milliseconds to '" + dt1.ToString() + "'"); + // Adding '" + msec + "' milliseconds to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddMilliseconds(msec); if (!CheckDeviation((long)(dt1.Ticks + (msec * TimeSpan.TicksPerMillisecond)), dt2.Ticks)) { @@ -1634,17 +1634,17 @@ public void DateTime_AddMilliseconds_NegativeTest14() /// 1. Creates a DateTime /// 2. Runs the AddMilliseconds function and verifies output /// - OutputHelper.WriteLine("This is fixed, DateTime.AddXXXX methods do not handle negative"); - OutputHelper.WriteLine("values correctly on Device, see 22728 for details"); - OutputHelper.WriteLine("Generating random DateTime"); + // This is fixed, DateTime.AddXXXX methods do not handle negative + // values correctly on Device, see 22728 for details + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random -ve Milliseconds and verifying"); + // Adding Random -ve Milliseconds and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double msec = -random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + msec + "' milliseconds to '" + dt1.ToString() + "'"); + // Adding '" + msec + "' milliseconds to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddMilliseconds(msec); if (!CheckDeviation((long)(dt1.Ticks + (msec * TimeSpan.TicksPerMillisecond)), dt2.Ticks)) { @@ -1662,15 +1662,15 @@ public void DateTime_AddMinutes_PositiveTest15() /// 1. Creates a DateTime /// 2. Runs the AddMinutes function and verifies output /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random +ve Minutes and verifying"); + // Adding Random +ve Minutes and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double mnts = random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + mnts + "' minutes to '" + dt1.ToString() + "'"); + // Adding '" + mnts + "' minutes to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddMinutes(mnts); if (!CheckDeviation((long)(dt1.Ticks + (mnts * TimeSpan.TicksPerMinute)), dt2.Ticks)) { @@ -1688,17 +1688,17 @@ public void DateTime_AddMinutes_NegativeTest16() /// 1. Creates a DateTime /// 2. Runs the AddMinutes function and verifies output /// - OutputHelper.WriteLine("This is fixed, DateTime.AddXXXX methods do not handle negative"); - OutputHelper.WriteLine("values correctly on Device, see 22728 for details"); - OutputHelper.WriteLine("Generating random DateTime"); + // This is fixed, DateTime.AddXXXX methods do not handle negative + // values correctly on Device, see 22728 for details + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random -ve Minutes and verifying"); + // Adding Random -ve Minutes and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double mnts = -random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + mnts + "' minutes to '" + dt1.ToString() + "'"); + // Adding '" + mnts + "' minutes to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddMinutes(mnts); if (!CheckDeviation((long)(dt1.Ticks + (mnts * TimeSpan.TicksPerMinute)), dt2.Ticks)) { @@ -1716,15 +1716,15 @@ public void DateTime_AddSeconds_PositiveTest18() /// 1. Creates a DateTime /// 2. Runs the AddSeconds function and verifies output /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random +ve Seconds and verifying"); + // Adding Random +ve Seconds and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double sec = random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + sec + "' seconds to '" + dt1.ToString() + "'"); + // Adding '" + sec + "' seconds to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddSeconds(sec); if (!CheckDeviation((long)(dt1.Ticks + (sec * TimeSpan.TicksPerSecond)), dt2.Ticks)) { @@ -1742,17 +1742,17 @@ public void DateTime_AddSeconds_NegativeTest19() /// 1. Creates a DateTime /// 2. Runs the AddSeconds function and verifies output /// - OutputHelper.WriteLine("This is fixed, DateTime.AddXXXX methods do not handle negative"); - OutputHelper.WriteLine("values correctly on Device, see 22728 for details"); - OutputHelper.WriteLine("Generating random DateTime"); + // This is fixed, DateTime.AddXXXX methods do not handle negative + // values correctly on Device, see 22728 for details + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random -ve Seconds and verifying"); + // Adding Random -ve Seconds and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; double sec = -random.Next(1000) * rdmFraction[random.Next(rdmFraction.Length)]; - OutputHelper.WriteLine("Adding '" + sec + "' seconds to '" + dt1.ToString() + "'"); + // Adding '" + sec + "' seconds to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddSeconds(sec); if (!CheckDeviation((long)(dt1.Ticks + (sec * TimeSpan.TicksPerSecond)), dt2.Ticks)) { @@ -1770,15 +1770,15 @@ public void DateTime_AddTicks_PositiveTest20() /// 1. Creates a DateTime /// 2. Runs the AddTicks function and verifies output /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random +ve Ticks and verifying"); + // Adding Random +ve Ticks and verifying for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; long ticks = (long)random.Next(1000); - OutputHelper.WriteLine("Adding '" + ticks + "' ticks to '" + dt1.ToString() + "'"); + // Adding '" + ticks + "' ticks to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddTicks(ticks); Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ticks)); } @@ -1791,15 +1791,15 @@ public void DateTime_AddTicks_NegativeTest21() /// 1. Creates a DateTime /// 2. Runs the AddTicks function and verifies output /// - OutputHelper.WriteLine("Generating random DateTime"); + // Generating random DateTime DateTime[] dt1Arr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); - OutputHelper.WriteLine("Adding Random -ve Ticks and verifying"); + // Adding Random -ve Ticks and verifying for (int i = 0; i < 10; i++) { DateTime dt1 = dt1Arr[i]; long ticks = -(long)random.Next(1000); - OutputHelper.WriteLine("Adding '" + ticks + "' ticks to '" + dt1.ToString() + "'"); + // Adding '" + ticks + "' ticks to '" + dt1.ToString() + "' DateTime dt2 = dt1.AddTicks(ticks); Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ticks)); } @@ -1812,17 +1812,17 @@ public void DateTime_Compare_Test23() /// 1. Creates two DateTimes /// 2. Verifies that they Compare with each other /// - OutputHelper.WriteLine("Creating two Random but equal DateTime b/n 1000 - 9000"); - OutputHelper.WriteLine("Comparing eachother with DateTime.Compare and Verifying"); + // Creating two Random but equal DateTime b/n 1000 - 9000 + // Comparing eachother with DateTime.Compare and Verifying DateTime dt1 = DateTime_btwn_1801_And_2801(); DateTime dt2 = new DateTime(year, month, day, hour, minute, second, millisec); - OutputHelper.WriteLine("Comparing equal DateTimes and Verifying"); + // Comparing equal DateTimes and Verifying if (DateTime.Compare(dt1, dt2) != 0) { throw new Exception("Expected DateTime.Compare(" + dt1.ToString() + ", " + dt2.ToString() + ") returns '0' but got '" + DateTime.Compare(dt1, dt2) + "'"); } - OutputHelper.WriteLine("Comparing Unequal DateTimes and Verifying"); + // Comparing Unequal DateTimes and Verifying dt2 = dt1.Add(new TimeSpan(1)); if (DateTime.Compare(dt1, dt2) >= 0) { @@ -1843,16 +1843,16 @@ public void DateTime_DaysInMonth_Test24() /// /// 1. Verifies the accuracy of the DaysInMonth method /// - OutputHelper.WriteLine("Generates a random year and month, and"); + // Generates a random year and month, and Random random = new Random(); - OutputHelper.WriteLine("Verifies the number of days in the specific month/year"); + // Verifies the number of days in the specific month/year for (int i = 0; i < 100; i++) { int yr = random.Next(9999) + 1; int mnth = random.Next(12) + 1; DaysInMonthTest(yr, mnth); } - OutputHelper.WriteLine("Verifying no. of days in Feb, for 20th and 21st centuries"); + // Verifying no. of days in Feb, for 20th and 21st centuries for (int yr = 1900; yr < 2100; yr += 4) { DaysInMonthTest(yr, 2); @@ -1862,8 +1862,8 @@ public void DateTime_DaysInMonth_Test24() [TestMethod] public void DateTime_EqualsTest25() { - OutputHelper.WriteLine("Creating random-equal DateTimes"); - OutputHelper.WriteLine("And Verifying they are equal"); + // Creating random-equal DateTimes + // And Verifying they are equal DateTime dt1 = DateTime_btwn_1801_And_2801(); DateTime dt2 = new DateTime(year, month, day, hour, minute, second, millisec); Assert.IsTrue(DateTime.Equals(dt1, dt2)); @@ -1875,8 +1875,8 @@ public void DateTime_EqualsTest25() [TestMethod] public void DateTime_Subtract_DateTimeTest26() { - OutputHelper.WriteLine("Creating two Random DateTimes,"); - OutputHelper.WriteLine("dt1.Subtract(dt2) and verifying"); + // Creating two Random DateTimes, + // dt1.Subtract(dt2) and verifying DateTime dt1 = GetRandomDateTime(); DateTime dt2 = GetRandomDateTime(); TimeSpan ts1 = dt1.Subtract(dt2); @@ -1888,8 +1888,8 @@ public void DateTime_Subtract_DateTimeTest26() [TestMethod] public void DateTime_Subtract_TimeSpanTest27() { - OutputHelper.WriteLine("Creating now DateTime"); - OutputHelper.WriteLine("Subtracting random timespans and "); + // Creating now DateTime + // Subtracting random timespans and DateTime[] dtArr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); TimeSpan ts; @@ -1918,8 +1918,8 @@ public void DateTime_Subtract_TimeSpanTest27() [TestMethod] public void DateTime_op_AdditionTest30() { - OutputHelper.WriteLine("Creating Random DateTimes,"); - OutputHelper.WriteLine("Adds a specified period of time and verifying"); + // Creating Random DateTimes, + // Adds a specified period of time and verifying DateTime[] dtArr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); @@ -1944,8 +1944,8 @@ public void DateTime_op_AdditionTest30() [TestMethod] public void DateTime_op_Subtraction_DateTimeTest31() { - OutputHelper.WriteLine("Creating Random DateTimes,"); - OutputHelper.WriteLine("Subtracting one from the other and verifying"); + // Creating Random DateTimes, + // Subtracting one from the other and verifying DateTime[] dtArr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); for (int i = 0; i < dtArr.Length; i++) @@ -1960,8 +1960,8 @@ public void DateTime_op_Subtraction_DateTimeTest31() [TestMethod] public void DateTime_op_Subtraction_TimeSpanTest32() { - OutputHelper.WriteLine("Creating Random DateTime,"); - OutputHelper.WriteLine("Subtracting random TimeSpan and verifying"); + // Creating Random DateTime, + // Subtracting random TimeSpan and verifying DateTime[] dtArr = Get_ArrayOfRandomDateTimes(); Random random = new Random(); for (int i = 0; i < dtArr.Length; i++) @@ -1977,9 +1977,9 @@ public void DateTime_op_Subtraction_TimeSpanTest32() [TestMethod] public void DateTime_op_EqualityTest33() { - OutputHelper.WriteLine("Creating Random DateTime,"); - OutputHelper.WriteLine("Creating another DateTime equal to previous one"); - OutputHelper.WriteLine("Verifying the two DateTimes are equal using '=='"); + // Creating Random DateTime, + // Creating another DateTime equal to previous one + // Verifying the two DateTimes are equal using '==' DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(dt1.Ticks); @@ -1993,9 +1993,9 @@ public void DateTime_op_EqualityTest33() [TestMethod] public void DateTime_op_InequalityTest34() { - OutputHelper.WriteLine("Creating Random DateTime,"); - OutputHelper.WriteLine("Creating another Different DateTime"); - OutputHelper.WriteLine("Verifying the two DateTimes are not equal using '!='"); + // Creating Random DateTime, + // Creating another Different DateTime + // Verifying the two DateTimes are not equal using '!=' DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(dt1.Ticks + 100); @@ -2009,9 +2009,9 @@ public void DateTime_op_InequalityTest34() [TestMethod] public void DateTime_op_LessThanTest35() { - OutputHelper.WriteLine("Creating Random DateTime,"); - OutputHelper.WriteLine("Creating another Different DateTime greater than previous one"); - OutputHelper.WriteLine("Verifying 1st DateTime is less than 2nd using '<'"); + // Creating Random DateTime, + // Creating another Different DateTime greater than previous one + // Verifying 1st DateTime is less than 2nd using '<' DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(year + 1, month, day, hour, minute, second, millisec); @@ -2025,10 +2025,10 @@ public void DateTime_op_LessThanTest35() [TestMethod] public void DateTime_op_LessThanOrEqualTest36() { - OutputHelper.WriteLine("Creating Random DateTime, Creaing 2nd equal DateTime"); - OutputHelper.WriteLine("Creating 3rd Different DateTime greater than previous two"); - OutputHelper.WriteLine("Verifying 1st DateTime is less than or equal to 2nd DateTime using '<='"); - OutputHelper.WriteLine("Verifying 1st DateTime is less than or equal to 3rd DateTime using '<='"); + // Creating Random DateTime, Creaing 2nd equal DateTime + // Creating 3rd Different DateTime greater than previous two + // Verifying 1st DateTime is less than or equal to 2nd DateTime using '<=' + // Verifying 1st DateTime is less than or equal to 3rd DateTime using '<=' DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(year, month, day, hour, minute, second, millisec); DateTime dt3 = new DateTime(year + 1, month, day, hour, minute, second, millisec); @@ -2047,9 +2047,9 @@ public void DateTime_op_LessThanOrEqualTest36() [TestMethod] public void DateTime_op_GreaterThanTest37() { - OutputHelper.WriteLine("Creating Random DateTime,"); - OutputHelper.WriteLine("Creating another Different DateTime greater than previous one"); - OutputHelper.WriteLine("Verifying 2nd DateTime is greater than 1st using '>'"); + // Creating Random DateTime, + // Creating another Different DateTime greater than previous one + // Verifying 2nd DateTime is greater than 1st using '>' DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(year + 1, month, day, hour, minute, second, millisec); @@ -2063,10 +2063,10 @@ public void DateTime_op_GreaterThanTest37() [TestMethod] public void DateTime_op_GreaterThanOrEqualTest38() { - OutputHelper.WriteLine("Creating Random DateTime, Creaing 2nd equal DateTime"); - OutputHelper.WriteLine("Creating 3rd Different DateTime greater than previous two"); - OutputHelper.WriteLine("Verifying 1st DateTime is greater than or equal to 2nd DateTime using '>='"); - OutputHelper.WriteLine("Verifying 3rd DateTime is greater than or equal to 1st DateTime using '>='"); + // Creating Random DateTime, Creaing 2nd equal DateTime + // Creating 3rd Different DateTime greater than previous two + // Verifying 1st DateTime is greater than or equal to 2nd DateTime using '>=' + // Verifying 3rd DateTime is greater than or equal to 1st DateTime using '>=' DateTime dt1 = GetRandomDateTime(); DateTime dt2 = new DateTime(year, month, day, hour, minute, second, millisec); DateTime dt3 = new DateTime(year + 1, month, day, hour, minute, second, millisec); @@ -2088,7 +2088,7 @@ public void DateTime_MinValueTest39() /// /// 1. Verifies the MinValue property /// - OutputHelper.WriteLine("Getting the Min. DateTime and Verifying"); + // Getting the Min. DateTime and Verifying DateTime field = DateTime.MinValue; OutputHelper.WriteLine(field.Ticks.ToString()); Assert.AreEqual(field.Ticks, 504911232000000000); @@ -2100,7 +2100,7 @@ public void DateTime_MaxValueTest40() /// /// 1. Verifies the MinValue property /// - OutputHelper.WriteLine("Getting the Max. DateTime and Verifying"); + // Getting the Max. DateTime and Verifying DateTime field = DateTime.MaxValue; OutputHelper.WriteLine(field.Ticks.ToString()); Assert.AreEqual(field.Ticks, 946708127999999999); @@ -2112,7 +2112,7 @@ public void DateTime_DateTest41() /// /// 1. Verifies the Date property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Date and Verifying"); + // Creating a DateTime, getting the Date and Verifying DateTime dt = GetRandomDateTime(); DateTime _date = dt.Date; if ((_date.Year != dt.Year) || (_date.Month != dt.Month) || (_date.Day != dt.Day) || @@ -2130,7 +2130,7 @@ public void DateTime_DayTest42() /// /// 1. Verifies the Day property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Day and Verifying"); + // Creating a DateTime, getting the Day and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _day = testDateTime.Day; Assert.AreEqual(_day, day); @@ -2142,7 +2142,7 @@ public void DateTime_DayOfWeekTest43() /// /// 1. Verifies the DayOfWeek property /// - OutputHelper.WriteLine("Creating a DateTime, getting the DayOfWeek and Verifying"); + // Creating a DateTime, getting the DayOfWeek and Verifying DateTime testDateTime = new DateTime(2005, 1, 28); DayOfWeek prop = testDateTime.DayOfWeek; Assert.AreEqual((int)prop, (int)DayOfWeek.Friday); @@ -2154,8 +2154,8 @@ public void DateTime_DayOfYearTest44() /// /// 1. Verifies the DayOfYear property /// - OutputHelper.WriteLine("Creating a DateTime, getting the DayOfYear and Verifying"); - OutputHelper.WriteLine("DateTime::DayOfYear - Normal "); + // Creating a DateTime, getting the DayOfYear and Verifying + // DateTime::DayOfYear - Normal DateTime testDateTime = new DateTime(2005, 1, 1); int _dayOfYear = testDateTime.DayOfYear; Assert.AreEqual(_dayOfYear, 1); @@ -2167,7 +2167,7 @@ public void DateTime_HourTest45() /// /// 1. Verifies the Hour property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Hour and Verifying"); + // Creating a DateTime, getting the Hour and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _hour = testDateTime.Hour; Assert.AreEqual(_hour, hour); @@ -2179,7 +2179,7 @@ public void DateTime_MillisecondTest46() /// /// 1. Verifies the Millisecond property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Milliseconds and Verifying"); + // Creating a DateTime, getting the Milliseconds and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _mSec = testDateTime.Millisecond; Assert.AreEqual(_mSec, millisec); @@ -2191,7 +2191,7 @@ public void DateTime_MinuteTest47() /// /// 1. Verifies the Minute property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Minute and Verifying"); + // Creating a DateTime, getting the Minute and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _minute = testDateTime.Minute; Assert.AreEqual(_minute, minute); @@ -2203,7 +2203,7 @@ public void DateTime_MonthTest48() /// /// 1. Verifies the Month property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Month and Verifying"); + // Creating a DateTime, getting the Month and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _month = testDateTime.Month; Assert.AreEqual(_month, month); @@ -2216,10 +2216,10 @@ public void DateTime_NowTest49() /// 1. Creates 2 DateTimes /// 2. Verifies they are equal in all but Seconds and Millisecond /// - OutputHelper.WriteLine("Creating 2 DateTimes and verifying they are equal in yy/mm/dd/hr/mn"); + // Creating 2 DateTimes and verifying they are equal in yy/mm/dd/hr/mn DateTime test0 = DateTime.UtcNow; DateTime test1 = DateTime.UtcNow; - OutputHelper.WriteLine("Verifying"); + // Verifying if ((test0.Year != test1.Year) || (test0.Month != test1.Month) || (test0.Day != test1.Day) || (test0.Hour != test1.Hour) || (test0.Minute != test1.Minute)) @@ -2235,7 +2235,7 @@ public void DateTime_SecondTest51() /// /// 1. Verifies the Second property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Second and Verifying"); + // Creating a DateTime, getting the Second and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _sec = testDateTime.Second; Assert.AreEqual(_sec, second); @@ -2247,7 +2247,7 @@ public void DateTime_TicksTest52() /// /// 1. Verifies the Ticks property /// - OutputHelper.WriteLine("Creating a DateTime, getting the Ticks and Verifying"); + // Creating a DateTime, getting the Ticks and Verifying DateTime testDateTime = new System.DateTime(504911232000000000); long _ticks = testDateTime.Ticks; Assert.AreEqual(_ticks, 504911232000000000); @@ -2259,7 +2259,7 @@ public void DateTime_YearTest54() /// /// 1. Verifies the Year property /// - OutputHelper.WriteLine("Creating a DateTime.Today, getting the year and Verifying"); + // Creating a DateTime.Today, getting the year and Verifying DateTime testDateTime = GetRandomDateTime(); Int32 _year = testDateTime.Year; Assert.AreEqual(_year, year); @@ -2273,16 +2273,16 @@ public void DateTime_YearTest54() [TestMethod] public void DateTime_BelowMinDateTime_ArgumentOutOfRangeExceptionTest58() { - OutputHelper.WriteLine("Creating a DateTime with -ve Ticks and,"); - OutputHelper.WriteLine("verifying ArgumentOutOfRangeException is thrown"); + // Creating a DateTime with -ve Ticks and, + // verifying ArgumentOutOfRangeException is thrown Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { DateTime dt = new DateTime(-(new Random().Next(10) + 1)); }); } [TestMethod] public void DateTime_AboveMaxDatTime_ArgumentOutOfRangeExceptionTest59() { - OutputHelper.WriteLine("Creating a DateTime later than DateTime.MaxValue and,"); - OutputHelper.WriteLine("verifying ArgumentOutOfRangeException is thrown"); + // Creating a DateTime later than DateTime.MaxValue and, + // verifying ArgumentOutOfRangeException is thrown Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { DateTime dt1 = new DateTime(DateTime.MaxValue.Ticks + 1); }); Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { DateTime dt2 = new DateTime(10000, 1, 1, 0, 0, 0, 0); }); } @@ -2471,7 +2471,7 @@ private bool CheckDeviation(long dTicks1, long dTicks2) //fail if deviates by more than 0.05ms (500 ticks) if (diff > 500) { - OutputHelper.WriteLine("Difference ticks = '" + diff.ToString() + "'"); + // Difference ticks = '" + diff.ToString() + "' return false; } return true; @@ -2480,7 +2480,7 @@ private bool CheckDeviation(long dTicks1, long dTicks2) public void DaysInMonthTest(int yr, int mnth) { int daysInMonth = DateTime.DaysInMonth(yr, mnth); - OutputHelper.WriteLine("Got " + daysInMonth + " number of days in " + mnth + "/" + yr + " mm/yr"); + // Got " + daysInMonth + " number of days in " + mnth + "/" + yr + " mm/yr if (mnth == 2) { if (IsLeapYear(yr)) diff --git a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs index 859f02f0..1f017a38 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs @@ -21,7 +21,7 @@ class FinalizeObject { if (m_hasFinalized1 == false) { - OutputHelper.WriteLine("First finalization"); + // First finalization // Put this object back into a root by creating // a reference to it. @@ -36,7 +36,7 @@ class FinalizeObject } else { - OutputHelper.WriteLine("Second finalization"); + // Second finalization m_hasFinalized2 = true; } } @@ -58,16 +58,16 @@ class FinalizeObject // /// 6. Verify that object has been collected // /// // /// - // OutputHelper.WriteLine("Tests ReRegisterForFinalize"); - // OutputHelper.WriteLine("Create a FinalizeObject."); + // // Tests ReRegisterForFinalize + // // Create a FinalizeObject. // FinalizeObject mfo = new FinalizeObject(); // m_hasFinalized1 = false; // m_hasFinalized2 = false; - // OutputHelper.WriteLine("Release reference"); + // // Release reference // mfo = null; - // OutputHelper.WriteLine("Allow GC"); + // // Allow GC // GC.WaitForPendingFinalizers(); // int sleepTime = 1000; // int slept = 0; @@ -83,7 +83,7 @@ class FinalizeObject // // FinalizeObject.m_currentInstance field. Setting this value // // to null and forcing another garbage collection will now // // cause the object to Finalize permanently. - // OutputHelper.WriteLine("Reregister and allow for GC"); + // // Reregister and allow for GC // FinalizeObject.m_currentInstance = null; // GC.WaitForPendingFinalizers(); // sleepTime = 1000; @@ -110,17 +110,17 @@ class FinalizeObject // /// 6. Verify that object has not been collected // /// // /// - // OutputHelper.WriteLine("Tests SuppressFinalize"); - // OutputHelper.WriteLine("Create a FinalizeObject."); + // // Tests SuppressFinalize + // // Create a FinalizeObject. // FinalizeObject mfo = new FinalizeObject(); // m_hasFinalized1 = false; // m_hasFinalized2 = false; - // OutputHelper.WriteLine("Releasing"); + // // Releasing // System.GC.SuppressFinalize(mfo); // mfo = null; - // OutputHelper.WriteLine("Allow GC"); + // // Allow GC // GC.WaitForPendingFinalizers(); // int sleepTime = 1000; // int slept = 0; @@ -145,26 +145,26 @@ class FinalizeObject // /// 6. Verify that object has not been collected // /// // /// - // OutputHelper.WriteLine("Tests WaitForPendingFinalizers, dependant on test 1"); - // OutputHelper.WriteLine("will auto-fail if test 1 fails."); + // // Tests WaitForPendingFinalizers, dependant on test 1 + // // will auto-fail if test 1 fails. // Assert.IsTrue(m_Test1Result); - // OutputHelper.WriteLine("Create a FinalizeObject."); + // // Create a FinalizeObject. // FinalizeObject mfo = new FinalizeObject(); // m_hasFinalized1 = false; // m_hasFinalized2 = false; - // OutputHelper.WriteLine("Releasing"); + // // Releasing // mfo = null; - // OutputHelper.WriteLine("Wait for GC"); + // // Wait for GC // GC.WaitForPendingFinalizers(); // System.GC.WaitForPendingFinalizers(); - // OutputHelper.WriteLine("Releasing again"); + // // Releasing again // FinalizeObject.m_currentInstance = null; - // OutputHelper.WriteLine("Wait for GC"); + // // Wait for GC // GC.WaitForPendingFinalizers(); // System.GC.WaitForPendingFinalizers(); diff --git a/Tests/NFUnitTestSystemLib/UnitTestGuid.cs b/Tests/NFUnitTestSystemLib/UnitTestGuid.cs index 1a3e49a9..7b351c3f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGuid.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGuid.cs @@ -214,10 +214,10 @@ public void Guid_CompareTo_Test9() /// Guid guid1 = Guid.Empty; - OutputHelper.WriteLine("Verifing any instance of Guid, regardless of its value, is greater than null"); + // Verifing any instance of Guid, regardless of its value, is greater than null Assert.AreEqual(guid1.CompareTo(null), 1); Byte[] _bArr = new Byte[16]; - OutputHelper.WriteLine("Creating a Guid with all bytes zero"); + // Creating a Guid with all bytes zero Guid guid2 = new Guid(_bArr); Assert.AreEqual(guid1.CompareTo(guid2), 0); Guid guid3 = new Guid(0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3d); @@ -278,13 +278,13 @@ public void Guid_Equals_Test11() /// /// - OutputHelper.WriteLine("Creating 3 Guids with Guid.Empty and hex values"); + // Creating 3 Guids with Guid.Empty and hex values Guid guid11 = Guid.Empty; Guid guid12 = new Guid(0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3d); Guid guid13 = new Guid(0x7FFFFFFF, 0x7FFF, 0x7FFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); Guid[] gArr1 = new Guid[] { guid11, guid12, guid13 }; - OutputHelper.WriteLine("Creating Guids with 16 bytes constructor"); + // Creating Guids with 16 bytes constructor Byte[] _bArr1 = new Byte[16]; Guid guid21 = new Guid(_bArr1); Byte[] _bArr2 = new Byte[] { 181, 54, 255, 77, 222, 157, 118, 79, 154, 42, 150, 67, 80, 71, 6, 61 }; @@ -293,7 +293,7 @@ public void Guid_Equals_Test11() Guid guid23 = new Guid(_bArr3); Guid[] gArr2 = new Guid[] { guid21, guid22, guid23 }; - OutputHelper.WriteLine("Creating 3 Guids with Guid(int, short, short, byte ....) constructor"); + // Creating 3 Guids with Guid(int, short, short, byte ....) constructor Guid guid31 = new Guid(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Guid guid32 = new Guid(1308571317, 40414, 20342, 154, 42, 150, 67, 80, 71, 6, 61); Guid guid33 = new Guid(int.MaxValue, short.MaxValue, short.MaxValue, byte.MaxValue, byte.MaxValue, diff --git a/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs b/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs index a8c76a3d..89ea8ecd 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs @@ -44,8 +44,8 @@ private bool Method2(float f) [TestMethod] public void SystemType1_GetType_Test() { - OutputHelper.WriteLine("Checking reflection types to assure that they are boxed when used as local variables"); - OutputHelper.WriteLine("and when they are assigned to non-valuetype containers (which used to crash)"); + // Checking reflection types to assure that they are boxed when used as local variables + // and when they are assigned to non-valuetype containers (which used to crash) ArrayList list = new ArrayList(); int i = 0; diff --git a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs index b088bf2f..5a79db2d 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs @@ -17,21 +17,21 @@ class UnitTestStringTests [TestMethod] public void Ctor_Test() { - OutputHelper.WriteLine("Test of the standard constructor"); + // Test of the standard constructor char[] car = new Char[] { 'a', 'b', 'c', 'd' }; - OutputHelper.WriteLine("Char [], start, number"); + // Char [], start, number string str = new string(car, 1, 2); Assert.AreEqual(str, "bc"); str = new string(car, 0, 4); Assert.AreEqual(str, "abcd"); - OutputHelper.WriteLine("Char []"); + // Char [] str = new string(car); Assert.AreEqual(str, "abcd"); - OutputHelper.WriteLine("Char, number"); + // Char, number str = new string('\n', 33); Assert.AreEqual(str.Length, 33); for (int i = 0; i < str.Length; i++) @@ -39,17 +39,17 @@ public void Ctor_Test() Assert.AreEqual(str[i], '\n'); } - OutputHelper.WriteLine("Char, string terminator known failure. "); + // Char, string terminator known failure. char[] car2 = new char[] { (char)0, (char)65 }; string s = new string(car2); Assert.AreEqual(s, "\0A"); - OutputHelper.WriteLine("This was previously bug 20620"); + // This was previously bug 20620 - OutputHelper.WriteLine("new char[0]"); + // new char[0] str = new string(new char[0]); Assert.AreEqual(str, string.Empty); - OutputHelper.WriteLine("null"); + // null str = new string(null); Assert.AreEqual(str, string.Empty); } @@ -57,21 +57,21 @@ public void Ctor_Test() [TestMethod] public void CompareTo_Test3() { - OutputHelper.WriteLine("Test of the CompareTo method"); + // Test of the CompareTo method string str = "hello"; object ob = "Hello"; - OutputHelper.WriteLine("NormalCompareTo"); + // NormalCompareTo Assert.AreEqual(str.CompareTo((object)"hello"), 0); Assert.IsTrue(str.CompareTo(ob) > 0); Assert.IsTrue(str.CompareTo((object)"zello") < 0); - OutputHelper.WriteLine("CompareTo null"); + // CompareTo null Assert.IsTrue(str.CompareTo((object)null) > 0); } [TestMethod] public void GetHashCode_Test4() { - OutputHelper.WriteLine("Test of the GetHashCode method"); + // Test of the GetHashCode method string[] strs = new string[] { "abcd", "bcda", "cdab", "dabc" }; for (int i = 0; i < 4; i++) @@ -95,9 +95,9 @@ public void GetHashCode_Test4() [TestMethod] public void Equals_Test5() { - OutputHelper.WriteLine("This verifies the String.Equals functionality."); - OutputHelper.WriteLine("It compares the string value using the Equals function"); - OutputHelper.WriteLine("to valid and invalid values as well as casted object values."); + // This verifies the String.Equals functionality. + // It compares the string value using the Equals function + // to valid and invalid values as well as casted object values. string str = "abcd"; object ob2 = "bcd"; @@ -121,7 +121,7 @@ public void Equals_Test5() [TestMethod] public void ToString_Test6() { - OutputHelper.WriteLine("Test of the ToString method"); + // Test of the ToString method string str = "abc"; Assert.AreEqual(str, str.ToString()); Assert.AreEqual(str, str.ToString().ToString().ToString()); @@ -131,7 +131,7 @@ public void ToString_Test6() [TestMethod] public void ToCharArray_Test13() { - OutputHelper.WriteLine("Test of the ToCharArray method"); + // Test of the ToCharArray method char[] car1 = new Char[] { 'a', 'b', 'c', 'd' }; char[] car2 = new Char[] { }; @@ -140,13 +140,13 @@ public void ToCharArray_Test13() string str2 = "abcde"; string str3 = "ABCD"; - OutputHelper.WriteLine("With 0 args"); + // With 0 args CollectionAssert.AreEqual(str1.ToCharArray(), car1); CollectionAssert.AreNotEqual(str2.ToCharArray(), car1); CollectionAssert.AreNotEqual(str3.ToCharArray(), car1); CollectionAssert.AreNotEqual(str1.ToCharArray(), car2); - OutputHelper.WriteLine("With 1 args"); + // With 1 args CollectionAssert.AreNotEqual(str1.ToCharArray(0, 3), car1); CollectionAssert.AreEqual(str2.ToCharArray(0, 4), car1); CollectionAssert.AreNotEqual(str3.ToCharArray(0, 3), car1); @@ -156,7 +156,7 @@ public void ToCharArray_Test13() [TestMethod] public void Split_Test15() { - OutputHelper.WriteLine("Testing the Split method"); + // Testing the Split method char[] car1 = new Char[] { '@', 'q' }; char[] car2 = new Char[] { }; string str1 = "ab@cd"; @@ -168,9 +168,9 @@ public void Split_Test15() Assert.AreEqual(str2.Split(car1)[1], ""); Assert.AreEqual(str1.Split(car2)[0], "ab@cd"); - OutputHelper.WriteLine("Verify split with a count"); - OutputHelper.WriteLine("This is currently a known issue"); - OutputHelper.WriteLine("20659 String.Split with a count parameter always returns the whole string."); + // Verify split with a count + // This is currently a known issue + // 20659 String.Split with a count parameter always returns the whole string. string[] oneTwoThree = "1 2 3".Split(new char[] { ' ' }, 1); Assert.IsTrue(oneTwoThree.Length <= 1); } @@ -178,7 +178,7 @@ public void Split_Test15() [TestMethod] public void Substring_Test17() { - OutputHelper.WriteLine("Testing the Substring method"); + // Testing the Substring method string str1 = "abcde"; Assert.AreEqual(str1.Substring(0), str1); @@ -190,7 +190,7 @@ public void Substring_Test17() [TestMethod] public void Trim_Test19() { - OutputHelper.WriteLine("Testing the Trim method"); + // Testing the Trim method char[] car1 = new Char[] { '@', 'q' }; string str1 = " abc@de "; @@ -204,7 +204,7 @@ public void Trim_Test19() [TestMethod] public void TrimStart_Test20() { - OutputHelper.WriteLine("Testing the TrimStart method"); + // Testing the TrimStart method char[] car1 = new Char[] { '@', 'q' }; string str1 = " abc@de "; @@ -218,7 +218,7 @@ public void TrimStart_Test20() [TestMethod] public void TrimEnd_Test21() { - OutputHelper.WriteLine("Testing the TrimEnd method"); + // Testing the TrimEnd method char[] car1 = new Char[] { '@', 'q' }; string str1 = " abc@de "; @@ -232,7 +232,7 @@ public void TrimEnd_Test21() [TestMethod] public void IndexOf_Test28() { - OutputHelper.WriteLine("Testing the IndexOf method"); + // Testing the IndexOf method string str1 = "@ abc@de "; Assert.AreEqual(str1.IndexOf('@'), 0); @@ -246,7 +246,7 @@ public void IndexOf_Test28() [TestMethod] public void IndexOfAny_Test31() { - OutputHelper.WriteLine("Testing the IndexOfAny method"); + // Testing the IndexOfAny method string str1 = "@ abc@de "; char[] car1 = new Char[] { '@', 'b' }; @@ -258,7 +258,7 @@ public void IndexOfAny_Test31() [TestMethod] public void LastIndexOf_Test37() { - OutputHelper.WriteLine("Testing the LastIndexOf method"); + // Testing the LastIndexOf method string str1 = "@ abc@de "; Assert.AreEqual(str1.LastIndexOf('@'), 5); @@ -272,7 +272,7 @@ public void LastIndexOf_Test37() [TestMethod] public void LastIndexOfAny_Test40() { - OutputHelper.WriteLine("Testing the LastIndexOfAny method"); + // Testing the LastIndexOfAny method string str1 = "@ abc@de "; char[] car1 = new Char[] { '@', 'b' }; @@ -285,7 +285,7 @@ public void LastIndexOfAny_Test40() [TestMethod] public void ToLower_Test51() { - OutputHelper.WriteLine("Testing the ToLower method"); + // Testing the ToLower method string str1 = "@ ABC@de "; Assert.AreEqual(str1.ToLower(), "@ abc@de "); @@ -294,7 +294,7 @@ public void ToLower_Test51() [TestMethod] public void ToUpper_Test52() { - OutputHelper.WriteLine("Testing the ToUpper method"); ; + // Testing the ToUpper method ; string str1 = "@ ABC@de "; Assert.AreEqual(str1.ToUpper(), "@ ABC@DE "); @@ -303,7 +303,7 @@ public void ToUpper_Test52() [TestMethod] public void Length_Test71() { - OutputHelper.WriteLine("Testing the Length property"); ; + // Testing the Length property ; string str1 = "@ ABC@de "; Assert.AreEqual(str1.Length, 9); @@ -341,7 +341,7 @@ public void FormatWithNull() [TestMethod] public void Contains_String() { - OutputHelper.WriteLine("Test of Contains"); + // Test of Contains string s = "Hello"; string value = "ello"; @@ -372,7 +372,7 @@ public void Contains_String() [TestMethod] public void ZeroLengthContains_StringComparison() { - OutputHelper.WriteLine("Test of Zero Length Contains"); + // Test of Zero Length Contains var a = new char[3]; @@ -396,7 +396,7 @@ public void ZeroLengthContains_StringComparison() [TestMethod] public void ContainsMatch_StringComparison() { - OutputHelper.WriteLine("Test of Contains match"); + // Test of Contains match string value = "456"; @@ -408,7 +408,7 @@ public void ContainsMatch_StringComparison() [TestMethod] public void ContainsMatchDifferentSpans_StringComparison() { - OutputHelper.WriteLine("Test of Contains match with differnet lengths"); + // Test of Contains match with differnet lengths string value1 = "4567"; string value2 = "456"; @@ -421,7 +421,7 @@ public void ContainsMatchDifferentSpans_StringComparison() [TestMethod] public void ContainsNoMatch_StringComparison() { - OutputHelper.WriteLine("Test of Contains with no match"); + // Test of Contains with no match for (int length = 1; length < 150; length++) { @@ -450,7 +450,7 @@ public void ContainsNoMatch_StringComparison() [TestMethod] public void MakeSureNoContainsChecksGoOutOfRange_StringComparison() { - OutputHelper.WriteLine("Test of Contains with no match out of range"); + // Test of Contains with no match out of range for (int length = 0; length < 100; length++) { @@ -480,7 +480,7 @@ public void MakeSureNoContainsChecksGoOutOfRange_StringComparison() [TestMethod] public static void StartsWith_StringComparison() { - OutputHelper.WriteLine("Test of StartsWith"); + // Test of StartsWith string s = "Hello"; string value = "H"; @@ -538,7 +538,7 @@ public static void StartsWith_StringComparison() [TestMethod] public static void StartsWith_NullInStrings() { - OutputHelper.WriteLine("Test of StartsWith with null strings"); + // Test of StartsWith with null strings Assert.IsFalse("\0test".StartsWith("test")); Assert.IsFalse("te\0st".StartsWith("test")); @@ -550,7 +550,7 @@ public static void StartsWith_NullInStrings() [TestMethod] public static void StartsWith_Invalid() { - OutputHelper.WriteLine("Test of invalid StartsWith"); + // Test of invalid StartsWith string s = "Hello"; @@ -561,7 +561,7 @@ public static void StartsWith_Invalid() [TestMethod] public static void ZeroLengthStartsWith_Char() { - OutputHelper.WriteLine("Test of StartsWith with zero length char"); + // Test of StartsWith with zero length char var a = new char[3]; @@ -574,7 +574,7 @@ public static void ZeroLengthStartsWith_Char() [TestMethod] public static void EndsWith_Invalid() { - OutputHelper.WriteLine("Test of invalid EndsWith"); + // Test of invalid EndsWith string s = "Hello"; @@ -585,7 +585,7 @@ public static void EndsWith_Invalid() [TestMethod] public static void SameSpanStartsWith_Char() { - OutputHelper.WriteLine("Test of StartsWith with self"); + // Test of StartsWith with self string s1 = "456"; @@ -595,7 +595,7 @@ public static void SameSpanStartsWith_Char() [TestMethod] public static void LengthMismatchStartsWith_Char() { - OutputHelper.WriteLine("Test of StartsWith with length mismatch and chars"); + // Test of StartsWith with length mismatch and chars char[] a = { '4', '5', '6' }; @@ -608,7 +608,7 @@ public static void LengthMismatchStartsWith_Char() [TestMethod] public static void StartsWithMatch_Char() { - OutputHelper.WriteLine("Test of StartsWith with matching chars"); + // Test of StartsWith with matching chars char[] a = { '4', '5', '6' }; @@ -621,7 +621,7 @@ public static void StartsWithMatch_Char() [TestMethod] public static void StartsWithNoMatch_Char() { - OutputHelper.WriteLine("Test of StartsWith with no matching chars"); + // Test of StartsWith with no matching chars for (int length = 1; length < 32; length++) { @@ -647,7 +647,7 @@ public static void StartsWithNoMatch_Char() [TestMethod] public static void MakeSureNoStartsWithChecksGoOutOfRange_Char() { - OutputHelper.WriteLine("Test of StartsWith with no matching chars and going out of range"); + // Test of StartsWith with no matching chars and going out of range for (int length = 0; length < 100; length++) { @@ -668,7 +668,7 @@ public static void MakeSureNoStartsWithChecksGoOutOfRange_Char() [TestMethod] public static void ZeroLengthStartsWith_StringComparison() { - OutputHelper.WriteLine("Test of StartsWith with zero length"); + // Test of StartsWith with zero length var a = new char[3]; @@ -683,7 +683,7 @@ public static void ZeroLengthStartsWith_StringComparison() [TestMethod] public static void SameSpanStartsWith_StringComparison() { - OutputHelper.WriteLine("Test of StartsWith with self"); + // Test of StartsWith with self string s1 = "456"; Assert.IsTrue(s1.StartsWith(s1)); @@ -692,7 +692,7 @@ public static void SameSpanStartsWith_StringComparison() [TestMethod] public static void LengthMismatchStartsWith_StringComparison() { - OutputHelper.WriteLine("Test of StartsWith with length mismatch"); + // Test of StartsWith with length mismatch string value = "456"; @@ -704,7 +704,7 @@ public static void LengthMismatchStartsWith_StringComparison() [TestMethod] public static void StartsWithMatch_StringComparison() { - OutputHelper.WriteLine("Test of StartsWith with match with different lengths"); + // Test of StartsWith with match with different lengths string value = "456"; @@ -716,7 +716,7 @@ public static void StartsWithMatch_StringComparison() [TestMethod] public static void EndsWith_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith"); + // Test of EndsWith string s = "Hello"; string value = "o"; @@ -755,7 +755,7 @@ public static void EndsWith_StringComparison() [TestMethod] public static void EndsWith_NullInStrings() { - OutputHelper.WriteLine("Test of EndsWith with null strings"); + // Test of EndsWith with null strings Assert.IsTrue("te\0st".EndsWith("e\0st")); Assert.IsFalse("te\0st".EndsWith("test")); @@ -766,7 +766,7 @@ public static void EndsWith_NullInStrings() [TestMethod] public static void ZeroLengthEndsWith_Char() { - OutputHelper.WriteLine("Test of EndsWith with chars"); + // Test of EndsWith with chars var a = new char[3]; @@ -779,7 +779,7 @@ public static void ZeroLengthEndsWith_Char() [TestMethod] public static void SameSpanEndsWith_Char() { - OutputHelper.WriteLine("Test of EndsWith with self"); + // Test of EndsWith with self string s = "456"; bool b = s.EndsWith(s); @@ -789,7 +789,7 @@ public static void SameSpanEndsWith_Char() [TestMethod] public static void LengthMismatchEndsWith_Char() { - OutputHelper.WriteLine("Test of EndsWith with length mismatch"); + // Test of EndsWith with length mismatch string value = "456"; @@ -802,7 +802,7 @@ public static void LengthMismatchEndsWith_Char() [TestMethod] public static void EndsWithMatch_Char() { - OutputHelper.WriteLine("Test of EndsWith match with chars"); + // Test of EndsWith match with chars string value = "456"; @@ -815,7 +815,7 @@ public static void EndsWithMatch_Char() [TestMethod] public static void EndsWithNoMatch_Char() { - OutputHelper.WriteLine("Test of EndsWith with no match"); + // Test of EndsWith with no match for (int length = 1; length < 32; length++) { @@ -842,7 +842,7 @@ public static void EndsWithNoMatch_Char() [TestMethod] public static void ZeroLengthEndsWith_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with zero length"); + // Test of EndsWith with zero length var a = new char[3]; @@ -857,7 +857,7 @@ public static void ZeroLengthEndsWith_StringComparison() [TestMethod] public static void MakeSureNoEndsWithChecksGoOutOfRange_Char() { - OutputHelper.WriteLine("Test of EndsWith with no match and going out of range"); + // Test of EndsWith with no match and going out of range for (int length = 0; length < 100; length++) { @@ -878,7 +878,7 @@ public static void MakeSureNoEndsWithChecksGoOutOfRange_Char() [TestMethod] public static void LengthMismatchEndsWith_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with lenght mismatch"); + // Test of EndsWith with lenght mismatch string value = "456"; @@ -890,7 +890,7 @@ public static void LengthMismatchEndsWith_StringComparison() [TestMethod] public static void EndsWithMatch_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with substrings"); + // Test of EndsWith with substrings string value = "456"; @@ -902,7 +902,7 @@ public static void EndsWithMatch_StringComparison() [TestMethod] public static void EndsWithMatchDifferentSpans_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with natch on different comparisons"); + // Test of EndsWith with natch on different comparisons string value1 = "7456"; string value2 = "456"; @@ -915,7 +915,7 @@ public static void EndsWithMatchDifferentSpans_StringComparison() [TestMethod] public static void EndsWithNoMatch_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with no match on different lengths and comparisons"); + // Test of EndsWith with no match on different lengths and comparisons for (int length = 1; length < 150; length++) { @@ -940,7 +940,7 @@ public static void EndsWithNoMatch_StringComparison() [TestMethod] public static void MakeSureNoEndsWithChecksGoOutOfRange_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with no match and gogin out of range"); + // Test of EndsWith with no match and gogin out of range for (int length = 0; length < 100; length++) { @@ -960,7 +960,7 @@ public static void MakeSureNoEndsWithChecksGoOutOfRange_StringComparison() [TestMethod] public static void EndsWithNoMatchNonOrdinal_StringComparison() { - OutputHelper.WriteLine("Test of EndsWith with no match on different ordinal comparisons"); + // Test of EndsWith with no match on different ordinal comparisons string s = "dabc"; string value = "aDc"; diff --git a/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs b/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs index a15ea104..6dcc3754 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs @@ -37,7 +37,7 @@ public bool CCtorHelper(ref TimeSpan ts) } catch { - OutputHelper.WriteLine("Exception Caught"); + // Exception Caught testResult = false; } OutputHelper.WriteLine((testResult ? "PASS" : "FAIL")); @@ -51,7 +51,7 @@ public void CCtor_Test() /// 1. Test copy constructor /// /// - OutputHelper.WriteLine("Copy Constructor test"); + // Copy Constructor test TimeSpan ts = new TimeSpan(); OutputHelper.WriteLine(ts.ToString()); Assert.IsTrue(CCtorHelper(ref ts)); @@ -88,7 +88,7 @@ public void Ctor64Helper(Int64 i64) /// 1. Test constructor /// /// - OutputHelper.WriteLine("Constructor test"); + // Constructor test TimeSpan ts = new TimeSpan(i64); long days = i64 / m_TicksPerDay; @@ -116,10 +116,10 @@ public void Ctor_with_Int64() /// 1. Test constructor with Int64 /// /// - OutputHelper.WriteLine("Constructor test for 64 bit int"); + // Constructor test for 64 bit int Int64 i64 = 0; - OutputHelper.WriteLine("Normal"); + // Normal Random random = new Random(); for (int i = 0; i < 5; i++) @@ -129,7 +129,7 @@ public void Ctor_with_Int64() Ctor64Helper(i64); } - OutputHelper.WriteLine("Max and Min values"); + // Max and Min values i64 = 0x7fffffffffffffff; Ctor64Helper(i64); Ctor64Helper(TimeSpan.MaxValue.Ticks); @@ -175,7 +175,7 @@ public void CtorHelper(int[] vals) m_TicksPerMinute + vals[3] * m_TicksPerSecond + vals[4] * m_TicksPerMillisecond; break; default: - OutputHelper.WriteLine("Invalid parameter!"); + // Invalid parameter! throw new Exception("Invalid parameter!"); break; } @@ -202,7 +202,7 @@ public void Ctor_Test1() /// 1. Test constructor with Hour Minute Second /// /// - OutputHelper.WriteLine("Constructor test H:M:S"); + // Constructor test H:M:S OutputHelper.WriteLine(m_TicksPerDay.ToString() + " == " + TimeSpan.TicksPerDay.ToString()); @@ -233,7 +233,7 @@ public void Ctor_Test2() /// 1. Test constructor with Day Hour Minute Second /// /// - OutputHelper.WriteLine("Constructor test D:H:M:S"); + // Constructor test D:H:M:S int[] vals = new int[4]; Random random = new Random(); @@ -254,9 +254,9 @@ public void Ctor_Test3() /// 1. Test constructor with Day Hour Minute Second Millisecond /// /// - OutputHelper.WriteLine("Constructor test D:H:M:S:MS"); + // Constructor test D:H:M:S:MS - OutputHelper.WriteLine("TimeSpan::Ctor - Normal "); + // TimeSpan::Ctor - Normal int[] vals = new int[5]; Random random = new Random(); @@ -280,10 +280,10 @@ public void CompareTo_Test4() /// 2. Test the CompareTo method /// /// - OutputHelper.WriteLine("Testing the CompareTo method"); + // Testing the CompareTo method Random random = new Random(); - OutputHelper.WriteLine("Creating TimeSpan"); + // Creating TimeSpan int day = random.Next(10 * 365) + 1; //days int hour = random.Next(23); //hours int minute = random.Next(59); //minutes @@ -291,7 +291,7 @@ public void CompareTo_Test4() int msec = random.Next(999); //milliseconds TimeSpan ts1 = new TimeSpan(day, hour, minute, second, msec); - OutputHelper.WriteLine("Testing CompareTo"); + // Testing CompareTo Assert.AreEqual(-1, ts1.CompareTo(new TimeSpan(day + 1, hour, minute, second, msec))); OutputHelper.WriteLine(ts1.CompareTo(new TimeSpan(day + 1, hour, minute, second, msec)).ToString()); Assert.AreEqual(1, ts1.CompareTo(new TimeSpan(day, hour - 1, minute, second, msec))); @@ -308,10 +308,10 @@ public void GetHashCode_Test5() /// 2. Test that GetHashCode returns differently for different TimeSpans /// /// - OutputHelper.WriteLine("Testing the GetHashCode method"); + // Testing the GetHashCode method Random random = new Random(); - OutputHelper.WriteLine("Test that GetHashCode returns the same for the same TimeSpan"); + // Test that GetHashCode returns the same for the same TimeSpan for (int i = 0; i < 30; i++) { int hours = random.Next(23); @@ -325,10 +325,10 @@ public void GetHashCode_Test5() } TimeSpan ts1 = new TimeSpan(1, 1, 1); - OutputHelper.WriteLine("Test that GetHashCode returns differently for different TimeSpans"); - OutputHelper.WriteLine("This may fail erroneously."); - OutputHelper.WriteLine("From the docs two different TimeSpans may have same hashcode"); - OutputHelper.WriteLine("But, for the most part the values should be different."); + // Test that GetHashCode returns differently for different TimeSpans + // This may fail erroneously. + // From the docs two different TimeSpans may have same hashcode + // But, for the most part the values should be different. for (int i = 0; i < 5; i++) { TimeSpan ts2 = new TimeSpan(random.Next(23), @@ -353,7 +353,7 @@ public void Equals_Test6() /// 1. Test the Equals method /// /// - OutputHelper.WriteLine("Testing the Equals method"); + // Testing the Equals method Random random = new Random(); // verify same timespan computes to same hash for (int i = 0; i < 5; i++) @@ -364,11 +364,11 @@ public void Equals_Test6() TimeSpan ts01 = new TimeSpan(hours, minutes, seconds); TimeSpan ts02 = new TimeSpan(hours, minutes, seconds); OutputHelper.WriteLine(ts01.ToString() + " == " + ts02.ToString()); - OutputHelper.WriteLine("Expected true"); + // Expected true Assert.IsTrue(ts01.Equals(ts02)); TimeSpan ts03 = new TimeSpan(hours, minutes, seconds); TimeSpan ts04 = new TimeSpan(hours + 1, minutes - 1, seconds + 1); - OutputHelper.WriteLine("Expected false"); + // Expected false Assert.IsFalse(ts03.Equals(ts04)); } } @@ -380,7 +380,7 @@ public void ToString_Test7() /// 1. Test the ToString method /// /// - OutputHelper.WriteLine("Testing ToString method"); + // Testing ToString method Random random = new Random(); for (int i = 0; i < 5; i++) { @@ -416,9 +416,9 @@ public void Add_Test8() /// 1. Test the binary + operator /// /// - OutputHelper.WriteLine("Testing the + operator"); + // Testing the + operator - OutputHelper.WriteLine("TimeSpan::Add - Normal "); + // TimeSpan::Add - Normal Random random = new Random(); for (int i = 0; i < 5; i++) { @@ -482,7 +482,7 @@ public void Compare_Test9() /// /// - OutputHelper.WriteLine("Testing the Compare method"); + // Testing the Compare method Random random = new Random(); int day = random.Next(10 * 365) + 1; //days @@ -515,7 +515,7 @@ public void Duration_Test10() /// 1. Test the Duration property with several random TimeSpans /// /// - OutputHelper.WriteLine("Testing Duration property"); + // Testing Duration property Random random = new Random(); for (int i = 0; i < 5; i++) { @@ -537,7 +537,7 @@ public void Negate_Test12() /// 1. Test the Negate method /// /// - OutputHelper.WriteLine("Testing the Negate method"); + // Testing the Negate method Random random = new Random(); for (int i = 0; i < 5; i++) { @@ -561,7 +561,7 @@ public void Subtract_Test13() /// 1. Test subtraction, the binary - operator /// /// - OutputHelper.WriteLine("Testing the binary - operator"); + // Testing the binary - operator Random random = new Random(); for (int i = 0; i < 5; i++) @@ -666,8 +666,8 @@ public void FromTicks_Test14() /// 1. Testing the use of ticks in constructors /// /// - OutputHelper.WriteLine("Testing the use of ticks, ticks per increment specified in this file"); - OutputHelper.WriteLine("TimeSpan::FromTicks - Normal "); + // Testing the use of ticks, ticks per increment specified in this file + // TimeSpan::FromTicks - Normal Random random = new Random(); int max = 5000; int maxOthers = 200; @@ -724,7 +724,7 @@ public void op_UnaryNegation_Test15() /// 1. Test negation, the unary - operator /// /// - OutputHelper.WriteLine("Testing the unary - operator"); + // Testing the unary - operator Random random = new Random(); int mxd = 24000; @@ -797,7 +797,7 @@ public void op_Subtraction_Test16() /// 1. Test subtraction, the binary - operator with non TimeSpan args /// /// - OutputHelper.WriteLine("Testing the binary - operator with non TimeSpan args"); + // Testing the binary - operator with non TimeSpan args Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -824,7 +824,7 @@ public void op_UnaryPlus_Test17() /// 1. Test the unary + operator /// /// - OutputHelper.WriteLine("Testing the unary + operator"); + // Testing the unary + operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -849,7 +849,7 @@ public void op_Addition_Test18() /// 1. Test the binary + operator with non-TimeSpan args /// /// - OutputHelper.WriteLine("Testing the binary + operator with non-TimeSpan args"); + // Testing the binary + operator with non-TimeSpan args Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -885,7 +885,7 @@ public void op_Equality_Test19() /// 1. Test equality, the binary == operator /// /// - OutputHelper.WriteLine("Testing the == operator"); + // Testing the == operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -926,7 +926,7 @@ public void op_Inequality_Test20() /// 1. Test inequality, the binary != operator /// /// - OutputHelper.WriteLine("Testing the != operator"); + // Testing the != operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -969,13 +969,13 @@ private bool LTGTHelper(int days1, int hours1, int mins1, int secs1, int ms1, in testResult &= ((ts1 >= ts2) == expected); else { - OutputHelper.WriteLine("Test Error: Invalid opcode"); + // Test Error: Invalid opcode testResult = false; } } catch { - OutputHelper.WriteLine("Exception Caught"); + // Exception Caught testResult = false; } return testResult; @@ -988,7 +988,7 @@ public void op_LessThan_Test21() /// 1. Testing the binary Less Than operator /// /// - OutputHelper.WriteLine("Testing the Less Than operator"); + // Testing the Less Than operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -1020,7 +1020,7 @@ public void op_LessThanOrEqual_Test22() /// 1. Test the binary Less Than Equals operator /// /// - OutputHelper.WriteLine("Testing the Less Than Equals operator"); + // Testing the Less Than Equals operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -1052,7 +1052,7 @@ public void op_GreaterThan_Test23() /// 1. Test the binary Greater Than operator /// /// - OutputHelper.WriteLine("Testing the Greater Than operator"); + // Testing the Greater Than operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -1084,7 +1084,7 @@ public void op_GreaterThanOrEqual_Test24() /// 1. Test the binary Greater Than Equals operator /// /// - OutputHelper.WriteLine("Testing the Greater Than Equals operator"); + // Testing the Greater Than Equals operator Random random = new Random(); int mxd = 24000; int mx = 10000; @@ -1128,9 +1128,9 @@ public void Ticks_Test28() /// 1. Test the Ticks Property /// /// - OutputHelper.WriteLine("Testing the Ticks Property"); + // Testing the Ticks Property - OutputHelper.WriteLine("TimeSpan::Ticks - Normal "); + // TimeSpan::Ticks - Normal Random random = new Random(); int max = 24000; int maxOthers = 10000; diff --git a/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs b/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs index 609697c2..6580cac9 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs @@ -191,37 +191,37 @@ public void SystemType1_GetTypeNew_Test() Assembly Int32Assm = Assembly.Load("mscorlib"); - OutputHelper.WriteLine("This tests the Assembly.GetType(String) by passing \"Namespace.Class\""); + // This tests the Assembly.GetType(String) by passing \"Namespace.Class\" Type myType0 = Int32Assm.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType0.FullName); Assert.IsType(myType0, testInt32.GetType()); - OutputHelper.WriteLine("This tests the Type.GetType(String) by passing \"Namespace.Class\""); + // This tests the Type.GetType(String) by passing \"Namespace.Class\" Type myType1 = Type.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType1.FullName); Assert.IsType(myType1, testInt32.GetType()); - OutputHelper.WriteLine("This tests the Type.GetType(String) by passing \"Namespace.Class, assembly\""); + // This tests the Type.GetType(String) by passing \"Namespace.Class, assembly\" Type myType2 = Type.GetType("System.Int32, mscorlib"); OutputHelper.WriteLine("The full name is " + myType2.FullName); Assert.IsType(myType2, testInt32.GetType()); - OutputHelper.WriteLine("This tests the Type.GetType(String) by passing \"Namespace.Class, assembly, Version=\"a.b.c.d\"\""); + // This tests the Type.GetType(String) by passing \"Namespace.Class, assembly, Version=\"a.b.c.d\"\" string typeName3 = "System.Int32, mscorlib, Version=" + Int32Assm.GetName().Version.ToString(); Type myType3 = Type.GetType(typeName3); OutputHelper.WriteLine("The full name is " + myType3.FullName); Assert.IsType(myType3, testInt32.GetType()); - OutputHelper.WriteLine("This tests the Type.GetType() method for nested classes"); + // This tests the Type.GetType() method for nested classes TestObject1 testTestObject1 = new TestObject1(); Type myType4 = testTestObject1.GetType(); OutputHelper.WriteLine("The full name is " + myType4.FullName); Assert.IsType(myType4, Type.GetType("NFUnitTestSystemLib.UnitTestTypeTests+TestObject1")); - OutputHelper.WriteLine("Since NoneSuch does not exist in this assembly, "); - OutputHelper.WriteLine("GetType throws a TypeLoadException."); + // Since NoneSuch does not exist in this assembly, + // GetType throws a TypeLoadException. Assert.ThrowsException(typeof(NullReferenceException), () => { Type myType5 = Type.GetType("NoneSuch"); @@ -261,7 +261,7 @@ public void SystemType1_Type_Names_Test() [TestMethod] public void SystemType2_Assembly_Test() { - OutputHelper.WriteLine("This tests the Assembly property"); + // This tests the Assembly property //Assigned and manipulated to avoid compiler warning int testInt32 = -1; @@ -280,7 +280,7 @@ public void SystemType2_Assembly_Test() [TestMethod] public void SystemType3_BaseType_Test() { - OutputHelper.WriteLine("This tests the BaseType() method"); + // This tests the BaseType() method //Assigned and manipulated to avoid compiler warning int testInt32 = -1; @@ -298,7 +298,7 @@ public void SystemType3_BaseType_Test() [TestMethod] public void SystemType4_DeclaringType_Test() { - OutputHelper.WriteLine("This tests the DeclaringType property"); + // This tests the DeclaringType property //Assigned and manipulated to avoid compiler warning int testInt32 = -1; @@ -319,7 +319,7 @@ public void SystemType4_DeclaringType_Test() [TestMethod] public void SystemType5_GetConstructor_Test() { - OutputHelper.WriteLine("This tests the GetConstructor(Type[]) method"); + // This tests the GetConstructor(Type[]) method TestObject2 testTestObject2 = new TestObject2(5); Type myType2 = testTestObject2.GetType(); OutputHelper.WriteLine("The full name is " + myType2.FullName); @@ -333,7 +333,7 @@ public void SystemType5_GetConstructor_Test() [TestMethod] public void SystemType6_GetElementType_Test() { - OutputHelper.WriteLine("This tests the GetElementType() method"); + // This tests the GetElementType() method //Assigned and manipulated to avoid compiler warning int testInt32 = -1; @@ -351,48 +351,48 @@ public void SystemType6_GetElementType_Test() [TestMethod] public void SystemType7_GetField_Test() { - OutputHelper.WriteLine("This tests the GetField(String) "); - OutputHelper.WriteLine("and the GetField(String,BindingFlags) methods)"); - OutputHelper.WriteLine("Currently this test fails, see 17246 for more details."); + // This tests the GetField(String) + // and the GetField(String,BindingFlags) methods) + // Currently this test fails, see 17246 for more details. Type myType1 = Type.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType1.FullName); Assert.IsTrue(myType1.GetField("m_data") == null); - OutputHelper.WriteLine(" TestObject2 type has one data member \"m_data\" of type Int32."); + // TestObject2 type has one data member \"m_data\" of type Int32. TestObject2 testTestObject2 = new TestObject2(5); Type myType2 = testTestObject2.GetType(); OutputHelper.WriteLine("The full name is " + myType2.FullName); - OutputHelper.WriteLine(" Check that type of m_data is Int32"); + // Check that type of m_data is Int32 Assert.IsType(myType2.GetField("m_data", BindingFlags.GetField | BindingFlags.Public | BindingFlags.Instance).FieldType, myType1); - OutputHelper.WriteLine(" Check that value in m_data is 5 ( becuase we called new TestObject2(5))"); + // Check that value in m_data is 5 ( becuase we called new TestObject2(5)) Assert.AreEqual((int)myType2.GetField("m_data", BindingFlags.IgnoreCase | BindingFlags.GetField | BindingFlags.Public | BindingFlags.Instance).GetValue(testTestObject2), 5); - OutputHelper.WriteLine(" Check that m_data is a field"); + // Check that m_data is a field Assert.IsTrue(myType2.GetField("m_data").MemberType == MemberTypes.Field); - OutputHelper.WriteLine(" Check that field m_data has Name \"m_data\""); + // Check that field m_data has Name \"m_data\" Assert.AreEqual(myType2.GetField("m_data").Name, "m_data"); - OutputHelper.WriteLine(" Check that misspelling of m_data return NULL."); + // Check that misspelling of m_data return NULL. Assert.IsTrue(null == myType2.GetField("data")); - OutputHelper.WriteLine(" Checks that case misspelling of m_data return NULL if flag BindingFlags.IgnoreCase not specified."); + // Checks that case misspelling of m_data return NULL if flag BindingFlags.IgnoreCase not specified. Assert.IsTrue(null == myType2.GetField("m_Data")); - OutputHelper.WriteLine("Check retrieval with BindingFlags.IgnoreCase. If flag BindingFlags.IgnoreCase is ised, then the case should be ignored. We should get the same type information."); + // Check retrieval with BindingFlags.IgnoreCase. If flag BindingFlags.IgnoreCase is ised, then the case should be ignored. We should get the same type information. FieldInfo fInfo_m_Data = myType2.GetField("m_Data", BindingFlags.IgnoreCase | BindingFlags.GetField | BindingFlags.Public | BindingFlags.Instance); FieldInfo fInfo_m_data = myType2.GetField("m_data"); Assert.IsNotNull(fInfo_m_Data); Assert.IsNotNull(fInfo_m_data); Assert.IsTrue(fInfo_m_Data.Name.Equals(fInfo_m_data.Name)); - OutputHelper.WriteLine(" Indirectly set m_data in testTestObject2 to 6 and then check it."); + // Indirectly set m_data in testTestObject2 to 6 and then check it. myType2.GetField("m_data").SetValue(testTestObject2, 6); Assert.AreEqual((int)myType2.GetField("m_data").GetValue(testTestObject2), 6); Assert.AreEqual(testTestObject2.m_data, 6); @@ -402,9 +402,9 @@ public void SystemType7_GetField_Test() public void SystemType8_GetFields_Test() { - OutputHelper.WriteLine("This tests the GetFields(String) method"); - OutputHelper.WriteLine("This test must be re-written once BindingFlags is working, "); - OutputHelper.WriteLine("see 17246 for more details."); + // This tests the GetFields(String) method + // This test must be re-written once BindingFlags is working, + // see 17246 for more details. Type myType1 = Type.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType1.FullName); @@ -423,9 +423,9 @@ public void SystemType8_GetFields_Test() [TestMethod] public void SystemType9_GetInterfaces_Test() { - OutputHelper.WriteLine("This tests the GetInterfaces() method"); - OutputHelper.WriteLine("This test must be re-written once BindingFlags is working, "); - OutputHelper.WriteLine("see 17246 for more details."); + // This tests the GetInterfaces() method + // This test must be re-written once BindingFlags is working, + // see 17246 for more details. Type myType1 = Type.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType1.FullName); @@ -441,9 +441,9 @@ public void SystemType9_GetInterfaces_Test() [TestMethod] public void SystemType10_GetMethod_Test() { - OutputHelper.WriteLine("This tests the GetMethod(String) method"); - OutputHelper.WriteLine("This test must be re-written once BindingFlags is working, "); - OutputHelper.WriteLine("see 17246 for more details."); + // This tests the GetMethod(String) method + // This test must be re-written once BindingFlags is working, + // see 17246 for more details. int I = 0; I++; @@ -466,9 +466,9 @@ public void SystemType10_GetMethod_Test() [TestMethod] public void SystemType11_GetMethods_Test() { - OutputHelper.WriteLine("This tests the GetMethods() method"); - OutputHelper.WriteLine("This test must be re-written once BindingFlags is working, "); - OutputHelper.WriteLine("see 17246 for more details."); + // This tests the GetMethods() method + // This test must be re-written once BindingFlags is working, + // see 17246 for more details. //Assigned and manipulated to avoid compiler warning int I = 0; @@ -482,12 +482,12 @@ public void SystemType11_GetMethods_Test() if (methodInfoArr1[0].Name == "Method2") { methodInfo1 = methodInfoArr1[0]; - OutputHelper.WriteLine("Method2 found in position 0"); + // Method2 found in position 0 } else if (methodInfoArr1[1].Name == "Method2") { methodInfo1 = methodInfoArr1[1]; - OutputHelper.WriteLine("Method2 found in position 1"); + // Method2 found in position 1 } Assert.AreEqual(methodInfo1.IsAbstract, false); Assert.AreEqual(methodInfo1.IsFinal, false); @@ -505,9 +505,9 @@ public void SystemType11_GetMethods_Test() //[TestMethod] //public void SystemType12_InvokeMember_Test() //{ - // OutputHelper.WriteLine("This tests the InvokeMember(String,BindingFlags) method"); - // OutputHelper.WriteLine("This test must be re-written once BindingFlags is working, "); - // OutputHelper.WriteLine("see 17246 for more details."); + // // This tests the InvokeMember(String,BindingFlags) method + // // This test must be re-written once BindingFlags is working, + // // see 17246 for more details. // //Assigned and manipulated to avoid compiler warning // Int32 I = 0; // I++; diff --git a/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs b/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs index 5816e3ab..0e9387b9 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs @@ -21,7 +21,7 @@ public class WeakRefClass public WeakRefClass() { } ~WeakRefClass() { - OutputHelper.WriteLine("Finalized."); + // Finalized. hasFinalized1 = true; } void MakeSomeGarbage() @@ -46,14 +46,14 @@ void MakeSomeGarbage() // // 4. Verify & Remove Strong reference // // 5. Allow for GC // // 6. If weak ref surivived verify its data - // OutputHelper.WriteLine("Create an object with strong ref"); + // // Create an object with strong ref // WeakRefClass WRC1 = new WeakRefClass(); - // OutputHelper.WriteLine("Create a short weak ref to the onject"); + // // Create a short weak ref to the onject // WeakReference wr = new WeakReference(WRC1); // wr.Target = WRC1; - // OutputHelper.WriteLine("Allow for GC"); + // // Allow for GC // nanoFramework.Runtime.Native.GC.Run(true); // int sleepTime = 2000; // int slept = 0; @@ -66,12 +66,12 @@ void MakeSomeGarbage() // Assert.IsFalse(hasFinalized1); - // OutputHelper.WriteLine("Verify & Remove Strong reference"); + // // Verify & Remove Strong reference // Assert.AreEqual(((WeakRefClass)wr.Target).data, 5); // WRC1 = null; // Assert.IsNull(WRC1); - // OutputHelper.WriteLine("Allow for GC"); + // // Allow for GC // // We should force the finalizer somehow // nanoFramework.Runtime.Native.GC.Run(true); // GC.WaitForPendingFinalizers(); @@ -89,11 +89,11 @@ void MakeSomeGarbage() // if (wr.IsAlive) // { // Assert.AreEqual(((WeakRefClass)wr.Target).data, 5); - // OutputHelper.WriteLine("Weak Reference survived."); + // // Weak Reference survived. // } // else // { - // OutputHelper.WriteLine("Weak Reference has been collected"); + // // Weak Reference has been collected // } //} } diff --git a/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs b/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs index b34e084f..0d56c314 100644 --- a/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs +++ b/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs @@ -25,24 +25,24 @@ class Waiter public void DoWait() { - OutputHelper.WriteLine("Waiting..."); + // Waiting... t1 = DateTime.UtcNow; are1.WaitOne(); t2 = DateTime.UtcNow; flag = true; - OutputHelper.WriteLine("Notified"); + // Notified } public void DoWaitTimeOut() { - OutputHelper.WriteLine("Waiting..."); + // Waiting... are1.WaitOne(wait, false); flag = true; } public void DoWaitReset() { - OutputHelper.WriteLine("Waiting..."); + // Waiting... are2.WaitOne(); flag = true; } @@ -57,23 +57,23 @@ public void AutoReset1_WaitOne_Set_Test() /// /// - OutputHelper.WriteLine("Starts a thread and calls WaitOne inside the thread "); - OutputHelper.WriteLine("Signals The thread to continue execution"); - OutputHelper.WriteLine("Verifies the thread has waited and continued execution upon calling Set"); + // Starts a thread and calls WaitOne inside the thread + // Signals The thread to continue execution + // Verifies the thread has waited and continued execution upon calling Set - OutputHelper.WriteLine("Starting Thread"); + // Starting Thread Waiter newWaiter1 = new Waiter(); Thread newThread1 = new Thread(newWaiter1.DoWait); newThread1.Start(); - OutputHelper.WriteLine("Waiting and Signaling after 1000msec."); + // Waiting and Signaling after 1000msec. Thread.Sleep(1000); - OutputHelper.WriteLine("wake it up"); + // wake it up DateTime t3 = DateTime.UtcNow; Waiter.are1.Set(); - OutputHelper.WriteLine("Waiting the thread to finish and also to get t2"); + // Waiting the thread to finish and also to get t2 Thread.Sleep(10); TimeSpan duration1 = newWaiter1.t2 - newWaiter1.t1; TimeSpan duration2 = newWaiter1.t2 - t3; @@ -81,12 +81,12 @@ public void AutoReset1_WaitOne_Set_Test() // Assuming atleast the thread should wait for 750ms if (duration1.CompareTo(new TimeSpan(0, 0, 0, 0, 750)) <= 0) { - OutputHelper.WriteLine("The thread should have waited atleast 750 msec."); + // The thread should have waited atleast 750 msec. throw new Exception("The thread should have waited atleast 750 msec."); } if (duration2.CompareTo(new TimeSpan(0, 0, 0, 0, 0)) < 0) { - OutputHelper.WriteLine("The thread continued executing before it's signaled"); + // The thread continued executing before it's signaled throw new Exception("The thread continued executing before it's signaled"); } } @@ -102,10 +102,10 @@ public void AutoReset2_Set_WaitOne_Set_Test() /// /// - OutputHelper.WriteLine("Calls Set repeatedly while no thread was blocked"); - OutputHelper.WriteLine("Starts two threads and calls WaitOne on both threads "); - OutputHelper.WriteLine("Signals The thread to continue execution calling Set once"); - OutputHelper.WriteLine("Verifies only one blocked thread is released"); + // Calls Set repeatedly while no thread was blocked + // Starts two threads and calls WaitOne on both threads + // Signals The thread to continue execution calling Set once + // Verifies only one blocked thread is released Waiter.are1.Set(); Waiter.are1.Set(); @@ -116,16 +116,16 @@ public void AutoReset2_Set_WaitOne_Set_Test() Waiter newWaiter2 = new Waiter(); newWaiter2.flag = false; Thread newThread2 = new Thread(newWaiter2.DoWait); - OutputHelper.WriteLine("Starting The threads"); + // Starting The threads newThread1.Start(); newThread2.Start(); - OutputHelper.WriteLine("Waiting and verifying only one of the threads is signaled"); + // Waiting and verifying only one of the threads is signaled Thread.Sleep(1000); - OutputHelper.WriteLine("flag1 XOR flag2 = ~((flag1 & flag2)||(~flag1 & ~flag2))"); + // flag1 XOR flag2 = ~((flag1 & flag2)||(~flag1 & ~flag2)) if ((newWaiter1.flag && newWaiter2.flag) || ((!newWaiter1.flag) && (!newWaiter2.flag))) { - OutputHelper.WriteLine("Only One of the threads should have been signaled"); + // Only One of the threads should have been signaled throw new Exception("Only One of the threads should have been signaled"); } Waiter.are1.Set(); @@ -141,9 +141,9 @@ public void AutoReset3_TwoWaitOne_TwoSet_Test() /// /// - OutputHelper.WriteLine("Starts two threads and calls WaitOne on both threads "); - OutputHelper.WriteLine("Signals The threads to continue execution calling Set twice"); - OutputHelper.WriteLine("Verifies both blocked threads are released"); + // Starts two threads and calls WaitOne on both threads + // Signals The threads to continue execution calling Set twice + // Verifies both blocked threads are released Waiter newWaiter1 = new Waiter(); Thread newThread1 = new Thread(newWaiter1.DoWait); @@ -151,7 +151,7 @@ public void AutoReset3_TwoWaitOne_TwoSet_Test() Waiter newWaiter2 = new Waiter(); Thread newThread2 = new Thread(newWaiter2.DoWait); newWaiter2.flag = false; - OutputHelper.WriteLine("Starting threads, waiting and verifying both are waiting"); + // Starting threads, waiting and verifying both are waiting newThread1.Start(); newThread2.Start(); Thread.Sleep(1000); @@ -162,7 +162,7 @@ public void AutoReset3_TwoWaitOne_TwoSet_Test() throw new Exception("Failure: One or both threads are not waiting, Thread1 = '" + newWaiter1.flag + "' Thread2 = '" + newWaiter2.flag + "'"); } - OutputHelper.WriteLine("Signaling twice, waiting and verifying both threads are signaled"); + // Signaling twice, waiting and verifying both threads are signaled Waiter.are1.Set(); Waiter.are1.Set(); Thread.Sleep(1000); @@ -184,36 +184,36 @@ public void AutoReset4_WaitOne_TimeOut_Test() /// /// - OutputHelper.WriteLine("Starts a thread and call WatiOne passing timeout parameter"); - OutputHelper.WriteLine("verifies the wait will end because of timeout"); - OutputHelper.WriteLine("Starts a 2nd thread and call WatiOne passing Timeout.Infinite"); - OutputHelper.WriteLine("verifies the wait will not end for 3 sec (assumed Infinite)"); + // Starts a thread and call WatiOne passing timeout parameter + // verifies the wait will end because of timeout + // Starts a 2nd thread and call WatiOne passing Timeout.Infinite + // verifies the wait will not end for 3 sec (assumed Infinite) Waiter newWaiter1 = new Waiter(); newWaiter1.wait = 100; newWaiter1.flag = false; Thread newThread1 = new Thread(newWaiter1.DoWaitTimeOut); - OutputHelper.WriteLine("Starting thread, waiting and verifying wait timeouts"); + // Starting thread, waiting and verifying wait timeouts newThread1.Start(); Thread.Sleep(500); if (!newWaiter1.flag) { - OutputHelper.WriteLine("Waited for 500msec. but Thread should have timeouted in " + newWaiter1.wait + ""); + // Waited for 500msec. but Thread should have timeouted in " + newWaiter1.wait + " throw new Exception("Waited for 500msec. but Thread should have timeouted in " + newWaiter1.wait + ""); } Waiter newWaiter2 = new Waiter(); newWaiter2.wait = -1; newWaiter2.flag = false; Thread newThread2 = new Thread(newWaiter2.DoWaitTimeOut); - OutputHelper.WriteLine("Starting thread, waiting for Timeout.Infinite and verifying"); + // Starting thread, waiting for Timeout.Infinite and verifying newThread2.Start(); Thread.Sleep(3000); if (newWaiter2.flag) { - OutputHelper.WriteLine("Failure: thread didn't wait for Infinite.Timeout"); + // Failure: thread didn't wait for Infinite.Timeout throw new Exception("Failure: thread didn't wait for Infinite.Timeout"); } - OutputHelper.WriteLine("finally signaling the Infinite.Timeout thread"); + // finally signaling the Infinite.Timeout thread Waiter.are1.Set(); } @@ -230,45 +230,45 @@ public void AutoReset5_Reset_Test() /// /// - OutputHelper.WriteLine("Creates an AutoResetEvent having an initial state signaled"); - OutputHelper.WriteLine("Start a thread, call WaitOne and verify the thread is not blocked"); - OutputHelper.WriteLine("Starts a 2nd thread, call WaitOne and verify it's auto reset (thread is blocked)"); - OutputHelper.WriteLine("call Set and verify it's set (signaled)"); - OutputHelper.WriteLine("call Set, call Reset, starts a thread and call WaitOne on the thread"); - OutputHelper.WriteLine("Verify the thread remains blocked"); + // Creates an AutoResetEvent having an initial state signaled + // Start a thread, call WaitOne and verify the thread is not blocked + // Starts a 2nd thread, call WaitOne and verify it's auto reset (thread is blocked) + // call Set and verify it's set (signaled) + // call Set, call Reset, starts a thread and call WaitOne on the thread + // Verify the thread remains blocked Waiter newWaiter1 = new Waiter(); newWaiter1.flag = false; Thread newThread1 = new Thread(newWaiter1.DoWaitReset); - OutputHelper.WriteLine("Starting thread, waiting and verifying thread not blocked if initial state is signaled"); + // Starting thread, waiting and verifying thread not blocked if initial state is signaled newThread1.Start(); Thread.Sleep(100); if (!newWaiter1.flag) { - OutputHelper.WriteLine("Faiure : AutoResetEvent initial state signaled but blocked thread"); + // Faiure : AutoResetEvent initial state signaled but blocked thread throw new Exception("Faiure : AutoResetEvent initial state signaled but blocked thread"); } Waiter newWaiter2 = new Waiter(); newWaiter2.flag = false; Thread newThread2 = new Thread(newWaiter2.DoWaitReset); - OutputHelper.WriteLine("Starting thread, waiting and verifying autoreset blocks the thread"); + // Starting thread, waiting and verifying autoreset blocks the thread newThread2.Start(); Thread.Sleep(100); if (newWaiter2.flag) { - OutputHelper.WriteLine("Failure : AutoResetEvent not autoreseted"); + // Failure : AutoResetEvent not autoreseted throw new Exception("Failure : AutoResetEvent not autoreseted"); } - OutputHelper.WriteLine("Signaling, waiting and verifying"); + // Signaling, waiting and verifying Waiter.are2.Set(); Thread.Sleep(100); if (!newWaiter2.flag) { - OutputHelper.WriteLine("Failure : AutoResetEvent signaled but thread blocked"); + // Failure : AutoResetEvent signaled but thread blocked throw new Exception("Failure : AutoResetEvent signaled but thread blocked"); } - OutputHelper.WriteLine("Set, Reset, Start a thread, waiting and verifying thread remain blocked"); + // Set, Reset, Start a thread, waiting and verifying thread remain blocked Waiter newWaiter3 = new Waiter(); newWaiter3.flag = false; Thread newThread3 = new Thread(newWaiter3.DoWaitReset); @@ -278,11 +278,11 @@ public void AutoReset5_Reset_Test() Thread.Sleep(100); if (newWaiter3.flag) { - OutputHelper.WriteLine("Failure: a Reseted AutoResetEvent didn't block thread"); + // Failure: a Reseted AutoResetEvent didn't block thread throw new Exception("Failure: a Reseted AutoResetEvent didn't block thread"); } - OutputHelper.WriteLine("Finally Setting the reseted AutoResetEvent"); + // Finally Setting the reseted AutoResetEvent Waiter.are2.Set(); } diff --git a/Tests/NFUnitTestThread/UnitTestInterlocTests.cs b/Tests/NFUnitTestThread/UnitTestInterlocTests.cs index a900eaca..61328d68 100644 --- a/Tests/NFUnitTestThread/UnitTestInterlocTests.cs +++ b/Tests/NFUnitTestThread/UnitTestInterlocTests.cs @@ -88,12 +88,12 @@ public void Interlocked1_Inc_Dec_Test() /// 3. Waits for execution and then verifies that all expected operations completed /// /// - OutputHelper.WriteLine("Starts several async threads that call interlocked "); - OutputHelper.WriteLine("Increment and Decrement, this may erroneously pass."); - OutputHelper.WriteLine("This may erroneously fail for extremely slow devices."); + // Starts several async threads that call interlocked + // Increment and Decrement, this may erroneously pass. + // This may erroneously fail for extremely slow devices. - OutputHelper.WriteLine("Starting several threads, incrementing, decrementing,"); - OutputHelper.WriteLine("waiting till all threads finish and verifying"); + // Starting several threads, incrementing, decrementing, + // waiting till all threads finish and verifying Thread incThread = new Thread(ThreadIncrementorStarter); incThread.Start(); Thread.Sleep(1); @@ -110,7 +110,7 @@ public void Interlocked1_Inc_Dec_Test() lastThread.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Waiting for execution"); + // Waiting for execution int slept = 0; while ((incThread.IsAlive || decThread.IsAlive || inc2Thread.IsAlive || lastThread.IsAlive) && slept < 5000) @@ -119,16 +119,16 @@ public void Interlocked1_Inc_Dec_Test() slept += 100; } - OutputHelper.WriteLine("Verifying all increment/decrement operations done correctly"); + // Verifying all increment/decrement operations done correctly if (interCount != 4) { - OutputHelper.WriteLine("expected final increment/decrement result = '4' but got '" + interCount + "'"); + // expected final increment/decrement result = '4' but got '" + interCount + "' throw new Exception("expected final increment/decrement result = '4' but got '" + interCount + "'"); } - OutputHelper.WriteLine("Verifying all threads are finished"); + // Verifying all threads are finished if (slept >= 5000) { - OutputHelper.WriteLine("Expcted all threads be done in '5000' msec but took '" + slept + "'"); + // Expcted all threads be done in '5000' msec but took '" + slept + "' throw new Exception("Expcted all threads be done in '5000' msec but took '" + slept + "'"); } } @@ -143,11 +143,11 @@ public void Interlocked2_Compare_Exchange_Test() /// /// - OutputHelper.WriteLine("Starts 4 async threads that call interlocked Compare, CompareExchange"); - OutputHelper.WriteLine("This may erroneously pass."); - OutputHelper.WriteLine("this may erroneously fail for extremely slow devices."); + // Starts 4 async threads that call interlocked Compare, CompareExchange + // This may erroneously pass. + // this may erroneously fail for extremely slow devices. - OutputHelper.WriteLine("Starting the 4 threads"); + // Starting the 4 threads Thread incThread = new Thread(ThreadIncrementorStarter); incThread.Start(); @@ -161,7 +161,7 @@ public void Interlocked2_Compare_Exchange_Test() lastThread.Start(); Thread.Sleep(1); int comp = 10; - OutputHelper.WriteLine("Waiting for execution"); + // Waiting for execution while ((0 != Interlocked.CompareExchange(ref interCount, 0, comp)) || (incThread.IsAlive || decThread.IsAlive || inc2Thread.IsAlive || lastThread.IsAlive)) @@ -172,7 +172,7 @@ public void Interlocked2_Compare_Exchange_Test() decThread.IsAlive.ToString() + " " + inc2Thread.IsAlive.ToString() + " " + lastThread.IsAlive.ToString()); - OutputHelper.WriteLine("Setting Count to 0"); + // Setting Count to 0 Interlocked.Exchange(ref interCount, 0); Thread.Sleep(10); } @@ -183,16 +183,16 @@ public void Interlocked2_Compare_Exchange_Test() Thread.Sleep(100); slept += 100; } - OutputHelper.WriteLine("Verifying all Interlocked.Compare/CompareExchange operations done correctly"); + // Verifying all Interlocked.Compare/CompareExchange operations done correctly if (interCount != 0) { - OutputHelper.WriteLine("expected final Compare/CompareExchange result = '0' but got '" + interCount + "'"); + // expected final Compare/CompareExchange result = '0' but got '" + interCount + "' throw new Exception("expected final Compare/CompareExchange result = '0' but got '" + interCount + "'"); } - OutputHelper.WriteLine("Verifying all threads are finished"); + // Verifying all threads are finished if (slept >= 5000) { - OutputHelper.WriteLine("Expcted all threads be done in '5000' msec but took '" + slept + "'"); + // Expcted all threads be done in '5000' msec but took '" + slept + "' throw new Exception("Expcted all threads be done in '5000' msec but took '" + slept + "'"); } } @@ -209,8 +209,8 @@ public void Interlocked3_Exchange_Boundary_Test() int[] value = new int[] { -2147483648, 0, 2147483647 }; int temp1, temp2; - OutputHelper.WriteLine("Verification of original value returned needs temp1 = temp2"); - OutputHelper.WriteLine("Verifies Exchange "); + // Verification of original value returned needs temp1 = temp2 + // Verifies Exchange for (int i = 0; i < 3; i++) { @@ -226,7 +226,7 @@ public void Interlocked3_Exchange_Boundary_Test() } if (value[i] != value[j]) { - OutputHelper.WriteLine("Failure : "); + // Failure : OutputHelper.WriteLine(value[j] + " is not stored at location1"); break; } @@ -248,8 +248,8 @@ public void Interlocked4_CompareExchange_Boundary_Test() int[] value = new int[] { -2147483648, 0, 2147483647 }; int temp1, temp2; - OutputHelper.WriteLine("Verifies the original value is returned at all time"); - OutputHelper.WriteLine("Verifies value is stored in location1 upon equality"); + // Verifies the original value is returned at all time + // Verifies value is stored in location1 upon equality for (int r = 0; r < 3; r++) { for (int p = 0; p < 3; p++) diff --git a/Tests/NFUnitTestThread/UnitTestMonitorTests.cs b/Tests/NFUnitTestThread/UnitTestMonitorTests.cs index 07975f80..1e1c292c 100644 --- a/Tests/NFUnitTestThread/UnitTestMonitorTests.cs +++ b/Tests/NFUnitTestThread/UnitTestMonitorTests.cs @@ -89,10 +89,10 @@ public void Monitor1_Basic_Test() /// /// - OutputHelper.WriteLine("Starts several async threads that Enter and Exit critical sections."); - OutputHelper.WriteLine("This may erroneously pass."); - OutputHelper.WriteLine("This may erroneously fail for extremely slow devices."); - OutputHelper.WriteLine("Starting the 4 threads"); + // Starts several async threads that Enter and Exit critical sections. + // This may erroneously pass. + // This may erroneously fail for extremely slow devices. + // Starting the 4 threads Thread incThread = new Thread(MonitoredThreadIncrementorStarter); incThread.Start(); Thread decThread = new Thread(MonitoredThreadDecrementorStarter); @@ -102,15 +102,15 @@ public void Monitor1_Basic_Test() Thread lastThread = new Thread(MonitoredThreadDecrementor); lastThread.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Joining All threads to main thread"); + // Joining All threads to main thread incThread.Join(); decThread.Join(); inc2Thread.Join(); lastThread.Join(); - OutputHelper.WriteLine("Verifying all operations completed successfully"); + // Verifying all operations completed successfully if (monCount != 4) { - OutputHelper.WriteLine("expected final result = '4' but got '" + monCount + "'"); + // expected final result = '4' but got '" + monCount + "' throw new Exception("expected final result = '4' but got '" + monCount + "'"); } } @@ -125,8 +125,8 @@ public void Monitor2_SynchronizationLockException_Test() /// 2. Verify SynchronizationLockException exception is thrown /// /// - OutputHelper.WriteLine("Verify SynchronizationLockException exception is thrown"); - OutputHelper.WriteLine("Calling Monitor.Exit without first calling Monitor.Enter should throw an exception"); + // Verify SynchronizationLockException exception is thrown + // Calling Monitor.Exit without first calling Monitor.Enter should throw an exception Assert.ThrowsException(typeof(Exception), () => { Monitor.Exit(locker1); }); } @@ -139,8 +139,8 @@ public void Monitor3_Enter_ArgumentNullException_Test() /// /// - OutputHelper.WriteLine("verify ArgumentNullException exception is thrown "); - OutputHelper.WriteLine("Calling Monitor.Enter passing null reference parameter should throw exception"); + // verify ArgumentNullException exception is thrown + // Calling Monitor.Enter passing null reference parameter should throw exception Assert.ThrowsException(typeof(ArgumentNullException), () => { Monitor.Enter(null); }); } @@ -153,8 +153,8 @@ public void Monitor4_Exit_ArgumentNullException_Test() /// 2. verify ArgumentNullException exception is thrown /// /// - OutputHelper.WriteLine("verify ArgumentNullException exception is thrown "); - OutputHelper.WriteLine("Calling Monitor.Exit passing 'null' reference parameter should throw exception"); + // verify ArgumentNullException exception is thrown + // Calling Monitor.Exit passing 'null' reference parameter should throw exception Assert.ThrowsException(typeof(ArgumentNullException), () => { Monitor.Exit(null); }); } @@ -168,16 +168,16 @@ static void RepeatedLock() try { lockResult = !lockResult; - OutputHelper.WriteLine("I have the lock"); + // I have the lock Nest(); - OutputHelper.WriteLine("I still have the lock"); + // I still have the lock } finally { if (flag.WaitOne(500, false)) { Monitor.Exit(locker2); - OutputHelper.WriteLine("Here the lock is released"); + // Here the lock is released } } OutputHelper.WriteLine("T4 = " + DateTime.UtcNow); @@ -189,12 +189,12 @@ static void Nest() Monitor.Enter(locker2); try { - OutputHelper.WriteLine("Inside Lock"); + // Inside Lock } finally { Monitor.Exit(locker2); - OutputHelper.WriteLine("Released the lock? Not quite!"); + // Released the lock? Not quite! } OutputHelper.WriteLine("T3 = " + DateTime.UtcNow); } @@ -202,26 +202,26 @@ static void Nest() [TestMethod] public void Monitor5_Repeatedly_Lock_Unlock_Test() { - OutputHelper.WriteLine("Starts two Threads "); - OutputHelper.WriteLine("Repeatedly locks an object by multiple calls to Monitor.Enter"); - OutputHelper.WriteLine("Verifies the object is unlocked only by a corresponding number of Monitor.Exit"); + // Starts two Threads + // Repeatedly locks an object by multiple calls to Monitor.Enter + // Verifies the object is unlocked only by a corresponding number of Monitor.Exit Thread newThread1 = new Thread(RepeatedLock); Thread newThread2 = new Thread(RepeatedLock); - OutputHelper.WriteLine("Starting two threads, repeatedly locking, waiting and verifying"); + // Starting two threads, repeatedly locking, waiting and verifying newThread1.Start(); newThread2.Start(); Thread.Sleep(100); if (!lockResult) { - OutputHelper.WriteLine("Failure : both threads passed lock"); + // Failure : both threads passed lock throw new Exception("Failure : both threads passed lock"); } - OutputHelper.WriteLine("unlocking the final lock and verifying the waiting thread continues"); + // unlocking the final lock and verifying the waiting thread continues flag.Set(); Thread.Sleep(500); if (lockResult) { - OutputHelper.WriteLine("Failure : lock not released by equal number of unlocks"); + // Failure : lock not released by equal number of unlocks throw new Exception("Failure : lock not released by equal number of unlocks"); } if (newThread1.IsAlive) diff --git a/Tests/NFUnitTestThread/UnitTestThreadTest.cs b/Tests/NFUnitTestThread/UnitTestThreadTest.cs index 03f979fe..5733c31b 100644 --- a/Tests/NFUnitTestThread/UnitTestThreadTest.cs +++ b/Tests/NFUnitTestThread/UnitTestThreadTest.cs @@ -19,7 +19,7 @@ class Work public static void DoWork() { Thread.Sleep(300); - OutputHelper.WriteLine("Static thread procedure DoWork."); + // Static thread procedure DoWork. Thread.Sleep(300); } public int m_data = 0; @@ -32,14 +32,14 @@ public void DoMoreWork() public static void DoWorkAbort() { Thread.Sleep(300); - OutputHelper.WriteLine("Static thread procedure DoWorkAbort."); + // Static thread procedure DoWorkAbort. Thread.Sleep(10000); } public Thread m_toJoin = null; public void DoWorkJoin() { m_toJoin.Join(); - OutputHelper.WriteLine("Instance thread procedure DoWorkJoin."); + // Instance thread procedure DoWorkJoin. } public static bool hasAborted = false; @@ -55,7 +55,7 @@ public static void DoWorkThreadAbortException() { hasAborted = true; OutputHelper.WriteLine("Thread State = " + Thread.CurrentThread.ThreadState); - OutputHelper.WriteLine("verifying ThreadAbortException named " + e.ToString() + " is thrown"); + // verifying ThreadAbortException named " + e.ToString() + " is thrown } } } @@ -76,24 +76,24 @@ public void Threading_Basic_Test1() /// 2. Verifies that they execute in a reasonable time /// /// - OutputHelper.WriteLine("Starting a thread without explicit declaration of ThreadStart Delegate"); - OutputHelper.WriteLine("Starts two threads, waits for them to complete and passes, "); - OutputHelper.WriteLine("this may erroneously fail for extremely slow devices."); - OutputHelper.WriteLine("All other threading tests are dependent on this, if this fails, "); - OutputHelper.WriteLine("all other results are invalid."); + // Starting a thread without explicit declaration of ThreadStart Delegate + // Starts two threads, waits for them to complete and passes, + // this may erroneously fail for extremely slow devices. + // All other threading tests are dependent on this, if this fails, + // all other results are invalid. - OutputHelper.WriteLine("Starting thread 1"); + // Starting thread 1 Thread newThread1 = new Thread(Work.DoWork); newThread1.Start(); - OutputHelper.WriteLine("Starting thread 2"); + // Starting thread 2 Work w = new Work(); w.m_data = 42; Thread newThread2 = new Thread(w.DoMoreWork); newThread2.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Waiting for them to finish"); + // Waiting for them to finish int slept = 0; while ((newThread1.ThreadState != ThreadState.Stopped || newThread2.ThreadState != ThreadState.Stopped) && slept < 1000) @@ -104,7 +104,7 @@ public void Threading_Basic_Test1() if (!(newThread1.ThreadState == ThreadState.Stopped && newThread2.ThreadState == ThreadState.Stopped)) { - OutputHelper.WriteLine("The threads took more than 1000msec to come to Stopped state"); + // The threads took more than 1000msec to come to Stopped state throw new Exception("The threads took more than 1000msec to come to Stopped state"); } } @@ -117,23 +117,23 @@ public void Threading_ThreadStart_Test2() /// 2. Verifies that they execute in a reasonable time /// /// - OutputHelper.WriteLine("Starts two threads with ThreadStart Delegate,"); - OutputHelper.WriteLine("waits for them to complete and passes, "); - OutputHelper.WriteLine("this may erroneously fail for extremely slow devices."); + // Starts two threads with ThreadStart Delegate, + // waits for them to complete and passes, + // this may erroneously fail for extremely slow devices. ThreadStart threadDelegate = new ThreadStart(Work.DoWork); Thread newThread1 = new Thread(threadDelegate); - OutputHelper.WriteLine("Starting thread 1"); + // Starting thread 1 newThread1.Start(); Work w = new Work(); w.m_data = 42; threadDelegate = new ThreadStart(w.DoMoreWork); Thread newThread2 = new Thread(threadDelegate); - OutputHelper.WriteLine("Starting thread 2"); + // Starting thread 2 newThread2.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Waiting for them to complete"); + // Waiting for them to complete int slept = 0; while ((newThread1.ThreadState != ThreadState.Stopped || newThread2.ThreadState != ThreadState.Stopped) && slept < 1000) @@ -144,7 +144,7 @@ public void Threading_ThreadStart_Test2() if (!(newThread1.ThreadState == ThreadState.Stopped && newThread2.ThreadState == ThreadState.Stopped)) { - OutputHelper.WriteLine("The threads took more than 1000msec to come to Stopped state"); + // The threads took more than 1000msec to come to Stopped state throw new Exception("The threads took more than 1000msec to come to Stopped state"); } } @@ -159,18 +159,18 @@ public void Threading_Abort_Test3() /// 4. Verifies that the short thread finishes normally /// /// - OutputHelper.WriteLine("Starting long thread"); + // Starting long thread Thread newThread1 = new Thread(Work.DoWorkAbort); newThread1.Start(); - OutputHelper.WriteLine("Starting short thread"); + // Starting short thread Work w = new Work(); w.m_data = 42; Thread newThread2 = new Thread(w.DoMoreWork); newThread2.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Aborting long thread and verifying it's Aborted"); + // Aborting long thread and verifying it's Aborted newThread1.Abort(); ThreadState tState = newThread1.ThreadState; if (tState != ThreadState.Aborted @@ -183,7 +183,7 @@ public void Threading_Abort_Test3() } int slept = 0; - OutputHelper.WriteLine("Waiting for 1 or both threads to finish"); + // Waiting for 1 or both threads to finish while ((newThread1.ThreadState != ThreadState.Stopped || newThread2.ThreadState != ThreadState.Stopped) && slept < 1000) { @@ -211,23 +211,23 @@ public void Threading_IsAlive_Test4() /// /// - OutputHelper.WriteLine("Starts two threads, aborts one and verifies the IsAlive property, "); - OutputHelper.WriteLine("this may erroneously fail for extremely slow devices."); - OutputHelper.WriteLine("Starting long thread and verifying it's alive"); + // Starts two threads, aborts one and verifies the IsAlive property, + // this may erroneously fail for extremely slow devices. + // Starting long thread and verifying it's alive Thread newThread1 = new Thread(Work.DoWorkAbort); newThread1.Start(); - OutputHelper.WriteLine("Starting short thread"); + // Starting short thread Work w = new Work(); w.m_data = 42; Thread newThread2 = new Thread(w.DoMoreWork); newThread2.Start(); if (!newThread1.IsAlive) { - OutputHelper.WriteLine("Long thread not alive"); + // Long thread not alive throw new Exception("Long thread not alive"); } - OutputHelper.WriteLine("Aborting long thread, waiting and verifying both threads are dead"); + // Aborting long thread, waiting and verifying both threads are dead newThread1.Abort(); int slept = 0; while ((newThread1.IsAlive || newThread2.IsAlive) && slept < 1000) @@ -255,9 +255,9 @@ public void Threading_Join_Test5() /// /// - OutputHelper.WriteLine("Starts two threads, the second thread Join()s the first"); - OutputHelper.WriteLine("Verifies they finish in a reasonable amount of time"); - OutputHelper.WriteLine("this may erroneously fail for extremely slow or fast devices."); + // Starts two threads, the second thread Join()s the first + // Verifies they finish in a reasonable amount of time + // this may erroneously fail for extremely slow or fast devices. Thread newThread1 = new Thread(Work.DoWork); newThread1.Start(); @@ -433,8 +433,8 @@ public void Threading_Priority_Test6() const double acceptedTolerance = 5.0; // 5% tolerance - OutputHelper.WriteLine("Starts five threads of increasing priority and a control thread, priority not set "); - OutputHelper.WriteLine("verifies that they get increasing amounts of attention"); + // Starts five threads of increasing priority and a control thread, priority not set + // verifies that they get increasing amounts of attention threadLowest.Priority = ThreadPriority.Lowest; threadBelow.Priority = ThreadPriority.BelowNormal; @@ -442,7 +442,7 @@ public void Threading_Priority_Test6() threadAbove.Priority = ThreadPriority.AboveNormal; threadHighest.Priority = ThreadPriority.Highest; - OutputHelper.WriteLine("Starting Threads"); + // Starting Threads threadHighest.Start(); threadAbove.Start(); threadNorm.Start(); @@ -450,7 +450,7 @@ public void Threading_Priority_Test6() threadLowest.Start(); threadControl.Start(); - OutputHelper.WriteLine("Allow counting for 1 seconds."); + // Allow counting for 1 seconds. Thread.Sleep(1000); PriorityTest.loopSwitch.Set(); Thread.Sleep(1000); @@ -462,9 +462,9 @@ public void Threading_Priority_Test6() OutputHelper.WriteLine("Highest " + PriorityTest.resultHighest); OutputHelper.WriteLine("Control Thread " + PriorityTest.resultControl); - OutputHelper.WriteLine("Verifies that each thread recieves attention less than or equal"); - OutputHelper.WriteLine("to higher priority threads."); - OutputHelper.WriteLine("Accepted tolerance : " + acceptedTolerance + "%"); + // Verifies that each thread recieves attention less than or equal + // to higher priority threads. + // Accepted tolerance : " + acceptedTolerance + "% PriorityTest.startSecond.Set(); PriorityTest.keepAlive.Set(); @@ -497,8 +497,8 @@ public void Threading_Suspend_Resume_Test7() /// 5. Verifies that they finish in a reasonable amount of time /// /// - OutputHelper.WriteLine("Starts two threads, suspends and resumes them, "); - OutputHelper.WriteLine("this may erroneously fail for extremely slow devices."); + // Starts two threads, suspends and resumes them, + // this may erroneously fail for extremely slow devices. Thread newThread1 = new Thread(Work.DoWork); newThread1.Start(); @@ -575,7 +575,7 @@ public void Threading_SleepApprox_Test8() /// 2. Verifies the thread sleeps at least for the time requested /// /// - OutputHelper.WriteLine("This test verifies the thread slept at least for the amount of time required"); + // This test verifies the thread slept at least for the amount of time required int[] sleepTime = new int[] { 10, 100, 1000, 10000, 60000 }; for (int i = 0; i < sleepTime.Length; i++) { @@ -597,10 +597,10 @@ public void Threading_Suspend_Suspend_Test9() /// /// - OutputHelper.WriteLine("Starts two threads and suspends the first thread twice"); - OutputHelper.WriteLine("Gets the state of the 1st thread"); - OutputHelper.WriteLine("Resumes the 1st thread "); - OutputHelper.WriteLine("Verifies that calling Suspend for the 2nd time has no effect"); + // Starts two threads and suspends the first thread twice + // Gets the state of the 1st thread + // Resumes the 1st thread + // Verifies that calling Suspend for the 2nd time has no effect Work.run = true; Work w1 = new Work(); Thread newThread1 = new Thread(w1.DoWorkThreadState); @@ -637,7 +637,7 @@ public void Threading_ThreadState_Unstarted_Running_WaitSleepJoin_Test10() /// /// - OutputHelper.WriteLine("Creating a thread and verifing its state is Unstarted"); + // Creating a thread and verifing its state is Unstarted Thread newThread1 = new Thread(Work.DoWork); ThreadState tState = newThread1.ThreadState; if (tState != ThreadState.Unstarted) @@ -648,7 +648,7 @@ public void Threading_ThreadState_Unstarted_Running_WaitSleepJoin_Test10() ") but got '" + tState + "'"); } - OutputHelper.WriteLine("Verifying the state of the current thread is Running"); + // Verifying the state of the current thread is Running newThread1.Start(); tState = Thread.CurrentThread.ThreadState; if (tState != ThreadState.Running) @@ -659,7 +659,7 @@ public void Threading_ThreadState_Unstarted_Running_WaitSleepJoin_Test10() ") but got '" + tState + "'"); } - OutputHelper.WriteLine("Sleeping a thread and verifing its state is WaitSleepJoin"); + // Sleeping a thread and verifing its state is WaitSleepJoin Thread.Sleep(100); tState = newThread1.ThreadState; if (tState != ThreadState.WaitSleepJoin) @@ -669,7 +669,7 @@ public void Threading_ThreadState_Unstarted_Running_WaitSleepJoin_Test10() throw new Exception("expected thread1 in WaitSleepJoin(" + ThreadState.WaitSleepJoin + ") but got '" + newThread1.ThreadState + "'"); } - OutputHelper.WriteLine(" Joining a thread and verifing its state is WaitSleepJoin"); + // Joining a thread and verifing its state is WaitSleepJoin Work w = new Work(); Thread newThread3 = new Thread(Work.DoWork); w.m_toJoin = newThread3; @@ -698,10 +698,10 @@ public void Threading_ThreadState_Suspend_Test11() /// /// - OutputHelper.WriteLine("Starts a thread and Suspends it immediately"); - OutputHelper.WriteLine("Starts a second thread"); - OutputHelper.WriteLine("Gets the state of the 1st thread and Resumes it"); - OutputHelper.WriteLine("Verifies that the state of the 1st thread was Suspended"); + // Starts a thread and Suspends it immediately + // Starts a second thread + // Gets the state of the 1st thread and Resumes it + // Verifies that the state of the 1st thread was Suspended Work.run = true; Work w1 = new Work(); Thread newThread1 = new Thread(w1.DoWorkThreadState); @@ -718,7 +718,7 @@ public void Threading_ThreadState_Suspend_Test11() newThread1.Abort(); if (tState != ThreadState.Suspended) { - OutputHelper.WriteLine("expected state Suspended(" + ThreadState.Suspended + ") but got '" + tState + "'"); + // expected state Suspended(" + ThreadState.Suspended + ") but got '" + tState + "' throw new Exception("expected state Suspended(" + ThreadState.Suspended + ") but got '" + tState + "'"); } } @@ -733,7 +733,7 @@ public void Threading_ThreadState_SuspendRequested_Test12() /// /// - OutputHelper.WriteLine("Starting 10 Threads"); + // Starting 10 Threads Thread[] newThread = new Thread[10]; Work[] w = new Work[10]; int i = 0, k = 0; @@ -745,8 +745,8 @@ public void Threading_ThreadState_SuspendRequested_Test12() newThread[i].Start(); i++; } - OutputHelper.WriteLine("Suspending the Threads and checking for SuspendRequested"); - OutputHelper.WriteLine("At least one of the threads should be in SuspendRequested"); + // Suspending the Threads and checking for SuspendRequested + // At least one of the threads should be in SuspendRequested while (k < 10) { while (newThread[k].ThreadState != ThreadState.Suspended) @@ -781,10 +781,10 @@ public void Threading_ThreadState_Abort_Stopped_Test13() /// /// - OutputHelper.WriteLine("Starts a thread and Aborts it immediately"); - OutputHelper.WriteLine("Starts a second thread"); - OutputHelper.WriteLine("Gets the state of the 1st thread"); - OutputHelper.WriteLine("Verifies the state of the 1st thread is Aborted"); + // Starts a thread and Aborts it immediately + // Starts a second thread + // Gets the state of the 1st thread + // Verifies the state of the 1st thread is Aborted DateTime t1, t2; TimeSpan period; @@ -797,13 +797,13 @@ public void Threading_ThreadState_Abort_Stopped_Test13() w.m_data = 42; Thread newThread2 = new Thread(w.DoMoreWork); newThread2.Start(); - OutputHelper.WriteLine("Pass Requires either of the next two compared values to be equal"); + // Pass Requires either of the next two compared values to be equal OutputHelper.WriteLine(newThread1.ThreadState + " Compare to " + ThreadState.Aborted); OutputHelper.WriteLine(newThread1.ThreadState + " Compare to " + ThreadState.Stopped); t2 = DateTime.UtcNow; ThreadState tState = newThread1.ThreadState; period = t2 - t1; - OutputHelper.WriteLine("Waited for at least " + period.Milliseconds.ToString() + " before checking the state"); + // Waited for at least " + period.Milliseconds.ToString() + " before checking the state if (tState != ThreadState.Aborted && tState != ThreadState.Stopped) { OutputHelper.WriteLine("expected the thread to be in Aborted/Stopped(" + ThreadState.Aborted + @@ -822,16 +822,16 @@ public void Threading_Abort_ThreadStateException_Test14() /// /// - OutputHelper.WriteLine("The type of exception thrown should be ThreadStateException"); + // The type of exception thrown should be ThreadStateException Thread newThread1 = new Thread(Work.DoWork); try { - OutputHelper.WriteLine("Aborting a thread not started should throw exception"); + // Aborting a thread not started should throw exception newThread1.Abort(); } catch (Exception e) { - OutputHelper.WriteLine("Correctly threw " + e.ToString() + " in an attempt to Abort Unstarted thread"); + // Correctly threw " + e.ToString() + " in an attempt to Abort Unstarted thread return; } @@ -849,15 +849,15 @@ public void Threading_Abort_ThreadAbortException_Test15() Work.hasAborted = false; Thread newThread1 = new Thread(Work.DoWorkThreadAbortException); - OutputHelper.WriteLine("starting a thread and Aborting it immediately"); + // starting a thread and Aborting it immediately newThread1.Start(); Thread.Sleep(50); newThread1.Abort(); Thread.Sleep(500); - OutputHelper.WriteLine("Verifying"); + // Verifying if (!Work.hasAborted) { - OutputHelper.WriteLine("Aborting a Thread didn't throw ThreadAbortException"); + // Aborting a Thread didn't throw ThreadAbortException throw new Exception("Aborting a Thread didn't throw ThreadAbortException"); } } @@ -872,9 +872,9 @@ public void Threading_Join_Timeout_Test16() /// /// - OutputHelper.WriteLine("Starts two threads"); - OutputHelper.WriteLine("Both threads Joins the main thread"); - OutputHelper.WriteLine("verify calling thread (main thread) is blocked for millisecondsTimeout"); + // Starts two threads + // Both threads Joins the main thread + // verify calling thread (main thread) is blocked for millisecondsTimeout Work.run = true; Work w = new Work(); @@ -927,8 +927,8 @@ public void Threading_Sleep_ArgumentOutOfRangeException_Test18() /// /// - OutputHelper.WriteLine("Verify ArgumentOutOfRangeException exception is thrown"); - OutputHelper.WriteLine("Why not for -1 ?"); + // Verify ArgumentOutOfRangeException exception is thrown + // Why not for -1 ? Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { Thread.Sleep(-2); }); } @@ -941,7 +941,7 @@ public void Threading_Join_ThreadStateException_Test19() /// /// - OutputHelper.WriteLine("The type of exception thrown should be ThreadStateException"); + // The type of exception thrown should be ThreadStateException Thread newThread1 = new Thread(Work.DoWork); Assert.ThrowsException(typeof(Exception), () => { newThread1.Join(); }); } @@ -955,7 +955,7 @@ public void Threading_Suspend_ThreadStateException_Test20() /// /// - OutputHelper.WriteLine("The type of exception thrown should be ThreadStateException"); + // The type of exception thrown should be ThreadStateException Thread newThread1 = new Thread(Work.DoWork); Assert.ThrowsException(typeof(Exception), () => { newThread1.Suspend(); }); } @@ -970,7 +970,7 @@ public void Threading_Resume_ThreadStateException_Test21() /// /// - OutputHelper.WriteLine("The type of exception thrown should be ThreadStateException"); + // The type of exception thrown should be ThreadStateException Thread newThread1 = new Thread(Work.DoWork); Assert.ThrowsException(typeof(Exception), () => { newThread1.Resume(); }); } @@ -993,8 +993,8 @@ public void Threading_Sleep_Zero_Test22() /// /// - OutputHelper.WriteLine("Starting a thread , Thread.Sleep(0) on the main thread"); - OutputHelper.WriteLine("Verify the thread is immediately scheduled to execute"); + // Starting a thread , Thread.Sleep(0) on the main thread + // Verify the thread is immediately scheduled to execute sleepZero = true; Thread t1 = new Thread(new ThreadStart(SleepTest)); t1.Start(); @@ -1003,12 +1003,12 @@ public void Threading_Sleep_Zero_Test22() Thread.Sleep(0); if (!sleepResult) { - OutputHelper.WriteLine("Test Thread.Sleep(0) Failed"); + // Test Thread.Sleep(0) Failed throw new Exception("Test Thread.Sleep(0) Failed"); } else { - OutputHelper.WriteLine("Test Thread.Sleep(0) Successful"); + // Test Thread.Sleep(0) Successful } sleepZero = false; } @@ -1025,9 +1025,9 @@ public void Threading_Priority_Change_Test23() /// const double acceptedTolerance = 5.0; // 5% tolerance - OutputHelper.WriteLine("Starts five threads of increasing priority and "); - OutputHelper.WriteLine("a control thread priority not set "); - OutputHelper.WriteLine("verifies that they get increasing amounts of attention"); + // Starts five threads of increasing priority and + // a control thread priority not set + // verifies that they get increasing amounts of attention PriorityTest.loopSwitch.Reset(); PriorityTest.startSecond.Reset(); @@ -1046,7 +1046,7 @@ public void Threading_Priority_Change_Test23() threadAbove.Priority = ThreadPriority.AboveNormal; threadHighest.Priority = ThreadPriority.Highest; - OutputHelper.WriteLine("Starting Threads"); + // Starting Threads threadHighest.Start(); threadAbove.Start(); threadNorm.Start(); @@ -1054,7 +1054,7 @@ public void Threading_Priority_Change_Test23() threadLowest.Start(); threadControl.Start(); - OutputHelper.WriteLine("Allow counting for 1 seconds."); + // Allow counting for 1 seconds. Thread.Sleep(1000); PriorityTest.loopSwitch.Set(); Thread.Sleep(1000); @@ -1071,8 +1071,8 @@ public void Threading_Priority_Change_Test23() threadNorm.Priority = ThreadPriority.AboveNormal; threadAbove.Priority = ThreadPriority.Highest; threadHighest.Priority = ThreadPriority.Lowest; - OutputHelper.WriteLine("Thread Priorities of each thread changed"); - OutputHelper.WriteLine("Allow counting for 1 seconds."); + // Thread Priorities of each thread changed + // Allow counting for 1 seconds. PriorityTest.startSecond.Set(); Thread.Sleep(1000); @@ -1086,9 +1086,9 @@ public void Threading_Priority_Change_Test23() OutputHelper.WriteLine("Highest - > Lowest " + PriorityTest.resultNewHighest); OutputHelper.WriteLine("Control Thread " + PriorityTest.resultNewControl); - OutputHelper.WriteLine("Verifies that each thread recieves attention less than or equal"); - OutputHelper.WriteLine("to higher priority threads based on the newly assigned priorities."); - OutputHelper.WriteLine("Accepted Tolerance : " + acceptedTolerance + "%"); + // Verifies that each thread recieves attention less than or equal + // to higher priority threads based on the newly assigned priorities. + // Accepted Tolerance : " + acceptedTolerance + "% if ((PriorityTest.resultNewHighest <= 0) || (Tolerance(2 * PriorityTest.resultNewHighest, PriorityTest.resultNewLowest) > acceptedTolerance) || @@ -1116,16 +1116,16 @@ public void Threading_CurrentThread_Test24() /// /// - OutputHelper.WriteLine("Starting the Thread"); + // Starting the Thread Work w = new Work(); w.m_data = 7; Thread newThread1 = new Thread(w.DoMoreWork); newThread1.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("verifying Thread.CurrentThread gives the Thread itself"); + // verifying Thread.CurrentThread gives the Thread itself if (!newThread1.Equals(w.currThread)) { - OutputHelper.WriteLine("Comparing the Thread with its own (Thread.Equals(Thread.CurrentThread)) failed"); + // Comparing the Thread with its own (Thread.Equals(Thread.CurrentThread)) failed throw new Exception("Comparing the Thread with its own (Thread.Equals(Thread.CurrentThread)) failed"); } } @@ -1139,13 +1139,13 @@ public void Threading_CurrentThread_Test24() // /// // /// - // OutputHelper.WriteLine("Getting the AppDomain"); + // // Getting the AppDomain // AppDomain domain = Thread.GetDomain(); - // OutputHelper.WriteLine("Verifying the domain"); + // // Verifying the domain // if (!domain.Equals(AppDomain.CurrentDomain)) // { - // OutputHelper.WriteLine("Thread.GetDomain().Equals(AppDomain.CurrentDomain) Failed"); + // // Thread.GetDomain().Equals(AppDomain.CurrentDomain) Failed // throw new Exception("Thread.GetDomain().Equals(AppDomain.CurrentDomain) Failed"); // } //} @@ -1159,34 +1159,34 @@ public void Threading_Thread_CurrentThread_Suspend_Test26() delegate { count += 2; - OutputHelper.WriteLine("2) Worker thread started..."); - OutputHelper.WriteLine("Suspending Worker thread..."); + // 2) Worker thread started... + // Suspending Worker thread... Thread.CurrentThread.Suspend(); - OutputHelper.WriteLine("4) Worker thread resumed..."); + // 4) Worker thread resumed... count += 5; } )); if (count != 0) { - OutputHelper.WriteLine("Failure verifying counter reset to zero before starting the thread"); + // Failure verifying counter reset to zero before starting the thread throw new Exception("Failure verifying counter reset to zero before starting the thread"); } - OutputHelper.WriteLine("1) Starting worker..."); + // 1) Starting worker... newThread.Start(); Thread.Sleep(3000); if (count != 2) { - OutputHelper.WriteLine("Failure : Worker Thread is not Suspended !"); + // Failure : Worker Thread is not Suspended ! throw new Exception("Failure : Worker Thread is not Suspended !"); } - OutputHelper.WriteLine("3) Wake up suspended thread..."); + // 3) Wake up suspended thread... newThread.Resume(); Thread.Sleep(3000); - OutputHelper.WriteLine("5) Main thread finished"); + // 5) Main thread finished if (count != 7) { - OutputHelper.WriteLine("Worker thread not finished for 3000msec after resumed"); + // Worker thread not finished for 3000msec after resumed throw new Exception("Worker thread not finished for 3000msec after resumed"); } } diff --git a/Tests/NFUnitTestThread/UnitTestTimeTests.cs b/Tests/NFUnitTestThread/UnitTestTimeTests.cs index 6e2c4c0a..60e57c1a 100644 --- a/Tests/NFUnitTestThread/UnitTestTimeTests.cs +++ b/Tests/NFUnitTestThread/UnitTestTimeTests.cs @@ -56,7 +56,7 @@ public void CheckStatus(Object stateInfo) if (m_invokeCount == m_maxCount) { - OutputHelper.WriteLine("Reset the counter and signal Main."); + // Reset the counter and signal Main. m_invokeCount = 0; autoEvent.Set(); m_result = true; @@ -76,12 +76,12 @@ public void Timer_TimerCallback_Test1() /// 6. Verifies that the TimerCallback has been called /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -91,7 +91,7 @@ public void Timer_TimerCallback_Test1() new Timer(timerDelegate, autoEvent, 1000, 250); statusChecker.m_result = false; - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); if (!statusChecker.m_result) { @@ -101,12 +101,12 @@ public void Timer_TimerCallback_Test1() "' times but got '" + statusChecker.m_invokeCount + "'"); } statusChecker.m_result = false; - OutputHelper.WriteLine("Changing period to 500msec"); + // Changing period to 500msec stateTimer.Change(0, 500); - OutputHelper.WriteLine("Waiting for 7500msec and verifying"); + // Waiting for 7500msec and verifying autoEvent.WaitOne(7500, false); stateTimer.Dispose(); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. if (!statusChecker.m_result) { OutputHelper.WriteLine("Failure : expected callback '" + statusChecker.m_maxCount + @@ -129,12 +129,12 @@ public void Timer_TimerCallback_ZeroTest2() /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -144,7 +144,7 @@ public void Timer_TimerCallback_ZeroTest2() new Timer(timerDelegate, autoEvent, 1000, 250); statusChecker.m_result = false; - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); if (!statusChecker.m_result) { @@ -155,7 +155,7 @@ public void Timer_TimerCallback_ZeroTest2() } statusChecker.m_result = false; statusChecker.z_flag = true; - OutputHelper.WriteLine("Changing duetime to zero and Verifying the timer started Immediately."); + // Changing duetime to zero and Verifying the timer started Immediately. DateTime t1 = DateTime.UtcNow; stateTimer.Change(0, 500); Thread.Sleep(1); @@ -163,12 +163,12 @@ public void Timer_TimerCallback_ZeroTest2() OutputHelper.WriteLine("callback method called within " + time.ToString()); if (time.CompareTo(new TimeSpan(0, 0, 0, 0, 100)) > 0) { - OutputHelper.WriteLine("The timer didn't start immediately, started after '" + time.ToString() + "'"); + // The timer didn't start immediately, started after '" + time.ToString() + "' throw new Exception("The timer didn't start immediately, started after '" + time.ToString() + "'"); } - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(7500, false); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); if (!statusChecker.m_result) { @@ -196,12 +196,12 @@ public void Timer_Disable_Periodic_Signaling_Test3() /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -210,7 +210,7 @@ public void Timer_Disable_Periodic_Signaling_Test3() Timer stateTimer = new Timer(timerDelegate, autoEvent, 1000, 250); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); if (!statusChecker.m_result) { @@ -222,34 +222,34 @@ public void Timer_Disable_Periodic_Signaling_Test3() statusChecker.m_result = false; statusChecker.c_flag = true; - OutputHelper.WriteLine("Changing period to zero (0) "); + // Changing period to zero (0) stateTimer.Change(0, 0); - OutputHelper.WriteLine("Waiting and verifying the callback method is invoked once"); + // Waiting and verifying the callback method is invoked once autoEvent.WaitOne(5000, false); if (statusChecker.counter != 1) { - OutputHelper.WriteLine("Failure : expected callback '1' times but got '" + statusChecker.counter + "'"); + // Failure : expected callback '1' times but got '" + statusChecker.counter + "' throw new Exception("Failure : expected callback '1' times but got '" + statusChecker.counter + "'"); } - OutputHelper.WriteLine("Reseting counter to zero"); + // Reseting counter to zero statusChecker.counter = 0; - OutputHelper.WriteLine("Changing period to Timeout.Infinite"); + // Changing period to Timeout.Infinite stateTimer.Change(0, Timeout.Infinite); - OutputHelper.WriteLine("Waiting and verifying the callback method is invoked once"); + // Waiting and verifying the callback method is invoked once autoEvent.WaitOne(5000, false); if (statusChecker.counter != 1) { - OutputHelper.WriteLine("Failure : expected callback '1' times but got '" + statusChecker.counter + "'"); + // Failure : expected callback '1' times but got '" + statusChecker.counter + "' throw new Exception("Failure : expected callback '1' times but got '" + statusChecker.counter + "'"); } - OutputHelper.WriteLine("Changing period to quarter sec "); + // Changing period to quarter sec stateTimer.Change(0, 250); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); if (!statusChecker.m_result) { @@ -270,11 +270,11 @@ public void Timer_TimerCallback_Duetime_Infinite_Test4() /// /// - OutputHelper.WriteLine("Tests the TimerCallback is never invoked if it's duetime is infinite "); + // Tests the TimerCallback is never invoked if it's duetime is infinite AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); statusChecker.c_flag = true; - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -283,9 +283,9 @@ public void Timer_TimerCallback_Duetime_Infinite_Test4() Timer stateTimer = new Timer(timerDelegate, autoEvent, Timeout.Infinite, 250); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); if (statusChecker.counter != 0) { @@ -307,12 +307,12 @@ public void Timer_Dispose_Test5() /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); statusChecker.c_flag = true; - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -320,9 +320,9 @@ public void Timer_Dispose_Test5() DateTime.UtcNow.ToString()); Timer stateTimer = new Timer(timerDelegate, autoEvent, 1000, 250); - OutputHelper.WriteLine("Immediately Destroying timer"); + // Immediately Destroying timer stateTimer.Dispose(); - OutputHelper.WriteLine("Waiting and verifying for Timer disposed"); + // Waiting and verifying for Timer disposed autoEvent.WaitOne(5000, false); if (statusChecker.counter != 0) { @@ -346,12 +346,12 @@ public void Timer_Negative_Period_Test6() /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -361,18 +361,18 @@ public void Timer_Negative_Period_Test6() new Timer(timerDelegate, autoEvent, 1000, 250); statusChecker.m_result = false; - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); statusChecker.m_result = false; - OutputHelper.WriteLine("Changing period to -ve"); - OutputHelper.WriteLine("period is negative and is not equal to Infinite (or -1) should throw an exception"); + // Changing period to -ve + // period is negative and is not equal to Infinite (or -1) should throw an exception Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { stateTimer.Change(0, -2); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(7500, false); }); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); } @@ -388,11 +388,11 @@ public void Timer_Negative_Duetime_Test7() /// /// - OutputHelper.WriteLine("Tests the Timer Change method for ArgumentOutOfRangeException"); + // Tests the Timer Change method for ArgumentOutOfRangeException AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -402,19 +402,19 @@ public void Timer_Negative_Duetime_Test7() new Timer(timerDelegate, autoEvent, 1000, 250); statusChecker.m_result = false; - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); statusChecker.m_result = false; - OutputHelper.WriteLine("Changing period -ve"); - OutputHelper.WriteLine("duetime is negative and is not equal to Infinite(or -1) should throw an exception"); + // Changing period -ve + // duetime is negative and is not equal to Infinite(or -1) should throw an exception Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { stateTimer.Change(-2, 500); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(7500, false); }); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); } @@ -426,7 +426,7 @@ public void Timer_TimerCallback_Null_Test8() /// 2. Verifies ArgumentNullException exception is thrown /// /// - OutputHelper.WriteLine("Tests the Timer for ArgumentNullException"); + // Tests the Timer for ArgumentNullException AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); @@ -435,11 +435,11 @@ public void Timer_TimerCallback_Null_Test8() DateTime.UtcNow.ToString()); Assert.ThrowsException(typeof(ArgumentNullException), () => { - OutputHelper.WriteLine("Passing a 'null' callback parameter to a timer should throw exception"); + // Passing a 'null' callback parameter to a timer should throw exception Timer stateTimer = new Timer(null, autoEvent, 1000, 250); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(7500, false); - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); }); } @@ -457,12 +457,12 @@ public void Timer_MaxInt_DueTime_Test9() /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -472,7 +472,7 @@ public void Timer_MaxInt_DueTime_Test9() new Timer(timerDelegate, autoEvent, 1000, 250); statusChecker.m_result = false; - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); if (!statusChecker.m_result) { @@ -483,13 +483,13 @@ public void Timer_MaxInt_DueTime_Test9() } statusChecker.m_result = false; statusChecker.z_flag = true; - OutputHelper.WriteLine("Changing duetime to 4 sec (Assumed MaxInt)"); + // Changing duetime to 4 sec (Assumed MaxInt) DateTime t1 = DateTime.UtcNow; stateTimer.Change(4000, 250); - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(8000, false); TimeSpan duration = statusChecker.t2 - t1; - OutputHelper.WriteLine("Verifying callback method 1st invoked after 4000msec."); + // Verifying callback method 1st invoked after 4000msec. if (duration.CompareTo(new TimeSpan(4000)) <= 0) { OutputHelper.WriteLine("Failure : expected 1st callback happens more than" + @@ -504,7 +504,7 @@ public void Timer_MaxInt_DueTime_Test9() throw new Exception("Failure : expected callback '" + statusChecker.m_maxCount + "' times but got '" + statusChecker.m_invokeCount + "'"); } - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); } @@ -521,12 +521,12 @@ public void Timer_MaxInt_Period_Test10() /// /// - OutputHelper.WriteLine("Tests the Timer and TimerCallback classes, "); - OutputHelper.WriteLine("as well as the Change and Dispose methods"); + // Tests the Timer and TimerCallback classes, + // as well as the Change and Dispose methods AutoResetEvent autoEvent = new AutoResetEvent(false); StatusChecker statusChecker = new StatusChecker(15); - OutputHelper.WriteLine("Creating the TimerCallback"); + // Creating the TimerCallback TimerCallback timerDelegate = new TimerCallback(statusChecker.CheckStatus); @@ -536,7 +536,7 @@ public void Timer_MaxInt_Period_Test10() new Timer(timerDelegate, autoEvent, 1000, 250); statusChecker.m_result = false; - OutputHelper.WriteLine("Waiting and verifying"); + // Waiting and verifying autoEvent.WaitOne(5000, false); if (!statusChecker.m_result) { @@ -547,9 +547,9 @@ public void Timer_MaxInt_Period_Test10() } statusChecker.m_result = false; statusChecker.m_flag = true; - OutputHelper.WriteLine("Changing period to 4 sec (Assumed MaxInt)"); + // Changing period to 4 sec (Assumed MaxInt) stateTimer.Change(0, 4000); - OutputHelper.WriteLine("Waiting and verifying callback method is invoked every 4 sec"); + // Waiting and verifying callback method is invoked every 4 sec autoEvent.WaitOne(60000, false); if (!statusChecker.m_result) { @@ -558,14 +558,14 @@ public void Timer_MaxInt_Period_Test10() throw new Exception("Failure : after 60sec. expected callback invoked '" + statusChecker.m_maxCount + "' times but got '" + statusChecker.m_invokeCount + "'"); } - OutputHelper.WriteLine("Verifying time interval b/n callback invoke is atleast 4sec."); + // Verifying time interval b/n callback invoke is atleast 4sec. TimeSpan duration = statusChecker.t2 - statusChecker.t1; if (duration.CompareTo(new TimeSpan(4000)) < 0) { - OutputHelper.WriteLine("Failure : expected interval b/n callbacks at least '4sec' but got '" + duration.Seconds.ToString() + "sec'"); + // Failure : expected interval b/n callbacks at least '4sec' but got '" + duration.Seconds.ToString() + "sec' throw new Exception("Failure : expected interval b/n callbacks at least '4sec' but got '" + duration.Seconds.ToString() + "sec'"); } - OutputHelper.WriteLine("Destroying timer."); + // Destroying timer. stateTimer.Dispose(); } diff --git a/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs b/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs index c7cd693f..03d0f892 100644 --- a/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs +++ b/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs @@ -19,13 +19,13 @@ class Work public void DoWorkInfinite() { Thread.Sleep(300); - OutputHelper.WriteLine("Instance thread procedure DoWorkInfinite."); + // Instance thread procedure DoWorkInfinite. Thread.Sleep(Timeout.Infinite); } public static void DoWorkInfiniteStatic() { Thread.Sleep(300); - OutputHelper.WriteLine("Static thread procedure DoWorkInfiniteStatic."); + // Static thread procedure DoWorkInfiniteStatic. Thread.Sleep(Timeout.Infinite); } } @@ -40,10 +40,10 @@ public void Timeout1_Infinite_Test() /// /// - OutputHelper.WriteLine("Starts two threads one infinitely long, aborts one and passes."); - OutputHelper.WriteLine("This may erroneously fail for extremely slow devices."); + // Starts two threads one infinitely long, aborts one and passes. + // This may erroneously fail for extremely slow devices. - OutputHelper.WriteLine("Starting the two threads"); + // Starting the two threads Thread newThread1 = new Thread(Work.DoWorkInfiniteStatic); newThread1.Start(); Work w = new Work(); @@ -51,7 +51,7 @@ public void Timeout1_Infinite_Test() newThread2.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Waiting for 1000msec and verifying both threads are alive"); + // Waiting for 1000msec and verifying both threads are alive int slept = 0; while ((newThread1.IsAlive || newThread2.IsAlive) && slept < 1000) { @@ -60,19 +60,19 @@ public void Timeout1_Infinite_Test() } if (!newThread1.IsAlive || !newThread2.IsAlive) { - OutputHelper.WriteLine("Failure : Both threads were suppose to be sleeping for Timeout.Infinite"); - OutputHelper.WriteLine("IsAlive ? Thread1 = '" + newThread1.IsAlive + "' and Thread2 = '" + newThread2.IsAlive + "'"); + // Failure : Both threads were suppose to be sleeping for Timeout.Infinite + // IsAlive ? Thread1 = '" + newThread1.IsAlive + "' and Thread2 = '" + newThread2.IsAlive + "' throw new Exception("IsAlive ? Thread1 = '" + newThread1.IsAlive + "' and Thread2 = '" + newThread2.IsAlive + "'"); } - OutputHelper.WriteLine("Aborting both threds and Verifying abort."); + // Aborting both threds and Verifying abort. newThread2.Abort(); newThread1.Abort(); Thread.Sleep(10); if (newThread1.IsAlive || newThread2.IsAlive) { - OutputHelper.WriteLine("Upon Abort both thread should be dead but"); - OutputHelper.WriteLine("IsAlive ? Thread1 = '" + newThread1.IsAlive + "' and Thread2 = '" + newThread2.IsAlive + "'"); + // Upon Abort both thread should be dead but + // IsAlive ? Thread1 = '" + newThread1.IsAlive + "' and Thread2 = '" + newThread2.IsAlive + "' throw new Exception("IsAlive ? Thread1 = '" + newThread1.IsAlive + "' and Thread2 = '" + newThread2.IsAlive + "'"); } } diff --git a/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs b/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs index 42ee9c9d..c81581ec 100644 --- a/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs +++ b/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs @@ -49,52 +49,53 @@ public void WaitHandle1_WaitAll_WaitAny_Test() /// 6. Verifies that only one threads has executed /// /// - OutputHelper.WriteLine("This test may erroneously pass or fail due to machine speed"); - OutputHelper.WriteLine("Tests the WaitAll method"); + // This test may erroneously pass or fail due to machine speed + // Tests the WaitAll method - OutputHelper.WriteLine("Create threads"); + // Create threads Thread t1 = new Thread(DoTask1); Thread t2 = new Thread(DoTask2); t1.Start(); t2.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Waiting for all tasks to complete and verifying"); + // Waiting for all tasks to complete and verifying if (!WaitHandle.WaitAll(waitHandles)) { - OutputHelper.WriteLine("Not all waithandles has received the signal"); + // Not all waithandles has received the signal throw new Exception("Not all waithandles has received the signal"); } bool r = t1.IsAlive, s = t2.IsAlive; if (r || s) { - OutputHelper.WriteLine("Not all threads are dead"); + // Not all threads are dead if (r) { - OutputHelper.WriteLine("t1 is Alive"); + // t1 is Alive } if (s) { - OutputHelper.WriteLine("t2 is Alive"); + // t2 is Alive } throw new Exception("Not all threads are dead"); } - OutputHelper.WriteLine("Re-create threads"); + // Re-create threads t1 = new Thread(DoTask1); t2 = new Thread(DoTask2); t1.Start(); t2.Start(); Thread.Sleep(1); - OutputHelper.WriteLine("Waiting for either task to complete and verifying"); - OutputHelper.WriteLine("The WaitHandle with index " + WaitHandle.WaitAny(waitHandles).ToString() + " satisfied the wait"); - OutputHelper.WriteLine("Doing t1 XOR t2 to verify only one but not both are alive or dead"); - OutputHelper.WriteLine("t1 XOR t2 = ~((p&q)||(~p & ~q))"); + // Waiting for either task to complete and verifying + WaitHandle.WaitAny(waitHandles); + + // Doing t1 XOR t2 to verify only one but not both are alive or dead + // t1 XOR t2 = ~((p&q)||(~p & ~q)) bool p = t1.IsAlive, q = t2.IsAlive; if ((p && q) || ((!p) && (!q))) { - OutputHelper.WriteLine("Not both but either one should have finished"); + // Not both but either one should have finished throw new Exception("Not both but either one should have finished"); } OutputHelper.WriteLine(p == true ? "t1 is Alive " : "t1 is Dead "); @@ -130,27 +131,27 @@ public void WaitHandle2_WatiOne_Test() /// /// - OutputHelper.WriteLine("This test verifies thread waits, and executes when signaled"); - OutputHelper.WriteLine("Tests WaitOne method"); + // This test verifies thread waits, and executes when signaled + // Tests WaitOne method Thread newThread1 = new Thread(Work); newThread1.Start(); - OutputHelper.WriteLine("Signal the worker 5 times"); + // Signal the worker 5 times for (int i = 1; i <= 5; i++) { - OutputHelper.WriteLine("First wait until worker is ready"); + // First wait until worker is ready ready.WaitOne(); - OutputHelper.WriteLine("Doing task"); + // Doing task counter++; - OutputHelper.WriteLine("Tell worker to go!"); + // Tell worker to go! go.Set(); } if (counter != 5) { - OutputHelper.WriteLine("expected signaling '5' but got '" + counter + "'"); + // expected signaling '5' but got '" + counter + "' throw new Exception("expected signaling '5' but got '" + counter + "'"); } - OutputHelper.WriteLine("Tell the worker to end by reseting counter to 0(zero)"); + // Tell the worker to end by reseting counter to 0(zero) ready.WaitOne(); counter = 0; go.Set(); diff --git a/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs b/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs index dda3a61d..e5b57de3 100644 --- a/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs @@ -14,7 +14,7 @@ class UnitTestObjectTypeTests [TestMethod] public void TestCtor() { - OutputHelper.WriteLine("Test of Object constructor"); + // Test of Object constructor object o = new(); Assert.IsNotNull(o, "failed to create an Object"); @@ -23,7 +23,7 @@ public void TestCtor() [TestMethod] public void TestEquals_01() { - OutputHelper.WriteLine("Test01 of Object Equals"); + // Test01 of Object Equals object objectX = new(); object objectY = new(); @@ -41,7 +41,7 @@ public void TestEquals_01() [TestMethod] public void TestEquals_02() { - OutputHelper.WriteLine("Test02 of Object Equals overload"); + // Test02 of Object Equals overload object objectX = new(); object objectY = new(); @@ -62,7 +62,7 @@ public void TestEquals_02() [TestMethod] public void TestGetHashCode() { - OutputHelper.WriteLine("Test Object HashCode"); + // Test Object HashCode object objectX = new(); Assert.AreEqual(objectX.GetHashCode(), objectX.GetHashCode(), "Object's hash code should not change"); @@ -71,7 +71,7 @@ public void TestGetHashCode() [TestMethod] public void TestGetType() { - OutputHelper.WriteLine("Test getting Object type"); + // Test getting Object type object objectX = new(); @@ -82,7 +82,7 @@ public void TestGetType() [TestMethod] public void TestReferenceEquals() { - OutputHelper.WriteLine("Test Object ReferenceEquals"); + // Test Object ReferenceEquals object objectX = new(); object objectY = new(); @@ -98,7 +98,7 @@ public void TestReferenceEquals() [TestMethod] public void TestToString() { - OutputHelper.WriteLine("Test Object ToString"); + // Test Object ToString object objectX = new(); object objectY = new(); diff --git a/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs b/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs index ca7b072f..a9c69f2b 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs @@ -16,95 +16,95 @@ public class ValueArrayTypes [TestMethod] public void ValueArray01_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" byte is an alias for System.Byte"); + // Section 4.1 + // byte is an alias for System.Byte ValueArrayTestClass01.testMethod(); } [TestMethod] public void ValueArray02_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" char is an alias for System.Char"); + // Section 4.1 + // char is an alias for System.Char ValueArrayTestClass02.testMethod(); } [TestMethod] public void ValueArray03_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" short is an alias for System.Int16"); + // Section 4.1 + // short is an alias for System.Int16 ValueArrayTestClass03.testMethod(); } [TestMethod] public void ValueArray04_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" int is an alias for System.Int32"); + // Section 4.1 + // int is an alias for System.Int32 ValueArrayTestClass04.testMethod(); } [TestMethod] public void ValueArray05_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" long is an alias for System.Int64"); + // Section 4.1 + // long is an alias for System.Int64 ValueArrayTestClass05.testMethod(); } [TestMethod] public void ValueArray06_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" float is an alias for System.Single"); + // Section 4.1 + // float is an alias for System.Single ValueArrayTestClass06.testMethod(); } [TestMethod] public void ValueArray07_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" double is an alias for System.Double"); + // Section 4.1 + // double is an alias for System.Double ValueArrayTestClass07.testMethod(); } [TestMethod] public void ValueArray09_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" bool is an alias for System.Boolean"); + // Section 4.1 + // bool is an alias for System.Boolean ValueArrayTestClass09.testMethod(); } [TestMethod] public void ValueArray12_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" Because a simple type aliases a struct type, every simple type has members."); - OutputHelper.WriteLine("This test is expected to fail"); + // Section 4.1 + // Because a simple type aliases a struct type, every simple type has members. + // This test is expected to fail ValueArrayTestClass12.testMethod(); } [TestMethod] public void ValueArray13_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" sbyte is an alias for System.SByte"); + // Section 4.1 + // sbyte is an alias for System.SByte ValueArrayTestClass13.testMethod(); } [TestMethod] public void ValueArray14_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" ushort is an alias for System.UInt16"); + // Section 4.1 + // ushort is an alias for System.UInt16 ValueArrayTestClass14.testMethod(); } [TestMethod] public void ValueArray15_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" uint is an alias for System.UInt32"); + // Section 4.1 + // uint is an alias for System.UInt32 ValueArrayTestClass15.testMethod(); } diff --git a/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs b/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs index 5d627f31..6670c3ba 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs @@ -16,98 +16,98 @@ class UnitTestValueDefultConstTests [TestMethod] public void ValueDefault_Const01_Test() { - OutputHelper.WriteLine("Testing byte == 0"); + // Testing byte == 0 ValueDefault_ConstTestClass01.testMethod(); } [TestMethod] public void ValueDefault_Const02_Test() { - OutputHelper.WriteLine("Testing short == 0"); + // Testing short == 0 ValueDefault_ConstTestClass02.testMethod(); } [TestMethod] public void ValueDefault_Const03_Test() { - OutputHelper.WriteLine("Testing int == 0"); + // Testing int == 0 ValueDefault_ConstTestClass03.testMethod(); } [TestMethod] public void ValueDefault_Const04_Test() { - OutputHelper.WriteLine("Testing long == 0L"); + // Testing long == 0L ValueDefault_ConstTestClass04.testMethod(); } [TestMethod] public void ValueDefault_Const05_Test() { - OutputHelper.WriteLine("Testing char == \x0000"); + // Testing char == \x0000 ValueDefault_ConstTestClass05.testMethod(); } [TestMethod] public void ValueDefault_Const06_Test() { - OutputHelper.WriteLine("Testing float == 0.0f"); + // Testing float == 0.0f ValueDefault_ConstTestClass06.testMethod(); } [TestMethod] public void ValueDefault_Const07_Test() { - OutputHelper.WriteLine("Testing double == 0.0d"); + // Testing double == 0.0d ValueDefault_ConstTestClass07.testMethod(); } [TestMethod] public void ValueDefault_Const09_Test() { - OutputHelper.WriteLine("Testing bool == false"); + // Testing bool == false ValueDefault_ConstTestClass09.testMethod(); } [TestMethod] public void ValueDefault_Const11_Test() { - OutputHelper.WriteLine("Testing enum"); + // Testing enum ValueDefault_ConstTestClass11.testMethod(); } [TestMethod] public void ValueDefault_Const12_Test() { - OutputHelper.WriteLine("Testing struct"); + // Testing struct ValueDefault_ConstTestClass12.testMethod(); } [TestMethod] public void ValueDefault_Const14_Test() { - OutputHelper.WriteLine("Testing sbyte == 0"); + // Testing sbyte == 0 ValueDefault_ConstTestClass14.testMethod(); } [TestMethod] public void ValueDefault_Const15_Test() { - OutputHelper.WriteLine("Testing ushort == 0"); + // Testing ushort == 0 ValueDefault_ConstTestClass15.testMethod(); } [TestMethod] public void ValueDefault_Const16_Test() { - OutputHelper.WriteLine("Testing uint == 0"); + // Testing uint == 0 ValueDefault_ConstTestClass16.testMethod(); } [TestMethod] public void ValueDefault_Const17_Test() { - OutputHelper.WriteLine("Testing ulong == 0"); + // Testing ulong == 0 ValueDefault_ConstTestClass17.testMethod(); } diff --git a/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs b/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs index 6334a048..8b772fa7 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs @@ -19,189 +19,189 @@ class UnitTestValueFloatTests [TestMethod] public void ValueFloat04_Test() { - OutputHelper.WriteLine("Testing float type is kept after addition with other types"); + // Testing float type is kept after addition with other types ValueFloatTestClass04.testMethod(); } [TestMethod] public void ValueFloat05_Test() { - OutputHelper.WriteLine("Testing double type is kept after addition with other types"); + // Testing double type is kept after addition with other types ValueFloatTestClass05.testMethod(); } [TestMethod] public void ValueFloat06_Test() { - OutputHelper.WriteLine("Testing float type is kept after subtraction with other types"); + // Testing float type is kept after subtraction with other types ValueFloatTestClass06.testMethod(); } [TestMethod] public void ValueFloat07_Test() { - OutputHelper.WriteLine("Testing double type is kept after subtraction with other types"); + // Testing double type is kept after subtraction with other types ValueFloatTestClass07.testMethod(); } [TestMethod] public void ValueFloat08_Test() { - OutputHelper.WriteLine("Testing float type is kept after multiplication with other types"); + // Testing float type is kept after multiplication with other types ValueFloatTestClass08.testMethod(); } [TestMethod] public void ValueFloat09_Test() { - OutputHelper.WriteLine("Testing double type is kept after maultiplication with other types"); + // Testing double type is kept after maultiplication with other types ValueFloatTestClass09.testMethod(); } [TestMethod] public void ValueFloat10_Test() { - OutputHelper.WriteLine("Testing float type is kept after division with other types"); + // Testing float type is kept after division with other types ValueFloatTestClass10.testMethod(); } [TestMethod] public void ValueFloat11_Test() { - OutputHelper.WriteLine("Testing double type is kept after division with other types"); + // Testing double type is kept after division with other types ValueFloatTestClass11.testMethod(); } [TestMethod] public void ValueFloat12_Test() { - OutputHelper.WriteLine("Testing float type is kept after modulus with other types"); + // Testing float type is kept after modulus with other types ValueFloatTestClass12.testMethod(); } [TestMethod] public void ValueFloat13_Test() { - OutputHelper.WriteLine("Testing double type is kept after modulus with other types"); + // Testing double type is kept after modulus with other types ValueFloatTestClass13.testMethod(); } [TestMethod] public void ValueFloat14_Test() { - OutputHelper.WriteLine("Testing that equality operations return bool type objects"); + // Testing that equality operations return bool type objects ValueFloatTestClass14.testMethod(); } [TestMethod] public void ValueFloat15_Test() { - OutputHelper.WriteLine("Testing that equality operations return bool type objects"); + // Testing that equality operations return bool type objects ValueFloatTestClass15.testMethod(); } [TestMethod] public void ValueFloat16_Test() { - OutputHelper.WriteLine("Testing that non-equality operations return bool type objects"); + // Testing that non-equality operations return bool type objects ValueFloatTestClass16.testMethod(); } [TestMethod] public void ValueFloat17_Test() { - OutputHelper.WriteLine("Testing that non-equality operations return bool type objects"); + // Testing that non-equality operations return bool type objects ValueFloatTestClass17.testMethod(); } [TestMethod] public void ValueFloat18_Test() { - OutputHelper.WriteLine("Testing that greater than operations return bool type objects"); + // Testing that greater than operations return bool type objects ValueFloatTestClass18.testMethod(); } [TestMethod] public void ValueFloat19_Test() { - OutputHelper.WriteLine("Testing that greater than operations return bool type objects"); + // Testing that greater than operations return bool type objects ValueFloatTestClass19.testMethod(); } [TestMethod] public void ValueFloat20_Test() { - OutputHelper.WriteLine("Testing that less than operations return bool type objects"); + // Testing that less than operations return bool type objects ValueFloatTestClass20.testMethod(); } [TestMethod] public void ValueFloat21_Test() { - OutputHelper.WriteLine("Testing that less than operations return bool type objects"); + // Testing that less than operations return bool type objects ValueFloatTestClass21.testMethod(); } [TestMethod] public void ValueFloat22_Test() { - OutputHelper.WriteLine("Testing that greater than or equal operations return bool type objects"); + // Testing that greater than or equal operations return bool type objects ValueFloatTestClass22.testMethod(); } [TestMethod] public void ValueFloat23_Test() { - OutputHelper.WriteLine("Testing that greater than or equal operations return bool type objects"); + // Testing that greater than or equal operations return bool type objects ValueFloatTestClass23.testMethod(); } [TestMethod] public void ValueFloat24_Test() { - OutputHelper.WriteLine("Testing that less than or equal operations return bool type objects"); + // Testing that less than or equal operations return bool type objects ValueFloatTestClass24.testMethod(); } [TestMethod] public void ValueFloat25_Test() { - OutputHelper.WriteLine("Testing that less than or equal operations return bool type objects"); + // Testing that less than or equal operations return bool type objects ValueFloatTestClass25.testMethod(); } [TestMethod] public void ValueFloat26_Test() { - OutputHelper.WriteLine("Testing that double keeps its type in all operations with float"); + // Testing that double keeps its type in all operations with float ValueFloatTestClass26.testMethod(); } [TestMethod] public void ValueFloat27_Test() { - OutputHelper.WriteLine("Testing that comparisons between floats and doubles return bools"); + // Testing that comparisons between floats and doubles return bools ValueFloatTestClass27.testMethod(); } [TestMethod] public void ValueFloat28_Test() { - OutputHelper.WriteLine("Testing that float keeps its type after any operation with a float"); + // Testing that float keeps its type after any operation with a float ValueFloatTestClass28.testMethod(); } [TestMethod] public void ValueFloat29_Test() { - OutputHelper.WriteLine("Testing that comparisons between floats return bools"); + // Testing that comparisons between floats return bools ValueFloatTestClass29.testMethod(); } [TestMethod] public void ValueFloat30_Test() { - OutputHelper.WriteLine("Testing float and double .epsilon values"); + // Testing float and double .epsilon values ValueFloatTestClass30.testMethod(); } diff --git a/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs b/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs index 193b7cff..81bf0c72 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs @@ -20,424 +20,424 @@ class UnitTestValueIntegralTests [TestMethod] public void ValueIntegral01_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the +, - and ~ unary operators, of the operand is of type long, the"); - OutputHelper.WriteLine(" operation is performed using 64-bit precision, and the type of the result"); - OutputHelper.WriteLine(" is long. Otherwise, the operand is converted to int, and operation is"); - OutputHelper.WriteLine(" performed using 32-bit precision, and the type of the result is int."); + // Section 4.1 + // For the +, - and ~ unary operators, of the operand is of type long, the + // operation is performed using 64-bit precision, and the type of the result + // is long. Otherwise, the operand is converted to int, and operation is + // performed using 32-bit precision, and the type of the result is int. ValueIntegralTestClass01.testMethod(); } [TestMethod] public void ValueIntegral05_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the +, - and ~ unary operators, of the operand is of type long, the"); - OutputHelper.WriteLine(" operation is performed using 64-bit precision, and the type of the result"); - OutputHelper.WriteLine(" is long. Otherwise, the operand is converted to int, and operation is"); - OutputHelper.WriteLine(" performed using 32-bit precision, and the type of the result is int."); + // Section 4.1 + // For the +, - and ~ unary operators, of the operand is of type long, the + // operation is performed using 64-bit precision, and the type of the result + // is long. Otherwise, the operand is converted to int, and operation is + // performed using 32-bit precision, and the type of the result is int. ValueIntegralTestClass05.testMethod(); } [TestMethod] public void ValueIntegral09_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the +, - and ~ unary operators, of the operand is of type long, the"); - OutputHelper.WriteLine(" operation is performed using 64-bit precision, and the type of the result"); - OutputHelper.WriteLine(" is long. Otherwise, the operand is converted to int, and operation is"); - OutputHelper.WriteLine(" performed using 32-bit precision, and the type of the result is int."); + // Section 4.1 + // For the +, - and ~ unary operators, of the operand is of type long, the + // operation is performed using 64-bit precision, and the type of the result + // is long. Otherwise, the operand is converted to int, and operation is + // performed using 32-bit precision, and the type of the result is int. ValueIntegralTestClass09.testMethod(); } [TestMethod] public void ValueIntegral13_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass13.testMethod(); } [TestMethod] public void ValueIntegral14_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass14.testMethod(); } [TestMethod] public void ValueIntegral15_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass15.testMethod(); } [TestMethod] public void ValueIntegral16_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass16.testMethod(); } [TestMethod] public void ValueIntegral17_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass17.testMethod(); } [TestMethod] public void ValueIntegral18_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass18.testMethod(); } [TestMethod] public void ValueIntegral19_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass19.testMethod(); } [TestMethod] public void ValueIntegral20_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass20.testMethod(); } [TestMethod] public void ValueIntegral21_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass21.testMethod(); } [TestMethod] public void ValueIntegral22_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass22.testMethod(); } [TestMethod] public void ValueIntegral23_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass23.testMethod(); } [TestMethod] public void ValueIntegral24_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass24.testMethod(); } [TestMethod] public void ValueIntegral25_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass25.testMethod(); } [TestMethod] public void ValueIntegral26_Test() { - OutputHelper.WriteLine(" For the binary operators other than shift, if at least one"); - OutputHelper.WriteLine(" operand is of type long, then both operands are converted to long, the operation"); - OutputHelper.WriteLine(" is performed using 64-bit precision, and the type of the result is long or bool. "); - OutputHelper.WriteLine(" Otherwise, both operands are converted to int, the operation is performed using "); - OutputHelper.WriteLine(" 32-bit precision, and the type of the result is int or bool."); + // For the binary operators other than shift, if at least one + // operand is of type long, then both operands are converted to long, the operation + // is performed using 64-bit precision, and the type of the result is long or bool. + // Otherwise, both operands are converted to int, the operation is performed using + // 32-bit precision, and the type of the result is int or bool. ValueIntegralTestClass26.testMethod(); } [TestMethod] public void ValueIntegral27_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the shift operators, if the left-hand operand is of type long,"); - OutputHelper.WriteLine(" the operation is performed using 64-bit precision, and the type of the result"); - OutputHelper.WriteLine(" is long. Otherwise, the left hand-operand is converted to int, the operation is "); - OutputHelper.WriteLine(" performed using 32-bit precision, and the type of the result is int."); + // Section 4.1 + // For the shift operators, if the left-hand operand is of type long, + // the operation is performed using 64-bit precision, and the type of the result + // is long. Otherwise, the left hand-operand is converted to int, the operation is + // performed using 32-bit precision, and the type of the result is int. ValueIntegralTestClass27.testMethod(); } [TestMethod] public void ValueIntegral28_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the shift operators, if the left-hand operand is of type long,"); - OutputHelper.WriteLine(" the operation is performed using 64-bit precision, and the type of the result"); - OutputHelper.WriteLine(" is long. Otherwise, the left hand-operand is converted to int, the operation is "); - OutputHelper.WriteLine(" performed using 32-bit precision, and the type of the result is int."); + // Section 4.1 + // For the shift operators, if the left-hand operand is of type long, + // the operation is performed using 64-bit precision, and the type of the result + // is long. Otherwise, the left hand-operand is converted to int, the operation is + // performed using 32-bit precision, and the type of the result is int. ValueIntegralTestClass28.testMethod(); } [TestMethod] public void ValueIntegral38_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" Constants of the char type must be written as character-literals."); - OutputHelper.WriteLine(" Character constants can only be written as integer-literals"); - OutputHelper.WriteLine(" in combination with a cast. For example, (char)10 is the same as"); - OutputHelper.WriteLine(" '\x000A'."); + // Section 4.1 + // Constants of the char type must be written as character-literals. + // Character constants can only be written as integer-literals + // in combination with a cast. For example, (char)10 is the same as + // '\x000A'. ValueIntegralTestClass38.testMethod(); } [TestMethod] public void ValueIntegral39_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the unary + and ~ operators, the operand is converted"); - OutputHelper.WriteLine(" to type T, where T is the first of int, uint, long, and"); - OutputHelper.WriteLine(" ulong that can fully represent all possible values of the"); - OutputHelper.WriteLine(" operand. The operation is then performed using the precision "); - OutputHelper.WriteLine(" of type T, and the type of the result is T."); + // Section 4.1 + // For the unary + and ~ operators, the operand is converted + // to type T, where T is the first of int, uint, long, and + // ulong that can fully represent all possible values of the + // operand. The operation is then performed using the precision + // of type T, and the type of the result is T. ValueIntegralTestClass39.testMethod(); } [TestMethod] public void ValueIntegral42_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the unary + and ~ operators, the operand is converted"); - OutputHelper.WriteLine(" to type T, where T is the first of int, uint, long, and"); - OutputHelper.WriteLine(" ulong that can fully represent all possible values of the"); - OutputHelper.WriteLine(" operand. The operation is then performed using the precision "); - OutputHelper.WriteLine(" of type T, and the type of the result is T."); + // Section 4.1 + // For the unary + and ~ operators, the operand is converted + // to type T, where T is the first of int, uint, long, and + // ulong that can fully represent all possible values of the + // operand. The operation is then performed using the precision + // of type T, and the type of the result is T. ValueIntegralTestClass42.testMethod(); } [TestMethod] public void ValueIntegral45_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the unary - operator, the operand is converted"); - OutputHelper.WriteLine(" to type T, where T is the first of int and long that "); - OutputHelper.WriteLine(" can fully represent all possible values of the "); - OutputHelper.WriteLine(" operand. The operation is then performed using the"); - OutputHelper.WriteLine(" precision of type T, and the type of the result is T."); - OutputHelper.WriteLine(" The unary - operator cannot be applied to operands of"); - OutputHelper.WriteLine(" type ulong."); + // Section 4.1 + // For the unary - operator, the operand is converted + // to type T, where T is the first of int and long that + // can fully represent all possible values of the + // operand. The operation is then performed using the + // precision of type T, and the type of the result is T. + // The unary - operator cannot be applied to operands of + // type ulong. ValueIntegralTestClass45.testMethod(); } [TestMethod] public void ValueIntegral49_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass49.testMethod(); } [TestMethod] public void ValueIntegral50_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass50.testMethod(); } [TestMethod] public void ValueIntegral51_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass51.testMethod(); } [TestMethod] public void ValueIntegral52_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass52.testMethod(); } [TestMethod] public void ValueIntegral53_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass53.testMethod(); } [TestMethod] public void ValueIntegral54_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass54.testMethod(); } [TestMethod] public void ValueIntegral55_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass55.testMethod(); } [TestMethod] public void ValueIntegral56_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass56.testMethod(); } [TestMethod] public void ValueIntegral57_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass57.testMethod(); } [TestMethod] public void ValueIntegral58_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass58.testMethod(); } [TestMethod] public void ValueIntegral59_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass59.testMethod(); } [TestMethod] public void ValueIntegral60_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass60.testMethod(); } [TestMethod] public void ValueIntegral61_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass61.testMethod(); } [TestMethod] public void ValueIntegral62_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary operators except shift, the operands"); - OutputHelper.WriteLine(" are converted to type T, where T is the first of int, uint, long, and ulong"); - OutputHelper.WriteLine(" that can fully represent all possible values of each operand. The operation"); - OutputHelper.WriteLine(" is then performed using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" is T (or bool for relational operators)."); + // Section 4.1 + // For the binary operators except shift, the operands + // are converted to type T, where T is the first of int, uint, long, and ulong + // that can fully represent all possible values of each operand. The operation + // is then performed using the precision of type T, and the type of the result + // is T (or bool for relational operators). ValueIntegralTestClass62.testMethod(); } [TestMethod] public void ValueIntegral63_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary shift operators, the left operand"); - OutputHelper.WriteLine(" is converted to type T, where T is the first of int,"); - OutputHelper.WriteLine(" uint, long, and ulong that can fully represent all possible"); - OutputHelper.WriteLine(" values of the operand. The operation is then performed"); - OutputHelper.WriteLine(" using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" T."); + // Section 4.1 + // For the binary shift operators, the left operand + // is converted to type T, where T is the first of int, + // uint, long, and ulong that can fully represent all possible + // values of the operand. The operation is then performed + // using the precision of type T, and the type of the result + // T. ValueIntegralTestClass63.testMethod(); } [TestMethod] public void ValueIntegral64_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" For the binary shift operators, the left operand"); - OutputHelper.WriteLine(" is converted to type T, where T is the first of int,"); - OutputHelper.WriteLine(" uint, long, and ulong that can fully represent all possible"); - OutputHelper.WriteLine(" values of the operand. The operation is then performed"); - OutputHelper.WriteLine(" using the precision of type T, and the type of the result"); - OutputHelper.WriteLine(" T."); + // Section 4.1 + // For the binary shift operators, the left operand + // is converted to type T, where T is the first of int, + // uint, long, and ulong that can fully represent all possible + // values of the operand. The operation is then performed + // using the precision of type T, and the type of the result + // T. ValueIntegralTestClass64.testMethod(); } [TestMethod] public void ValueIntegral70_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" Constants of the char type must be written as character-literals."); - OutputHelper.WriteLine(" Character constants can only be written as integer-literals"); - OutputHelper.WriteLine(" in compination with a cast. For example, (char)10 is the same "); - OutputHelper.WriteLine(" as '\x000a'."); + // Section 4.1 + // Constants of the char type must be written as character-literals. + // Character constants can only be written as integer-literals + // in compination with a cast. For example, (char)10 is the same + // as '\x000a'. ValueIntegralTestClass70.testMethod(); } diff --git a/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs b/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs index f191a4c4..767faa0d 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs @@ -16,95 +16,95 @@ class UnitTestValueSimpleTests [TestMethod] public void ValueSimple01_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" byte is an alias for System.Byte"); + // Section 4.1 + // byte is an alias for System.Byte ValueSimpleTestClass01.testMethod(); } [TestMethod] public void ValueSimple02_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" char is an alias for System.Char"); + // Section 4.1 + // char is an alias for System.Char ValueSimpleTestClass02.testMethod(); } [TestMethod] public void ValueSimple03_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" short is an alias for System.Int16"); + // Section 4.1 + // short is an alias for System.Int16 ValueSimpleTestClass03.testMethod(); } [TestMethod] public void ValueSimple04_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" int is an alias for System.Int32"); + // Section 4.1 + // int is an alias for System.Int32 ValueSimpleTestClass04.testMethod(); } [TestMethod] public void ValueSimple05_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" long is an alias for System.Int64"); + // Section 4.1 + // long is an alias for System.Int64 ValueSimpleTestClass05.testMethod(); } [TestMethod] public void ValueSimple06_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" float is an alias for System.Single"); + // Section 4.1 + // float is an alias for System.Single ValueSimpleTestClass06.testMethod(); } [TestMethod] public void ValueSimple07_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" double is an alias for System.Double"); + // Section 4.1 + // double is an alias for System.Double ValueSimpleTestClass07.testMethod(); } [TestMethod] public void ValueSimple09_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" bool is an alias for System.Boolean"); + // Section 4.1 + // bool is an alias for System.Boolean ValueSimpleTestClass09.testMethod(); } [TestMethod] public void ValueSimple11_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" A simple type and the structure type it aliases are completely indistinguishable."); - OutputHelper.WriteLine(" In other words, writing the reserved work byte is exactly the same as writing "); - OutputHelper.WriteLine(" System.Byte, and writing System.Int32 is exactly the same as writing the reserved"); - OutputHelper.WriteLine(" word int."); + // Section 4.1 + // A simple type and the structure type it aliases are completely indistinguishable. + // In other words, writing the reserved work byte is exactly the same as writing + // System.Byte, and writing System.Int32 is exactly the same as writing the reserved + // word int. ValueSimpleTestClass11.testMethod(); } [TestMethod] public void ValueSimple12_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" Because a simple type aliases a struct type, every simple type has members."); + // Section 4.1 + // Because a simple type aliases a struct type, every simple type has members. ValueSimpleTestClass12.testMethod(); } [TestMethod] public void ValueSimple13_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" sbyte is an alias for System.SByte"); + // Section 4.1 + // sbyte is an alias for System.SByte ValueSimpleTestClass13.testMethod(); } [TestMethod] public void ValueSimple14_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" ushort is an alias for System.UInt16"); + // Section 4.1 + // ushort is an alias for System.UInt16 ValueSimpleTestClass14.testMethod(); } [TestMethod] public void ValueSimple15_Test() { - OutputHelper.WriteLine(" Section 4.1"); - OutputHelper.WriteLine(" uint is an alias for System.UInt32"); + // Section 4.1 + // uint is an alias for System.UInt32 ValueSimpleTestClass15.testMethod(); } diff --git a/Tests/NFUnitTestVariables/CategoryTests.cs b/Tests/NFUnitTestVariables/CategoryTests.cs index c1082348..3e8c7e25 100644 --- a/Tests/NFUnitTestVariables/CategoryTests.cs +++ b/Tests/NFUnitTestVariables/CategoryTests.cs @@ -15,14 +15,14 @@ public class CategoryTests [Setup] public void Initialize() { - OutputHelper.WriteLine("Adding set up for the tests."); + // Adding set up for the tests. // Add your functionality here. } [Cleanup] public void CleanUp() { - OutputHelper.WriteLine("Cleaning up after the tests"); + // Cleaning up after the tests } //Categories Test methods @@ -34,201 +34,201 @@ public void CleanUp() [TestMethod] public void Categories_static01_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static01.testMethod(); } [TestMethod] public void Categories_static02_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static02.testMethod(); } [TestMethod] public void Categories_static03_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static03.testMethod(); } [TestMethod] public void Categories_static04_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static04.testMethod(); } [TestMethod] public void Categories_static05_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static05.testMethod(); } [TestMethod] public void Categories_static06_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static06.testMethod(); } [TestMethod] public void Categories_static07_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static07.testMethod(); } [TestMethod] public void Categories_static09_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static09.testMethod(); } [TestMethod] public void Categories_static11_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static11.testMethod(); } [TestMethod] public void Categories_static12_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static12.testMethod(); } [TestMethod] public void Categories_static13_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static13.testMethod(); } [TestMethod] public void Categories_static14_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static14.testMethod(); } [TestMethod] public void Categories_static15_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static15.testMethod(); } [TestMethod] public void Categories_static16_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static16.testMethod(); } [TestMethod] public void Categories_static17_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine(" Categories_TestClass_?_A field declared with the static modifier is called a"); - OutputHelper.WriteLine("static variable. Categories_TestClass_?_A static variable comes into existence"); - OutputHelper.WriteLine("when the type in which it is declared is loaded, and "); - OutputHelper.WriteLine("ceases to exist when the type in which it is declared"); - OutputHelper.WriteLine("is unloaded."); + // Section 5.1.1 + // Categories_TestClass_?_A field declared with the static modifier is called a + // static variable. Categories_TestClass_?_A static variable comes into existence + // when the type in which it is declared is loaded, and + // ceases to exist when the type in which it is declared + // is unloaded. Categories_TestClass_static17.testMethod(); } [TestMethod] public void Categories_static18_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine("The initial value of a static variable is the default value"); - OutputHelper.WriteLine("of the variable's type."); + // Section 5.1.1 + // The initial value of a static variable is the default value + // of the variable's type. Categories_TestClass_static18.testMethod(); } [TestMethod] public void Categories_static19_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine("The initial value of a static variable is the default value"); - OutputHelper.WriteLine("of the variable's type."); + // Section 5.1.1 + // The initial value of a static variable is the default value + // of the variable's type. Categories_TestClass_static19.testMethod(); } [TestMethod] public void Categories_static20_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine("The initial value of a static variable is the default value"); - OutputHelper.WriteLine("of the variable's type."); + // Section 5.1.1 + // The initial value of a static variable is the default value + // of the variable's type. Categories_TestClass_static20.testMethod(); } /* [TestMethod] public void Categories_static21_Test() { - OutputHelper.WriteLine("Section 5"); + // Section 5 Categories_TestClass_static21.testMethod()) { return MFTestResults.Pass; @@ -239,340 +239,340 @@ public void Categories_static21_Test() [TestMethod] public void Categories_inst018_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst018.testMethod(); } [TestMethod] public void Categories_inst019_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst019.testMethod(); } [TestMethod] public void Categories_inst020_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst020.testMethod(); } [TestMethod] public void Categories_inst021_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst021.testMethod(); } [TestMethod] public void Categories_inst022_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst022.testMethod(); } [TestMethod] public void Categories_inst023_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst023.testMethod(); } [TestMethod] public void Categories_inst024_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst024.testMethod(); } [TestMethod] public void Categories_inst026_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst026.testMethod(); } [TestMethod] public void Categories_inst028_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst028.testMethod(); } [TestMethod] public void Categories_inst029_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst029.testMethod(); } [TestMethod] public void Categories_inst030_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst030.testMethod(); } [TestMethod] public void Categories_inst031_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst031.testMethod(); } [TestMethod] public void Categories_inst032_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst032.testMethod(); } [TestMethod] public void Categories_inst033_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst033.testMethod(); } [TestMethod] public void Categories_inst034_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a class comes into existence when "); - OutputHelper.WriteLine("a new instance of that class is created, and ceases to exist"); - OutputHelper.WriteLine("when there are no references to that instance and the finalizer"); - OutputHelper.WriteLine("of the instance has executed."); + // Section 5.1.2 + // An instance variable of a class comes into existence when + // a new instance of that class is created, and ceases to exist + // when there are no references to that instance and the finalizer + // of the instance has executed. Categories_TestClass_inst034.testMethod(); } [TestMethod] public void Categories_inst035_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine("The initial value of an instance variable is the default value"); - OutputHelper.WriteLine("of the variable's type."); + // Section 5.1.1 + // The initial value of an instance variable is the default value + // of the variable's type. Categories_TestClass_inst035.testMethod(); } [TestMethod] public void Categories_inst036_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine("The initial value of an instance variable is the default value"); - OutputHelper.WriteLine("of the variable's type."); + // Section 5.1.1 + // The initial value of an instance variable is the default value + // of the variable's type. Categories_TestClass_inst036.testMethod(); } [TestMethod] public void Categories_inst037_Test() { - OutputHelper.WriteLine("Section 5.1.1"); - OutputHelper.WriteLine("The initial value of an instance variable is the default value"); - OutputHelper.WriteLine("of the variable's type."); + // Section 5.1.1 + // The initial value of an instance variable is the default value + // of the variable's type. Categories_TestClass_inst037.testMethod(); } [TestMethod] public void Categories_inst038_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst038.testMethod(); } [TestMethod] public void Categories_inst039_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst039.testMethod(); } [TestMethod] public void Categories_inst040_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst040.testMethod(); } [TestMethod] public void Categories_inst041_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst041.testMethod(); } [TestMethod] public void Categories_inst042_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst042.testMethod(); } [TestMethod] public void Categories_inst043_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst043.testMethod(); } [TestMethod] public void Categories_inst044_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst044.testMethod(); } [TestMethod] public void Categories_inst046_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst046.testMethod(); } [TestMethod] public void Categories_inst048_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst048.testMethod(); } [TestMethod] public void Categories_inst049_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst049.testMethod(); } [TestMethod] public void Categories_inst050_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst050.testMethod(); } [TestMethod] public void Categories_inst051_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst051.testMethod(); } [TestMethod] public void Categories_inst052_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst052.testMethod(); } [TestMethod] public void Categories_inst053_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst053.testMethod(); } [TestMethod] public void Categories_inst054_Test() { - OutputHelper.WriteLine("Section 5.1.2"); - OutputHelper.WriteLine("An instance variable of a struct has exactly the"); - OutputHelper.WriteLine("same lifetime as the struct variable to which it"); - OutputHelper.WriteLine("belongs. In other words, when a variable of a "); - OutputHelper.WriteLine("struct type comes into existence or ceases to "); - OutputHelper.WriteLine("exist, so do the instance variables of the struct."); + // Section 5.1.2 + // An instance variable of a struct has exactly the + // same lifetime as the struct variable to which it + // belongs. In other words, when a variable of a + // struct type comes into existence or ceases to + // exist, so do the instance variables of the struct. Categories_TestClass_inst054.testMethod(); } diff --git a/Tests/NFUnitTestVariables/VariableTests.cs b/Tests/NFUnitTestVariables/VariableTests.cs index a2cb12b0..6d810af1 100644 --- a/Tests/NFUnitTestVariables/VariableTests.cs +++ b/Tests/NFUnitTestVariables/VariableTests.cs @@ -16,13 +16,13 @@ class VariableTests [Setup] public void InitializeVariables() { - OutputHelper.WriteLine("Adding set up for the tests"); + // Adding set up for the tests } [Cleanup] public void CleanUpVariables() { - OutputHelper.WriteLine("Cleaning up after the tests"); + // Cleaning up after the tests } //Variables Test methods @@ -33,161 +33,161 @@ public void CleanUpVariables() [TestMethod] public void Variables_S5_range_byte_0_Test() { - OutputHelper.WriteLine("S5_range_byte_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("byte"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 255Y"); + // S5_range_byte_0.sc + // This is a variable range test: + // byte + // CompilesOK: 1 + // Value: 255Y Variables_TestClass_S5_range_byte_0.testMethod(); } [TestMethod] public void Variables_S5_range_byte_1_Test() { - OutputHelper.WriteLine("S5_range_byte_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("byte"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 0Y"); + // S5_range_byte_1.sc + // This is a variable range test: + // byte + // CompilesOK: 1 + // Value: 0Y Variables_TestClass_S5_range_byte_1.testMethod(); } [TestMethod] public void Variables_S5_range_char_0_Test() { - OutputHelper.WriteLine("S5_range_char_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("char"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 65535"); + // S5_range_char_0.sc + // This is a variable range test: + // char + // CompilesOK: 1 + // Value: 65535 Variables_TestClass_S5_range_char_0.testMethod(); } [TestMethod] public void Variables_S5_range_char_1_Test() { - OutputHelper.WriteLine("S5_range_char_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("char"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 0"); + // S5_range_char_1.sc + // This is a variable range test: + // char + // CompilesOK: 1 + // Value: 0 Variables_TestClass_S5_range_char_1.testMethod(); } [TestMethod] public void Variables_S5_range_double_0_Test() { - OutputHelper.WriteLine("S5_range_double_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("double"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 1.7e308d"); + // S5_range_double_0.sc + // This is a variable range test: + // double + // CompilesOK: 1 + // Value: 1.7e308d Variables_TestClass_S5_range_double_0.testMethod(); } [TestMethod] public void Variables_S5_range_double_1_Test() { - OutputHelper.WriteLine("S5_range_double_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("double"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: -1.7e308d"); + // S5_range_double_1.sc + // This is a variable range test: + // double + // CompilesOK: 1 + // Value: -1.7e308d Variables_TestClass_S5_range_double_1.testMethod(); } [TestMethod] public void Variables_S5_range_float_0_Test() { - OutputHelper.WriteLine("S5_range_float_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("float"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 3.4e38F"); + // S5_range_float_0.sc + // This is a variable range test: + // float + // CompilesOK: 1 + // Value: 3.4e38F Variables_TestClass_S5_range_float_0.testMethod(); } [TestMethod] public void Variables_S5_range_float_1_Test() { - OutputHelper.WriteLine("S5_range_float_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("float"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: -3.4e38F"); + // S5_range_float_1.sc + // This is a variable range test: + // float + // CompilesOK: 1 + // Value: -3.4e38F Variables_TestClass_S5_range_float_1.testMethod(); } [TestMethod] public void Variables_S5_range_int_0_Test() { - OutputHelper.WriteLine("S5_range_int_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("int"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 2147483647"); + // S5_range_int_0.sc + // This is a variable range test: + // int + // CompilesOK: 1 + // Value: 2147483647 Variables_TestClass_S5_range_int_0.testMethod(); } [TestMethod] public void Variables_S5_range_int_1_Test() { - OutputHelper.WriteLine("S5_range_int_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("int"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: -2147483647"); + // S5_range_int_1.sc + // This is a variable range test: + // int + // CompilesOK: 1 + // Value: -2147483647 Variables_TestClass_S5_range_int_1.testMethod(); } [TestMethod] public void Variables_S5_range_int_3_Test() { - OutputHelper.WriteLine("S5_range_int_3.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("int"); - OutputHelper.WriteLine(" CompilesOK: 0"); - OutputHelper.WriteLine(" Value: -2147483648"); + // S5_range_int_3.sc + // This is a variable range test: + // int + // CompilesOK: 0 + // Value: -2147483648 Variables_TestClass_S5_range_int_3.testMethod(); } [TestMethod] public void Variables_S5_range_long_0_Test() { - OutputHelper.WriteLine("S5_range_long_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("long"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 9223372036854775807L"); + // S5_range_long_0.sc + // This is a variable range test: + // long + // CompilesOK: 1 + // Value: 9223372036854775807L Variables_TestClass_S5_range_long_0.testMethod(); } [TestMethod] public void Variables_S5_range_long_1_Test() { - OutputHelper.WriteLine("S5_range_long_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("long"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: -9223372036854775807L"); + // S5_range_long_1.sc + // This is a variable range test: + // long + // CompilesOK: 1 + // Value: -9223372036854775807L Variables_TestClass_S5_range_long_1.testMethod(); } [TestMethod] public void Variables_S5_range_long_3_Test() { - OutputHelper.WriteLine("S5_range_long_3.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("long"); - OutputHelper.WriteLine(" CompilesOK: 0"); - OutputHelper.WriteLine(" Value: -9223372036854775808L"); + // S5_range_long_3.sc + // This is a variable range test: + // long + // CompilesOK: 0 + // Value: -9223372036854775808L Variables_TestClass_S5_range_long_3.testMethod(); } [TestMethod] public void Variables_S5_range_short_0_Test() { - OutputHelper.WriteLine("S5_range_short_0.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("short"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: 32767S"); + // S5_range_short_0.sc + // This is a variable range test: + // short + // CompilesOK: 1 + // Value: 32767S Variables_TestClass_S5_range_short_0.testMethod(); } [TestMethod] public void Variables_S5_range_short_1_Test() { - OutputHelper.WriteLine("S5_range_short_1.sc"); - OutputHelper.WriteLine("This is a variable range test:"); - OutputHelper.WriteLine("short"); - OutputHelper.WriteLine(" CompilesOK: 1"); - OutputHelper.WriteLine(" Value: -32767S"); + // S5_range_short_1.sc + // This is a variable range test: + // short + // CompilesOK: 1 + // Value: -32767S Variables_TestClass_S5_range_short_1.testMethod(); } @@ -195,7 +195,7 @@ public void Variables_S5_range_short_1_Test() public static void Variables_EqualTest_00() { { - OutputHelper.WriteLine("Test Equal with int32 variables"); + // Test Equal with int32 variables int one = 1; int two = -2; @@ -209,7 +209,7 @@ public static void Variables_EqualTest_00() } { - OutputHelper.WriteLine("Test Equal with uint32 variables"); + // Test Equal with uint32 variables uint one = 1; uint two = 2; @@ -223,7 +223,7 @@ public static void Variables_EqualTest_00() } { - OutputHelper.WriteLine("Test Equal with float variables"); + // Test Equal with float variables float one = 1.0011223f; float two = -2.445588f; @@ -237,7 +237,7 @@ public static void Variables_EqualTest_00() } { - OutputHelper.WriteLine("Test Equal with double variables"); + // Test Equal with double variables double one = 1.4444; double two = -2.8888; diff --git a/Tests/TestFramework/TestFramework.nfproj b/Tests/TestFramework/TestFramework.nfproj index 798bafed..22b7869c 100644 --- a/Tests/TestFramework/TestFramework.nfproj +++ b/Tests/TestFramework/TestFramework.nfproj @@ -30,10 +30,15 @@ - + + + + + + diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index 085b3d4f..fb7f57a9 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit 085b3d4f3225ea8d53f90189c6cfbbecac2b7653 +Subproject commit fb7f57a9cc20dd0fa46645b8f3c45c9d68ce6fa2 From f468ea67c5bf64561849174d341cc12f58ff3b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 20 Sep 2024 15:27:39 +0100 Subject: [PATCH 25/70] Enable destructor and finalizer tests (#215) --- .../UnitTestDestructorTests.cs | 202 +++++++----- Tests/NFUnitTestSystemLib/UnitTestGCTest.cs | 303 ++++++++++-------- .../NFUnitTest_DummyAdapter/nano.runsettings | 2 +- 3 files changed, 291 insertions(+), 216 deletions(-) diff --git a/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs b/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs index 97d94e48..7b7bcb11 100644 --- a/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs @@ -6,8 +6,6 @@ using nanoFramework.TestFramework; using System; -using System.Diagnostics; -using System.Reflection; namespace NFUnitTestClasses { @@ -15,92 +13,102 @@ namespace NFUnitTestClasses class UnitTestDestructorTests { // Removing as using something out of mscorlib - //[TestMethod] - //public void Destructors3_Test() - //{ - // //Ported from Destructors3.cs - // // Section 10.11 - // // Destructors implement the actions required to - // // destruct the instances of a class. - // // - // // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs - // Assert.IsTrue(DestructorsTestClass3.testMethod()); - //} - - //[TestMethod] - //public void Destructors4_Test() - //{ - // //Ported from Destructors4.cs - // // Section 10.11 - // // Destructors implement the actions required to - // // destruct the instances of a class. - // // - // // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs - // Assert.IsTrue(DestructorsTestClass4.testMethod()); - //} - - // Removed as using a class out of mscorlib - //[TestMethod] - //public void Destructors7_Test() - //{ - // //Ported from Destructors7.cs - // // Section 10.12 - // // Destructors are not inherited. Thus, a class - // // has no other destructors than those that are - // // actually declared in the class. - // // - // // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs - // Assert.IsTrue(DestructorsTestClass7.testMethod()); - //} - - //class DestructorsTestClass3 - //{ - - // static int intI = 1; - - // ~DestructorsTestClass3() - // { - // // Calling Destructor for Test Class 3 - // intI = 2; - // } - - // public static bool testMethod() - // { - // DestructorsTestClass3 mc = new DestructorsTestClass3(); - // mc = null; - // nanoFramework.Runtime.Native.GC.Run(true); - // int sleepTime = 5000; - // int slept = 0; - // while (intI != 2 && slept < sleepTime) - // { - // System.Threading.Thread.Sleep(10); - // slept += 10; - // } - // // Thread has slept for - // OutputHelper.WriteLine(slept.ToString()); - // if (intI == 2) - // { - // return true; - // } - // else - // { - // return false; - // } - // } - //} - - - class DestructorsTestClass4_Base + [TestMethod] + public void Destructors3_Test() + { + //Ported from Destructors3.cs + // Section 10.11 + // Destructors implement the actions required to + // destruct the instances of a class. + // + // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs + Assert.IsTrue(DestructorsTestClass3.TestMethod()); + } + + [TestMethod] + public void Destructors4_Test() + { + //Ported from Destructors4.cs + // Section 10.11 + // Destructors implement the actions required to + // destruct the instances of a class. + // + // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs + Assert.IsTrue(DestructorsTestClass4.TestMethod()); + } + + [TestMethod] + public void Destructors7_Test() + { + //Ported from Destructors7.cs + // Section 10.12 + // Destructors are not inherited. Thus, a class + // has no other destructors than those that are + // actually declared in the class. + // + // Note: This test may fail due to lengthy garbage collection, look for Destructor messages in later logs + Assert.IsTrue(DestructorsTestClass7.TestMethod()); + } + + public class DestructorsTestClass3 + { + static int intI = 1; + + ~DestructorsTestClass3() + { + // Calling Destructor for Test Class 3 + intI = 2; + + Console.WriteLine("Calling Destructor for Test Class 3"); + } + + public static bool TestMethod() + { + DestructorsTestClass3 mc = new DestructorsTestClass3(); + mc = null; + + // the following call has been "replaced" with the setting commanding a GC run before new allocations, which will have the desired effect of + // nanoFramework.Runtime.Native.GC.Run(true); + + int sleepTime = 5000; + int slept = 0; + + while (intI != 2 && slept < sleepTime) + { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + + System.Threading.Thread.Sleep(10); + slept += 10; + } + + // Thread has slept for + OutputHelper.WriteLine($"Thread as slept for{slept}"); + + if (intI == 2) + { + return true; + } + else + { + return false; + } + } + } + + public class DestructorsTestClass4_Base { public static int intI = 2; ~DestructorsTestClass4_Base() { - intI = intI * 2; // Calling Destructor for Test Class 4 Base + intI = intI * 2; + + Console.WriteLine("Calling Destructor for Test Class 4 Base"); } } - class DestructorsTestClass4 : DestructorsTestClass4_Base + public class DestructorsTestClass4 : DestructorsTestClass4_Base { ~DestructorsTestClass4() @@ -109,20 +117,29 @@ class DestructorsTestClass4 : DestructorsTestClass4_Base // Calling Destructor for Test Class 4 } - public static bool testMethod() + public static bool TestMethod() { DestructorsTestClass4 mc = new DestructorsTestClass4(); mc = null; + + // the following call has been "replaced" with the setting commanding a GC run before new allocations, which will have the desired effect of // nanoFramework.Runtime.Native.GC.Run(true); + int sleepTime = 5000; int slept = 0; + while (intI != 8 && slept < sleepTime) { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + System.Threading.Thread.Sleep(10); slept += 10; } + // Thread has slept for - OutputHelper.WriteLine(slept.ToString()); + OutputHelper.WriteLine($"Thread as slept for{slept}"); + if (intI == 8) { return true; @@ -134,34 +151,45 @@ public static bool testMethod() } } - class DestructorsTestClass7_Base + public class DestructorsTestClass7_Base { public static int intI = 2; } - class DestructorsTestClass7 : DestructorsTestClass7_Base + public class DestructorsTestClass7 : DestructorsTestClass7_Base { ~DestructorsTestClass7() { - intI = 3; // Calling Destructor for Test Class 7 + intI = 3; + + Console.WriteLine("Calling Destructor for Test Class 7"); } - public static bool testMethod() + public static bool TestMethod() { DestructorsTestClass7 mc = new DestructorsTestClass7(); mc = null; + + // the following call has been "replaced" with the setting commanding a GC run before new allocations, which will have the desired effect of //nanoFramework.Runtime.Native.GC.Run(true); + int sleepTime = 5000; int slept = 0; + while (intI != 3 && slept < sleepTime) { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + System.Threading.Thread.Sleep(10); slept += 10; } + // Thread has slept for - OutputHelper.WriteLine(slept.ToString()); + OutputHelper.WriteLine($"Thread as slept for{slept}"); + if (intI == 3) { return true; diff --git a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs index 1f017a38..18358d7e 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs @@ -6,20 +6,19 @@ using nanoFramework.TestFramework; using System; -using System.Diagnostics; namespace NFUnitTestSystemLib { [TestClass] - class UnitTestGCTest + public class UnitTestGCTest { - class FinalizeObject + internal class FinalizeObject { public static FinalizeObject m_currentInstance = null; ~FinalizeObject() { - if (m_hasFinalized1 == false) + if (!m_hasFinalized1) { // First finalization @@ -46,130 +45,178 @@ class FinalizeObject static bool m_hasFinalized2 = false; static bool m_Test1Result = false; - //[TestMethod] - //public void SystemGC1_Test() - //{ - // /// - // /// 1. Create a FinalizeObject. - // /// 2. Release the reference - // /// 3. Allow for GC - // /// 4. Run ReRegisterForFinalize - // /// 5. Allow for GC - // /// 6. Verify that object has been collected - // /// - // /// - // // Tests ReRegisterForFinalize - // // Create a FinalizeObject. - // FinalizeObject mfo = new FinalizeObject(); - // m_hasFinalized1 = false; - // m_hasFinalized2 = false; - - // // Release reference - // mfo = null; - - // // Allow GC - // GC.WaitForPendingFinalizers(); - // int sleepTime = 1000; - // int slept = 0; - // while (m_hasFinalized1 == false && slept < sleepTime) - // { - // System.Threading.Thread.Sleep(10); - // slept += 10; - // } - // OutputHelper.WriteLine("GC took " + slept); - - // // At this point mfo will have gone through the first Finalize. - // // There should now be a reference to mfo in the static - // // FinalizeObject.m_currentInstance field. Setting this value - // // to null and forcing another garbage collection will now - // // cause the object to Finalize permanently. - // // Reregister and allow for GC - // FinalizeObject.m_currentInstance = null; - // GC.WaitForPendingFinalizers(); - // sleepTime = 1000; - // slept = 0; - // while (m_hasFinalized2 == false && slept < sleepTime) - // { - // System.Threading.Thread.Sleep(10); - // slept += 10; - // } - // OutputHelper.WriteLine("GC took " + slept); - - // m_Test1Result = m_hasFinalized2; - // Assert.IsTrue(m_hasFinalized2); - //} - - //[TestMethod] - //public void SystemGC2_Test() - //{ - // /// - // /// 1. Create a FinalizeObject. - // /// 2. Release the reference - // /// 3. SupressFinalize - // /// 3. Allow for GC - // /// 6. Verify that object has not been collected - // /// - // /// - // // Tests SuppressFinalize - // // Create a FinalizeObject. - // FinalizeObject mfo = new FinalizeObject(); - // m_hasFinalized1 = false; - // m_hasFinalized2 = false; - - // // Releasing - // System.GC.SuppressFinalize(mfo); - // mfo = null; - - // // Allow GC - // GC.WaitForPendingFinalizers(); - // int sleepTime = 1000; - // int slept = 0; - // while (m_hasFinalized1 == false && slept < sleepTime) - // { - // System.Threading.Thread.Sleep(10); - // slept += 10; - // } - // OutputHelper.WriteLine("GC took " + slept); - - // Assert.IsFalse(m_hasFinalized1); - //} - - //[TestMethod] - //public void SystemGC3_Test() - //{ - // /// - // /// 1. Create a FinalizeObject. - // /// 2. Release the reference - // /// 3. SupressFinalize - // /// 3. Allow for GC - // /// 6. Verify that object has not been collected - // /// - // /// - // // Tests WaitForPendingFinalizers, dependant on test 1 - // // will auto-fail if test 1 fails. - // Assert.IsTrue(m_Test1Result); - - // // Create a FinalizeObject. - // FinalizeObject mfo = new FinalizeObject(); - // m_hasFinalized1 = false; - // m_hasFinalized2 = false; - - // // Releasing - // mfo = null; - - // // Wait for GC - // GC.WaitForPendingFinalizers(); - // System.GC.WaitForPendingFinalizers(); - - // // Releasing again - // FinalizeObject.m_currentInstance = null; - - // // Wait for GC - // GC.WaitForPendingFinalizers(); - // System.GC.WaitForPendingFinalizers(); - - // Assert.IsTrue(m_hasFinalized2); - //} + [TestMethod] + public void SystemGC1_Test() + { + /// + /// 1. Create a FinalizeObject. + /// 2. Release the reference + /// 3. Allow for GC + /// 4. Run ReRegisterForFinalize + /// 5. Allow for GC + /// 6. Verify that object has been collected + /// + /// + // Tests ReRegisterForFinalize + // Create a FinalizeObject. + FinalizeObject mfo = new FinalizeObject(); + m_hasFinalized1 = false; + m_hasFinalized2 = false; + + // Release reference + mfo = null; + + // Allow GC + GC.WaitForPendingFinalizers(); + + int sleepTime = 1000; + int slept = 0; + + while (!m_hasFinalized1 && slept < sleepTime) + { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + + System.Threading.Thread.Sleep(10); + slept += 10; + } + + OutputHelper.WriteLine($"GC took {slept}"); + + // At this point mfo will have gone through the first Finalize. + // There should now be a reference to mfo in the static + // FinalizeObject.m_currentInstance field. Setting this value + // to null and forcing another garbage collection will now + // cause the object to Finalize permanently. + // Reregister and allow for GC + FinalizeObject.m_currentInstance = null; + + GC.WaitForPendingFinalizers(); + + sleepTime = 1000; + slept = 0; + + while (!m_hasFinalized2 && slept < sleepTime) + { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + + System.Threading.Thread.Sleep(10); + slept += 10; + } + + OutputHelper.WriteLine($"GC took {slept}"); + + m_Test1Result = m_hasFinalized2; + Assert.IsTrue(m_hasFinalized2); + } + + [TestMethod] + public void SystemGC2_Test() + { + /// + /// 1. Create a FinalizeObject. + /// 2. Release the reference + /// 3. SupressFinalize + /// 3. Allow for GC + /// 6. Verify that object has not been collected + /// + /// + // Tests SuppressFinalize + // Create a FinalizeObject. + FinalizeObject mfo = new FinalizeObject(); + m_hasFinalized1 = false; + m_hasFinalized2 = false; + + // Releasing + GC.SuppressFinalize(mfo); + mfo = null; + + // Allow GC + GC.WaitForPendingFinalizers(); + + int sleepTime = 1000; + int slept = 0; + + while (!m_hasFinalized1 && slept < sleepTime) + { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + + System.Threading.Thread.Sleep(10); + slept += 10; + } + OutputHelper.WriteLine($"GC took {slept}"); + + Assert.IsFalse(m_hasFinalized1); + } + + [TestMethod] + public void SystemGC3_Test() + { + /// + /// 1. Create a FinalizeObject. + /// 2. Release the reference + /// 3. SupressFinalize + /// 3. Allow for GC + /// 6. Verify that object has not been collected + /// + /// + + // Tests WaitForPendingFinalizers, dependant on test 1 + // will auto-fail if test 1 fails. + OutputHelper.Write("Tests WaitForPendingFinalizers, dependant on test 1"); + OutputHelper.WriteLine("will auto-fail if test 1 fails."); + + Assert.IsTrue(m_Test1Result); + + // Create a FinalizeObject. + FinalizeObject mfo = new FinalizeObject(); + m_hasFinalized1 = false; + m_hasFinalized2 = false; + + // Releasing + mfo = null; + + int sleepTime = 1000; + int slept = 0; + + while (!m_hasFinalized1 && slept < sleepTime) + { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + + System.Threading.Thread.Sleep(10); + slept += 10; + } + + OutputHelper.WriteLine($"GC took {slept}"); + + // Wait for GC + GC.WaitForPendingFinalizers(); + + // Releasing again + FinalizeObject.m_currentInstance = null; + + sleepTime = 1000; + slept = 0; + + while (!m_hasFinalized2 && slept < sleepTime) + { + // force GC run caused by memory allocation + var dummyArray = new byte[1024 * 1024 * 1]; + + System.Threading.Thread.Sleep(10); + slept += 10; + } + + OutputHelper.WriteLine($"GC took {slept}"); + + // Wait for GC + GC.WaitForPendingFinalizers(); + + Assert.IsTrue(m_hasFinalized2); + } } } diff --git a/Tests/NFUnitTest_DummyAdapter/nano.runsettings b/Tests/NFUnitTest_DummyAdapter/nano.runsettings index 4e854cb2..3d17b679 100644 --- a/Tests/NFUnitTest_DummyAdapter/nano.runsettings +++ b/Tests/NFUnitTest_DummyAdapter/nano.runsettings @@ -11,6 +11,6 @@ Verbose False - E:\GitHub\nf-interpreter\build\bin\Debug\nanoFramework.nanoCLR.dll + --forcegc \ No newline at end of file From b5ce9798e268e44a8e051e9454cf017d1fd5edd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 3 Oct 2024 20:35:27 +0100 Subject: [PATCH 26/70] Fixed order of parameters in several Unit Tests (#216) ***NO_CI*** --- Tests/NFUnitTestArithmetic/UnitTestFormat.cs | 2 +- Tests/NFUnitTestSystemLib/UnitTestDateTime.cs | 6 +++--- Tests/NFUnitTestSystemLib/UnitTestParseTests.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/NFUnitTestArithmetic/UnitTestFormat.cs b/Tests/NFUnitTestArithmetic/UnitTestFormat.cs index 8e2b9af7..097ed2fe 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestFormat.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestFormat.cs @@ -468,7 +468,7 @@ private void CheckValue(object value, string valueStr, string formatString, stri } else { - Assert.AreEqual(result, expectedResult, $"The expected result for '{formatString}' on value {valueStr} for type {value.GetType().Name} is '{expectedResult}'"); + Assert.AreEqual(expectedResult, result, $"The expected result for '{formatString}' on value {valueStr} for type {value.GetType().Name} is '{expectedResult}'"); } if (rowData != null) diff --git a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs index df12f3bc..cfabe632 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs @@ -2303,7 +2303,7 @@ public void DateTime_ParseTest00() Assert.AreEqual(DateTime.Parse(dtOutput1).ToString(specifier1), dt.ToString(specifier1), $"DateTime.Parse '{dt}' failed"); Assert.IsTrue(DateTime.TryParse(dtOutput1, out DateTime result), $"DateTime.TryParse '{dt}' failed"); - Assert.AreEqual(result.ToString(specifier1), dt.ToString(specifier1), $"DateTime.TryParse '{dt}' returning wrong value: '{result}'"); + Assert.AreEqual(dt.ToString(specifier1), result.ToString(specifier1), $"DateTime.TryParse '{dt}' returning wrong value: '{result}'"); } } @@ -2324,7 +2324,7 @@ public void DateTime_ParseTest01() Assert.AreEqual(DateTime.Parse(dtOutput1).ToString(specifier1), dt.ToString(specifier1), $"Parsing DateTime '{dt}' failed"); Assert.IsTrue(DateTime.TryParse(dtOutput1, out DateTime result), $"DateTime.TryParse '{dt}' failed"); - Assert.AreEqual(result.ToString(specifier1), dt.ToString(specifier1), $"DateTime.TryParse '{dt}' returning wrong value: '{result}'"); + Assert.AreEqual(dt.ToString(specifier1), result.ToString(specifier1), $"DateTime.TryParse '{dt}' returning wrong value: '{result}'"); } } @@ -2345,7 +2345,7 @@ public void DateTime_ParseTest02() Assert.AreEqual(DateTime.Parse(dtOutput1).ToString(specifier1), dt.ToString(specifier1), $"Parsing DateTime '{dt}' failed"); Assert.IsTrue(DateTime.TryParse(dtOutput1, out DateTime result), $"DateTime.TryParse '{dt}' failed"); - Assert.AreEqual(result.ToString(specifier1), dt.ToString(specifier1), $"DateTime.TryParse '{dt}' returning wrong value: '{result}'"); + Assert.AreEqual(dt.ToString(specifier1), result.ToString(specifier1), $"DateTime.TryParse '{dt}' returning wrong value: '{result}'"); } } diff --git a/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs b/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs index c7968b5d..42742206 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs @@ -346,7 +346,7 @@ public void ParseUInt64_Test_8() Assert.AreEqual(_uInt64[i], result); result = ulong.Parse(strArr[i]); - Assert.AreEqual(result, _uInt64[i]); + Assert.AreEqual(_uInt64[i], result); } //Int32: -2147483648 --> 2147483647 From cb42176f9d301e4b8da509831dcbcfb2194314d7 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Wed, 23 Oct 2024 14:45:31 +0100 Subject: [PATCH 27/70] Code style fixes ***NO_CI*** --- Tests/NFUnitTestSystemLib/UnitTestStringTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs index 5a79db2d..12a01561 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs @@ -469,7 +469,7 @@ public void MakeSureNoContainsChecksGoOutOfRange_StringComparison() { Assert.IsTrue(s1.Contains(s2)); } - catch(ArgumentOutOfRangeException) + catch (ArgumentOutOfRangeException) { // this is the intended outcome at some point Assert.IsTrue(true); @@ -767,7 +767,6 @@ public static void EndsWith_NullInStrings() public static void ZeroLengthEndsWith_Char() { // Test of EndsWith with chars - var a = new char[3]; string s1 = new string(a); From 1c9e00bbdeaa6f2371491b1b1fa74854eaa0939d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 23 Oct 2024 22:50:25 +0100 Subject: [PATCH 28/70] Add `String.Concat` tests (#217) ***NO_CI*** --- .../UnitTestStringTests.cs | 141 +++++++++++++++++- 1 file changed, 140 insertions(+), 1 deletion(-) diff --git a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs index 12a01561..1c9a3e12 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs @@ -1041,6 +1041,146 @@ public void LastIndexOf_should_return_negative_one_if_value_is_not_found() Assert.AreEqual(-1, source.LastIndexOf(".", 1, 2), "Case 6"); } + [TestMethod] + public void Concat_should_work_with_nulls() + { + const string baseContent = "Hello"; + string[] dispOut = new string[4]; + dispOut[0] = baseContent; + + string test = string.Concat(dispOut); + + Console.WriteLine(test); + + Assert.AreSame(baseContent, test); + } + + [TestMethod] + public void Concat_Should_Concatenate_Two_Strings() + { + // Arrange + string str1 = "Hello"; + string str2 = "World"; + + // Act + string result = string.Concat(str1, str2); + + // Assert + Assert.AreEqual("HelloWorld", result); + } + + [TestMethod] + public void Concat_Should_Concatenate_Multiple_Strings() + { + // Arrange + string str1 = "Hello"; + string str2 = " "; + string str3 = "World"; + string str4 = "!"; + + // Act + string result = string.Concat(str1, str2, str3, str4); + + // Assert + Assert.AreEqual("Hello World!", result); + } + + [TestMethod] + public void Concat_Should_Handle_Null_Strings() + { + // Arrange + string str1 = null; + string str2 = "World"; + + // Act + string result = string.Concat(str1, str2); + + // Assert + Assert.AreEqual("World", result); + } + + [TestMethod] + public void Concat_Should_Handle_Empty_Strings() + { + // Arrange + string str1 = ""; + string str2 = "World"; + + // Act + string result = string.Concat(str1, str2); + + // Assert + Assert.AreEqual("World", result); + } + + [TestMethod] + public void Concat_Should_Handle_Null_And_Empty_Strings() + { + // Arrange + string str1 = null; + string str2 = ""; + string str3 = "Hello"; + string str4 = null; + + // Act + string result = string.Concat(str1, str2, str3, str4); + + // Assert + Assert.AreEqual("Hello", result); + } + + [TestMethod] + public void Concat_Should_Concatenate_String_Array() + { + // Arrange + string[] strings = { "Hello", " ", "World", "!" }; + + // Act + string result = string.Concat(strings); + + // Assert + Assert.AreEqual("Hello World!", result); + } + + [TestMethod] + public void Concat_Should_Handle_Null_Elements_In_Array() + { + // Arrange + string[] strings = { "Hello", null, "World", "!" }; + + // Act + string result = string.Concat(strings); + + // Assert + Assert.AreEqual("HelloWorld!", result); + } + + [TestMethod] + public void Concat_Should_Handle_Empty_Elements_In_Array() + { + // Arrange + string[] strings = { "Hello", "", "World", "!" }; + + // Act + string result = string.Concat(strings); + + // Assert + Assert.AreEqual("HelloWorld!", result); + } + + [TestMethod] + public void Concat_Should_Handle_Null_And_Empty_Elements_In_Array() + { + // Arrange + string[] strings = { null, "", "Hello", null, "", "World", "!" }; + + // Act + string result = string.Concat(strings); + + // Assert + Assert.AreEqual("HelloWorld!", result); + } + /// /// A class whose ToString method return null /// @@ -1053,4 +1193,3 @@ public override string ToString() } } } - From 136e65d5fd9e15dc8ca83d928cb9ee883faf8497 Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Fri, 17 Jan 2025 01:33:33 -0800 Subject: [PATCH 29/70] Improve attribute constructor handling when calling `Type.GetCustomAttributes()` (#218) ***NO_CI*** (cherry picked from commit f1afac02b72f9eb1e80adfa8c0d32c23260dfc88) --- .../NFUnitTestAttributes/ConstructorTests.cs | 383 ++++++++++++++++++ .../NFUnitTestAttributes.nfproj | 1 + .../Reflection/CustomAttributesHelpers.cs | 120 ++++-- 3 files changed, 459 insertions(+), 45 deletions(-) create mode 100644 Tests/NFUnitTestAttributes/ConstructorTests.cs diff --git a/Tests/NFUnitTestAttributes/ConstructorTests.cs b/Tests/NFUnitTestAttributes/ConstructorTests.cs new file mode 100644 index 00000000..949dd635 --- /dev/null +++ b/Tests/NFUnitTestAttributes/ConstructorTests.cs @@ -0,0 +1,383 @@ +using System; +using nanoFramework.TestFramework; +// ReSharper disable InconsistentNaming + +// Enabling nullable here tests the use case where the compiler adds an attribute the isn't implemented in nanoFramework +// This is currently System.Runtime.CompilerServices.NullableContextAttribute +#nullable enable +namespace NFUnitTestAttributes +{ + public class ConstructorTests + { + public const int ExpectedIntParameter = 69_420; + public const string ExpectedStringParameter = "A string parameter"; + + private static void AssertArrayConstructorIsCalled(object[] attributes) + { + Assert.IsNotNull(attributes); + Assert.AreEqual(1, attributes.Length); + Assert.IsInstanceOfType(attributes[0], typeof(SingleParameterConstructorTestAttribute)); + + var testAttribute = (SingleParameterConstructorTestAttribute)attributes[0]; + + Assert.IsTrue(testAttribute.ConstructorCalled); + Assert.AreEqual(ExpectedIntParameter, testAttribute.IntProperty); + Assert.AreEqual(ExpectedStringParameter, testAttribute.StringProperty); + } + + private static void AssertDefaultConstructorIsCalled(object[] attributes) + { + Assert.IsNotNull(attributes); + Assert.AreEqual(1, attributes.Length); + Assert.IsInstanceOfType(attributes[0], typeof(DefaultConstructorTestAttribute)); + + var testAttribute = (DefaultConstructorTestAttribute)attributes[0]; + + Assert.AreEqual(ExpectedIntParameter, testAttribute.IntProperty); + Assert.AreEqual(ExpectedStringParameter, testAttribute.StringProperty); + } + + private static void AssertMultiParameterConstructorIsCalled(object[] attributes) + { + Assert.IsNotNull(attributes); + Assert.AreEqual(1, attributes.Length); + Assert.IsInstanceOfType(attributes[0], typeof(MultiParameterConstructorTestAttribute)); + + var testAttribute = (MultiParameterConstructorTestAttribute)attributes[0]; + + Assert.IsTrue(testAttribute.ConstructorCalled); + Assert.AreEqual(ExpectedIntParameter, testAttribute.IntProperty); + Assert.AreEqual(ExpectedStringParameter, testAttribute.StringProperty); + } + + private static void AssertSingleParameterConstructorIsCalledWithIntValue(object[] attributes) + { + Assert.IsNotNull(attributes); + Assert.AreEqual(1, attributes.Length); + Assert.IsInstanceOfType(attributes[0], typeof(SingleParameterConstructorTestAttribute)); + + var testAttribute = (SingleParameterConstructorTestAttribute)attributes[0]; + + Assert.IsTrue(testAttribute.ConstructorCalled); + Assert.AreEqual(ExpectedIntParameter, testAttribute.IntProperty); + Assert.IsNull(testAttribute.StringProperty); + } + + private static void AssertSingleParameterConstructorIsCalledWithStringValue(object[] attributes) + { + Assert.IsNotNull(attributes); + Assert.AreEqual(1, attributes.Length); + Assert.IsInstanceOfType(attributes[0], typeof(SingleParameterConstructorTestAttribute)); + + var testAttribute = (SingleParameterConstructorTestAttribute)attributes[0]; + + Assert.IsTrue(testAttribute.ConstructorCalled); + Assert.AreEqual(0, testAttribute.IntProperty); + Assert.AreEqual(ExpectedStringParameter, testAttribute.StringProperty); + } + + private static void AssertZeroParameterConstructorIsCalled(object[] attributes) + { + Assert.IsNotNull(attributes); + Assert.AreEqual(1, attributes.Length); + Assert.IsInstanceOfType(attributes[0], typeof(SingleParameterConstructorTestAttribute)); + + var testAttribute = (SingleParameterConstructorTestAttribute)attributes[0]; + + Assert.IsTrue(testAttribute.ConstructorCalled); + Assert.AreEqual(0, testAttribute.IntProperty); + Assert.IsNull(testAttribute.StringProperty); + } + + [TestClass] + public class When_Attribute_is_on_a_class: ConstructorTests + { + private static object[] GetAttributes(Type testCases) + { + return testCases.GetCustomAttributes(true); + } + + [TestMethod] + public void Default_constructor_is_called() + { + AssertDefaultConstructorIsCalled(GetAttributes(typeof(DefaultConstructorTestCases))); + } + + [TestMethod] + public void Multi_parameter_constructor_is_called_with_array_value() + { + AssertMultiParameterConstructorIsCalled(GetAttributes(typeof(MultiParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_array_value() + { + AssertArrayConstructorIsCalled(GetAttributes(typeof(ArrayParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_int_value() + { + AssertSingleParameterConstructorIsCalledWithIntValue(GetAttributes(typeof(IntParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_string_value() + { + AssertSingleParameterConstructorIsCalledWithStringValue(GetAttributes(typeof(StringParameterConstructorTestCases))); + } + + [TestMethod] + public void Zero_parameter_constructor_is_called() + { + AssertZeroParameterConstructorIsCalled(GetAttributes(typeof(ZeroParameterConstructorTestCases))); + } + } + + [TestClass] + public class When_Attribute_is_on_a_field : ConstructorTests + { + private static object[] GetAttributes(Type testCases) + { + return testCases.GetField("TestField")!.GetCustomAttributes(true); + } + + [TestMethod] + public void Default_constructor_is_called() + { + AssertDefaultConstructorIsCalled(GetAttributes(typeof(DefaultConstructorTestCases))); + } + + [TestMethod] + public void Multi_parameter_constructor_is_called_with_array_value() + { + AssertMultiParameterConstructorIsCalled(GetAttributes(typeof(MultiParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_array_value() + { + AssertArrayConstructorIsCalled(GetAttributes(typeof(ArrayParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_int_value() + { + AssertSingleParameterConstructorIsCalledWithIntValue(GetAttributes(typeof(IntParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_string_value() + { + AssertSingleParameterConstructorIsCalledWithStringValue(GetAttributes(typeof(StringParameterConstructorTestCases))); + } + + [TestMethod] + public void Zero_parameter_constructor_is_called() + { + AssertZeroParameterConstructorIsCalled(GetAttributes(typeof(ZeroParameterConstructorTestCases))); + } + } + + [TestClass] + public class When_Attribute_is_on_a_method : ConstructorTests + { + private static object[] GetAttributes(Type testCases) + { + return testCases.GetMethod("TestMethod")!.GetCustomAttributes(true); + } + + [TestMethod] + public void Default_constructor_is_called() + { + AssertDefaultConstructorIsCalled(GetAttributes(typeof(DefaultConstructorTestCases))); + } + + [TestMethod] + public void Multi_parameter_constructor_is_called_with_array_value() + { + AssertMultiParameterConstructorIsCalled(GetAttributes(typeof(MultiParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_array_value() + { + AssertArrayConstructorIsCalled(GetAttributes(typeof(ArrayParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_int_value() + { + AssertSingleParameterConstructorIsCalledWithIntValue(GetAttributes(typeof(IntParameterConstructorTestCases))); + } + + [TestMethod] + public void Single_parameter_constructor_is_called_with_string_value() + { + AssertSingleParameterConstructorIsCalledWithStringValue(GetAttributes(typeof(StringParameterConstructorTestCases))); + } + + [TestMethod] + public void Zero_parameter_constructor_is_called() + { + AssertZeroParameterConstructorIsCalled(GetAttributes(typeof(ZeroParameterConstructorTestCases))); + } + } + } + + #region Test Attributes + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = true)] + public class DefaultConstructorTestAttribute : Attribute + { + public int IntProperty { get; set; } = ConstructorTests.ExpectedIntParameter; + public string StringProperty { get; set; } = ConstructorTests.ExpectedStringParameter; + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = true)] + public class MultiParameterConstructorTestAttribute : Attribute + { + public MultiParameterConstructorTestAttribute() + { + + } + + public MultiParameterConstructorTestAttribute(int intValue, string stringValue) + { + ConstructorCalled = true; + IntProperty = intValue; + StringProperty = stringValue; + } + + public bool ConstructorCalled { get; } + + public int IntProperty { get; set; } + + public string? StringProperty { get; set; } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = true)] + public class SingleParameterConstructorTestAttribute: Attribute + { + public SingleParameterConstructorTestAttribute() + { + ConstructorCalled = true; + } + + public SingleParameterConstructorTestAttribute(int value) + { + ConstructorCalled = true; + IntProperty = value; + } + + public SingleParameterConstructorTestAttribute(string parameter) + { + ConstructorCalled = true; + StringProperty = parameter; + } + + public SingleParameterConstructorTestAttribute(params object[] parameters) + { + ConstructorCalled = true; + + foreach (var parameter in parameters) + { + switch (parameter) + { + case int intParameter: + IntProperty = intParameter; + break; + case string stringParameter: + StringProperty = stringParameter; + break; + } + } + } + + public bool ConstructorCalled { get; } + + public int IntProperty { get; set; } + + public string? StringProperty { get; set; } + } + #endregion + + #region Test Cases + [SingleParameterConstructorTest(ConstructorTests.ExpectedIntParameter, ConstructorTests.ExpectedStringParameter)] + public class ArrayParameterConstructorTestCases + { + [SingleParameterConstructorTest(ConstructorTests.ExpectedIntParameter, ConstructorTests.ExpectedStringParameter)] + public object? TestField; + + [SingleParameterConstructorTest(ConstructorTests.ExpectedIntParameter, ConstructorTests.ExpectedStringParameter)] + public void TestMethod(string? value = null) + { + + } + } + + [DefaultConstructorTest] + public class DefaultConstructorTestCases + { + [DefaultConstructorTest] + public object? TestField; + + [DefaultConstructorTest] + public void TestMethod(string? value = null) + { + + } + } + + [SingleParameterConstructorTest(ConstructorTests.ExpectedIntParameter)] + public class IntParameterConstructorTestCases + { + [SingleParameterConstructorTest(ConstructorTests.ExpectedIntParameter)] + public object? TestField; + + [SingleParameterConstructorTest(ConstructorTests.ExpectedIntParameter)] + public void TestMethod(string? value = null) + { + + } + } + + [MultiParameterConstructorTest(ConstructorTests.ExpectedIntParameter, ConstructorTests.ExpectedStringParameter)] + public class MultiParameterConstructorTestCases + { + [MultiParameterConstructorTest(ConstructorTests.ExpectedIntParameter, ConstructorTests.ExpectedStringParameter)] + public object? TestField; + + [MultiParameterConstructorTest(ConstructorTests.ExpectedIntParameter, ConstructorTests.ExpectedStringParameter)] + public void TestMethod(string? value = null) + { + + } + } + + [SingleParameterConstructorTest(ConstructorTests.ExpectedStringParameter)] + public class StringParameterConstructorTestCases + { + [SingleParameterConstructorTest(ConstructorTests.ExpectedStringParameter)] + public object? TestField; + + [SingleParameterConstructorTest(ConstructorTests.ExpectedStringParameter)] + public void TestMethod(string? value = null) + { + + } + } + + [SingleParameterConstructorTest] + public class ZeroParameterConstructorTestCases + { + [SingleParameterConstructorTest] + public object? TestField; + + [SingleParameterConstructorTest] + public void TestMethod(string? value = null) + { + + } + } + #endregion +} diff --git a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj index 94b39570..c450a9a8 100644 --- a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj +++ b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj @@ -24,6 +24,7 @@ + diff --git a/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs b/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs index 9a82b316..174bca35 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs @@ -3,74 +3,104 @@ // See LICENSE file in the project root for full license information. // +using System.Collections; +using System.Diagnostics; + +// ReSharper disable SuggestVarOrType_Elsewhere +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes namespace System.Reflection { internal class CustomAttributesHelpers { - public static object[] GetCustomAttributesInternal(object[] rawAttributes) + /// + /// Creates an array of from a set of attribute definitions. + /// + /// An array of attribute definitions returned from a call to GetCustomAttributesNative. + /// An array of s + /// + /// + /// The attribute definitions are "encoded" into an object array with two positions for each attribute. + /// + /// + /// + /// 1st position - The type of the
+ /// 2nd position - The constructor parameter(s) or null + ///
+ /// + /// + /// Current limitations:
+ ///
+ /// + /// + /// - The parameter(s) have to be a string or numeric type + /// - Properties and fields are not supported + /// + ///
+ public static object[] GetCustomAttributesInternal(object[] attributeDefinitions) { - // get the custom attributes data for the field - // these are returned "encoded" in an object array with 2 positions for each attribute - // 1st the attribute type - // 2nd the constructor parameter or null, if the attribute has no constructor - // - // current limitations: - // - works only for constructors with a single parameter - // - the parameter has to be a string or numeric type - // - // both limitations above can be relatively easily overcome by adding the appropriate code at the native handler + if (attributeDefinitions is null) + { + return new object[0]; + } - object[] attributes = new object[rawAttributes.Length / 2]; + ArrayList attributes = new ArrayList(); - for (int i = 0; i < rawAttributes.Length; i += 2) + for (var i = 0; i < attributeDefinitions.Length; i += 2) { - // peek next element to determine if it's null - if (rawAttributes[i + 1] == null) + Type objectType = attributeDefinitions[i].GetType(); + Type parameterType = attributeDefinitions[i + 1]?.GetType(); + + ConstructorInfo constructorInfo; + object[] constructorParameters = new object[0]; + + if (parameterType is null) { - // attribute without default constructor, just copy it - attributes[i / 2] = rawAttributes[i]; + // If the parameter type is null we'll use the parameterless constructor + constructorInfo = objectType.GetConstructor(new Type[0]); } - else + else if (parameterType.IsArray) { - // has default constructor, invoke it - - // get the types - Type objectType = rawAttributes[i].GetType(); - Type paramType = rawAttributes[i + 1].GetType(); - - // get constructor - ConstructorInfo ctor = objectType.GetConstructor(new Type[] { paramType }); + // Check for a constructor with a single parameter of the correct array type + constructorInfo = objectType.GetConstructor(new[] { parameterType }); + constructorParameters = new[] { attributeDefinitions[i + 1] }; - // get params - object[] ctorParams = new object[] { rawAttributes[i + 1] }; - - if (ctor is null) + if (constructorInfo is null) { - // give it another try, this time with an array of the parameters types - // rebuild params list - ctorParams = (object[])rawAttributes[i + 1]; + // Check for a constructor with multiple parameters of the correct types + constructorParameters = (object[])attributeDefinitions[i + 1]; - Type[] paramsTypes = new Type[ctorParams.Length]; + Type[] parameterTypes = new Type[constructorParameters.Length]; - for (int p = 0; p < ctorParams.Length; p++) + for (var p = 0; p < constructorParameters.Length; p++) { - paramsTypes[p] = ctorParams[p].GetType(); + parameterTypes[p] = constructorParameters[p].GetType(); } - ctor = objectType.GetConstructor(paramsTypes); - - if (ctor is null) - { - throw new InvalidOperationException(); - } + constructorInfo = objectType.GetConstructor(parameterTypes); } + } + else + { + // Get a constructor with a single parameter of the correct type + constructorInfo = objectType.GetConstructor(new[] { parameterType }); + constructorParameters = new[] { attributeDefinitions[i + 1] }; + } - // invoke constructor with the parameter - attributes[i / 2] = ctor.Invoke(ctorParams); + // If we found a constructor invoke it with the parameters + if (constructorInfo is not null) + { + attributes.Add(constructorInfo.Invoke(constructorParameters)); + } + else + { + // If a constructor was not found we're assuming it's a type that hasn't been implemented in nanoFramework + // eg: System.Runtime.CompilerServices.NullableContextAttribute + Debug.WriteLine($"Constructor for Attribute type not found: {attributeDefinitions[i]}"); } } - return attributes; + return (object[])attributes.ToArray(typeof(object)); } } } From 24e4ab8cafc12af5970666fff3b40364e870f93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 24 Jan 2025 10:58:32 +0000 Subject: [PATCH 30/70] Add gitattributes file ***NO_CI*** (cherry picked from commit 413b35e3a07e0244900da7f538b4eaa3b05b6446) --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..0c42f3cc --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=crlf From 1dc6dedf58af01bc7cec4e21452b36a220c65d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 24 Jan 2025 11:00:05 +0000 Subject: [PATCH 31/70] Normalize files ***NO_CI*** (cherry picked from commit 050af53e9a1cb50537af358066077bda4c93f4a5) --- .../NFUnitTestSystemLib/UnitTestParseTests.cs | 2672 ++++++++--------- 1 file changed, 1336 insertions(+), 1336 deletions(-) diff --git a/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs b/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs index 42742206..02d732b2 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs @@ -1,1336 +1,1336 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// - -using nanoFramework.TestFramework; -using System; -using System.Diagnostics; - -namespace NFUnitTestSystemLib -{ - [TestClass] - class UnitTestParseTests - { - private static int[] _intArr = new int[0]; - - public static string[] GetRandomStringArray(int max, bool signed) - { - Random random = new Random(); - - string[] arr1 = new string[] { - "0", - "-0", - "+0", - "00000 ", - " -00000", - " +00000 ", - " 0 ", - " -00000 ", - "+123", - " +123 ", - " +123", - "+123 ", - "56", - "62", - "100", - "22" - }; - - string[] arr2 = new string[arr1.Length]; - - _intArr = new int[] { - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 123, - 123, - 123, - 123, - 56, - 62, - 100, - 22, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - }; - - // sanity check for when the test arrays above change - Assert.AreEqual(_intArr.Length, 2 * arr1.Length); - - for (int i = 0; i < arr2.Length; i++) - { - if (signed && ((i % 2) == 0)) - { - _intArr[i + arr1.Length] = -(random.Next(max)); - arr2[i] = (_intArr[i + arr1.Length].ToString()); - } - else - { - _intArr[i + arr1.Length] = random.Next(max); - arr2[i] = _intArr[i + arr1.Length].ToString(); - } - } - - string[] arr = new string[_intArr.Length]; - - Array.Copy(arr1, arr, arr1.Length); - Array.Copy(arr2, 0, arr, arr1.Length, arr2.Length); - - return arr; - } - - [TestMethod] - public void ParseSByte_Test_1() - { - OutputHelper.WriteLine("SByte MinValue = " + sbyte.MinValue.ToString()); - OutputHelper.WriteLine("SByte MaxValue = " + sbyte.MaxValue.ToString()); - - string[] strArr = GetRandomStringArray(sbyte.MaxValue, true); - sbyte[] _sByte = new sbyte[_intArr.Length]; - for (int i = 0; i < _sByte.Length; i++) - { - _sByte[i] = (sbyte)_intArr[i]; - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(sbyte.Parse(strArr[i]), _sByte[i]); - - Assert.IsTrue(sbyte.TryParse(strArr[i], out sbyte result), $"TryParse failed for {strArr[i]} expecting: {_sByte[i]}"); - Assert.AreEqual(_sByte[i], result); - } - } - - [TestMethod] - public void ParseByte_Test_2() - { - OutputHelper.WriteLine("Byte MinValue = " + byte.MinValue.ToString()); - OutputHelper.WriteLine("Byte MaxValue = " + byte.MaxValue.ToString()); - - string[] strArr = GetRandomStringArray(byte.MaxValue, false); - byte[] _byte = new byte[_intArr.Length]; - - for (int i = 0; i < _byte.Length; i++) - { - _byte[i] = (byte)_intArr[i]; - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(byte.Parse(strArr[i]), _byte[i], $"Parse failed for {strArr[i]}, expecting: {_byte[i]}"); - - Assert.IsTrue(byte.TryParse(strArr[i], out byte result), $"TryParse failed for {strArr[i]} expecting: {_byte[i]}"); - Assert.AreEqual(_byte[i], result); - } - } - - [TestMethod] - public void ParseInt16_Test_3() - { - OutputHelper.WriteLine("Int16 MinValue = " + short.MinValue.ToString()); - OutputHelper.WriteLine("Int16 MaxValue = " + short.MaxValue.ToString()); - - string[] strArr = GetRandomStringArray(short.MaxValue, true); - short[] _int16 = new short[_intArr.Length]; - for (int i = 0; i < _int16.Length; i++) - { - _int16[i] = (short)_intArr[i]; - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(short.Parse(strArr[i]), _int16[i]); - - Assert.IsTrue(short.TryParse(strArr[i], out short result), $"TryParse failed for {strArr[i]} expecting: {_int16[i]}"); - Assert.AreEqual(_int16[i], result); - } - } - - [TestMethod] - public void ParseUInt16_Test_4() - { - OutputHelper.WriteLine("UInt16 MinValue = " + ushort.MinValue.ToString()); - OutputHelper.WriteLine("UInt16 MaxValue = " + ushort.MaxValue.ToString()); - - - string[] strArr = GetRandomStringArray(ushort.MaxValue, false); - ushort[] _uInt16 = new ushort[_intArr.Length]; - for (int i = 0; i < _uInt16.Length; i++) - { - _uInt16[i] = (ushort)_intArr[i]; - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.IsTrue(ushort.TryParse(strArr[i], out ushort result), $"TryParse failed for {strArr[i]} expecting: {_uInt16[i]}"); - Assert.AreEqual(_uInt16[i], result); - - Assert.AreEqual(ushort.Parse(strArr[i]), _uInt16[i]); - } - } - - [TestMethod] - public void ParseInt32_Test_5() - { - OutputHelper.WriteLine("Int32 MinValue = " + int.MinValue.ToString()); - OutputHelper.WriteLine("Int32 MaxValue = " + int.MaxValue.ToString()); - - string[] strArr = GetRandomStringArray(int.MaxValue, true); - int[] _int32 = new int[_intArr.Length]; - for (int i = 0; i < _int32.Length; i++) - { - _int32[i] = _intArr[i]; - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(int.Parse(strArr[i]), _int32[i]); - - Assert.IsTrue(int.TryParse(strArr[i], out int result), $"TryParse failed for {strArr[i]} expecting: {_int32[i]}"); - Assert.AreEqual(_int32[i], result); - } - } - - // ========================================================================== - - public static double Pow(double num, int power) - { - double val = 1; - for (int pow = 0; pow < power; pow++) - { - val = val * num; - } - - return val; - } - - [TestMethod] - public void ParseUInt32_Test_6() - { - OutputHelper.WriteLine("UInt32 MinValue = " + uint.MinValue.ToString()); - OutputHelper.WriteLine("UInt32 MaxValue = " + uint.MaxValue.ToString()); - - Random random = new Random(); - string[] strArr = new string[] { "0", "-0","+0", - "00000 ", " -00000"," +00000 ", - " 0 ", " -00000 ", - "+123", " +123 ", " +123", "+123 ", - "","","","","","","","","",""}; - uint[] _uInt32 = new uint[] { 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - for (int i = 12; i < _uInt32.Length; i++) - { - int power = random.Next(33); - _uInt32[i] = (uint)(Pow(2, power) - 1); - strArr[i] = _uInt32[i].ToString(); - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.IsTrue(uint.TryParse(strArr[i], out uint result), $"TryParse failed for {strArr[i]} expecting: {_uInt32[i]}"); - Assert.AreEqual(_uInt32[i], result); - - Assert.AreEqual(uint.Parse(strArr[i]), _uInt32[i]); - } - } - - [TestMethod] - public void ParseInt64_Test_7() - { - OutputHelper.WriteLine("Int64 MinValue = " + long.MinValue.ToString()); - OutputHelper.WriteLine("Int64 MaxValue = " + long.MaxValue.ToString()); - - Random random = new Random(); - string[] strArr = new string[] { "0", "-0","+0", - "00000 ", " -00000"," +00000 ", - " 0 ", " -00000 ", - "+123", " +123 ", " +123", "+123 ", - "","","","","","","","","",""}; - long[] _int64 = new long[] { 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - for (int i = 12; i < _int64.Length; i++) - { - int power = random.Next(64); - if (i % 2 == 0) - { - _int64[i] = (long)(-Pow(2, power) - 1); - } - else - { - _int64[i] = (long)(Pow(2, power) - 1); - } - strArr[i] = _int64[i].ToString(); - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(long.Parse(strArr[i]), _int64[i]); - - Assert.IsTrue(long.TryParse(strArr[i], out long result), $"TryParse failed for {strArr[i]} expecting: {_int64[i]}"); - Assert.AreEqual(_int64[i], result); - } - - //Int32: -2147483648 --> 2147483647 - CheckValues(int.MinValue); - CheckValues(int.MaxValue); - - //UInt32: 0 ---> 4294967295 - CheckValues(uint.MinValue); - CheckValues(uint.MaxValue); - - //Int64: -9223372036854775808 --> 9223372036854775807 - CheckValues(long.MinValue); - CheckValues(long.MaxValue); - - //Uint64: 0 --> 18446744073709551615 - CheckValues((long)ulong.MinValue); - } - - - private void CheckValues(long start) - { - long newVal = 0; - string temp; - for (long i = start - 10; i < start + 10; i++) - { - temp = i.ToString(); - newVal = long.Parse(temp); - Assert.AreEqual(i, newVal); - } - } - - [TestMethod] - public void ParseUInt64_Test_8() - { - OutputHelper.WriteLine("UInt64 MinValue = " + ulong.MinValue.ToString()); - OutputHelper.WriteLine("UInt64 MaxValue = " + ulong.MaxValue.ToString()); - - Random random = new Random(); - string[] strArr = new string[] { "0", "-0","+0", - "00000 ", " -00000"," +00000 ", - " 0 ", " -00000 ", - "+123", " +123 ", " +123", "+123 ", - "","","","","","","","","",""}; - ulong[] _uInt64 = new ulong[] { 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - for (int i = 12; i < _uInt64.Length; i++) - { - int power = random.Next(65); - _uInt64[i] = (ulong)(Pow(2, power) - 1); - strArr[i] = _uInt64[i].ToString(); - } - - for (int i = 0; i < strArr.Length; i++) - { - Assert.IsTrue(ulong.TryParse(strArr[i], out ulong result), $"TryParse failed for {strArr[i]} expecting: {_uInt64[i]}"); - Assert.AreEqual(_uInt64[i], result); - - result = ulong.Parse(strArr[i]); - Assert.AreEqual(_uInt64[i], result); - } - - //Int32: -2147483648 --> 2147483647 - CheckUValues(int.MaxValue); - - //UInt32: 0 ---> 4294967295 - CheckUValues(uint.MinValue); - CheckUValues(uint.MaxValue); - - //Int64: -9223372036854775808 --> 9223372036854775807 - CheckUValues(ulong.MaxValue); - - //Uint64: 0 --> 18446744073709551615 - CheckUValues(ulong.MinValue); - CheckUValues(ulong.MaxValue); - } - - [TestMethod] - public void ParseDouble_Test_Valid_Values() - { - string[] strArr = new string[] { - "0", - "-0", - "+0", - "00000 ", - " -00000", - " +00000 ", - " 0 ", - " -00000 ", - "+123", - " +123 ", - " +123", - "+123 ", - "567.89", - "-567.89", - "1E23", - "9007199254740997.0", - "9007199254740997.00000000000000000000000000000000000000000000000000000", - "5.005", - "5.050", - "50050.0", - "0.005", - "6250000000000000000000000000000000e-12", - "6250000e0", - "6250100e-5", - "625010.00e-4", - "62500e-4", - "62500", - "10e-3" - }; - - double[] _double = new double[] { - 0, - double.Parse("-0"), - double.Parse("+0"), - 0, - double.Parse("-0"), - 0, - 0, - double.Parse("-0"), - 123, - 123, - 123, - 123, - 567.89, - -567.89, - 1E23, - 9007199254740997.0, - 9007199254740996.0, - 5.005, - 5.050, - 50050.0, - 0.005, - 6250000000000000000000000000000000e-12, - 6.25e6, - 62.501, - 62.501, - 6.25, - 62500, - 0.01 - }; - - double result; - for (int i = 0; i < strArr.Length; i++) - { - OutputHelper.WriteLine($"Parsing {strArr[i]} expecting: {_double[i]}"); - - Assert.AreEqual(double.Parse(strArr[i]), _double[i], $"Failed while parsing string: {strArr[i]} expecting: {_double[i]}"); - - Assert.IsTrue(double.TryParse(strArr[i], out result), $"TryParse failed for {strArr[i]} expecting: {_double[i]}"); - Assert.AreEqual(_double[i], result); - } - - double d = double.Parse("-0.1"); - Assert.AreEqual(d, -0.1); - - Assert.IsTrue(double.TryParse("-0.1", out result), $"TryParse failed for -0.1 expecting: {d}"); - Assert.AreEqual(-0.1, result); - - d = double.Parse("0.1"); - Assert.AreEqual(d, 0.1); - - Assert.IsTrue(double.TryParse("0.1", out result), $"TryParse failed for 0.1 expecting: {d}"); - Assert.AreEqual(0.1, result); - - d = double.Parse(" -1.1"); - Assert.AreEqual(d, -1.1); - - Assert.IsTrue(double.TryParse(" -1.1", out result), $"TryParse failed for -1.1 expecting: {d}"); - Assert.AreEqual(-1.1, result); - - d = double.Parse(" -0.0001"); - Assert.AreEqual(d, -0.0001); - - Assert.IsTrue(double.TryParse(" -0.0001", out result), $"TryParse failed for -0.0001 expecting: {d}"); - Assert.AreEqual(-0.0001, result); - - d = double.Parse(" -10.0001"); - Assert.AreEqual(d, -10.0001); - - Assert.IsTrue(double.TryParse(" -10.0001", out result), $"TryParse failed for -10.0001 expecting: {d}"); - Assert.AreEqual(-10.0001, result); - - d = double.Parse("-0.01e-10"); - Assert.AreEqual(d, -0.01e-10); - - Assert.IsTrue(double.TryParse("-0.01e-10", out result), $"TryParse failed for -0.01e-10 expecting: {d}"); - Assert.AreEqual(-0.01e-10, result); - - // can't use Min/MaxValue.ToString() because the fast float-to-string routine only works in the range 2^64 to 2^-64 (there-about). - string t = "-1.7976931348623157E+308"; // double.MinValue - Assert.AreEqual(double.MinValue, double.Parse(t), "Testing double min value parse"); - - t = "1.7976931348623157E+308"; - Assert.AreEqual(double.MaxValue, double.Parse(t), "Testing double max value parse"); - } - - [TestMethod] - public void ParseDouble_Test_Invalid_Values() - { - string[] strArr = new string[] { - "", - " ", - " ", - "-0e-a", - "+123a4", - " +123f.1", - "123ea2", - "1.111.1", - " -123-e3", - " 123.456 777", - "1234567ee73", - " +1234e-77+", - "++1", - "--1", - "+1+", - " .1123abc", - " .123+456", - "+123e++10", - "+123e--10", - "-123e++10" - }; - - for (int i = 0; i < strArr.Length; i++) - { - OutputHelper.WriteLine($"parse {strArr[i]}"); - - Assert.ThrowsException(typeof(FormatException), - () => { double.Parse(strArr[i]); }, - $"Should throw exception of type FormatExeception while parsing string: '{strArr[i]}'"); - - Assert.IsFalse(double.TryParse(strArr[i], out double _), $"TryParse should return false while parsing string: '{strArr[i]}'"); - } - } - - [TestMethod] - public void ParseDouble_OverflowTests() - { - // Note we have to check hex values - again, the ToString() works over a subset of the range for double/float, and returns 'oor' or '-oor' for anything outside that range - string t = "-1.7976931348623180E+320"; - Assert.AreEqual(double.NegativeInfinity, double.Parse(t), "High negative values should return double.NegativeInfinity value when parsed"); - - t = "1.7976931348623180E+308"; - Assert.AreEqual(double.PositiveInfinity, double.Parse(t), "High positive values should return double.PositiveInfinity value when parsed"); - } - - [TestMethod] - public void ParseFloat_Test_Valid_Values() - { - string[] strArr = new string[] { - "0", - "-0", - "+0", - "00000 ", - " -00000", - " +00000 ", - " 0 ", - " -00000 ", - "+123", - " +123 ", - " +123", - "+123 ", - "567.89", - "-567.89", - "1E23", - "9007199254740997.0", - "9007199254740997.00000000000000000000000000000000000000000000000000000", - "5.005", - "5.050", - "50050.0", - "0.005", - "6250000000000000000000000000000000e-12", - "6250000e0", - "6250100e-5", - "625010.00e-4", - "62500e-4", - "62500", - "10e-3" - }; - - float[] _float = new float[] { - 0, - float.Parse("-0"), - float.Parse("+0"), - 0, - float.Parse("-0"), - 0, - 0, - float.Parse("-0"), - 123, - 123, - 123, - 123, - 567.89f, - -567.89f, - 1E23f, - 9007199254740997.0f, - 9007199254740996.0f, - 5.005f, - 5.050f, - 50050.0f, - 0.005f, - 6250000000000000000000000000000000e-12f, - 6.25e6f, - 62.501f, - 62.501f, - 6.25f, - 62500, - 0.01f - }; - - float result; - for (int i = 0; i < strArr.Length; i++) - { - OutputHelper.WriteLine($"Parsing {strArr[i]} expecting: {_float[i]}"); - - Assert.AreEqual(float.Parse(strArr[i]), _float[i], $"Failed while parsing string: {strArr[i]} expecting: {_float[i]}"); - - Assert.IsTrue(float.TryParse(strArr[i], out result), $"TryParse failed for {strArr[i]} expecting: {_float[i]}"); - Assert.AreEqual(_float[i], result); - } - - float f = float.Parse("-0.1"); - Assert.AreEqual(f, -0.1f); - - Assert.IsTrue(float.TryParse("-0.1", out result), $"TryParse failed for -0.1 expecting: {f}"); - Assert.AreEqual(-0.1f, result); - - f = float.Parse("0.1"); - Assert.AreEqual(f, 0.1f); - - Assert.IsTrue(float.TryParse("0.1", out result), $"TryParse failed for 0.1 expecting: {f}"); - Assert.AreEqual(0.1f, result); - - f = float.Parse(" -1.1"); - Assert.AreEqual(f, -1.1f); - - Assert.IsTrue(float.TryParse(" -1.1", out result), $"TryParse failed for -1.1 expecting: {f}"); - Assert.AreEqual(-1.1f, result); - - f = float.Parse(" -0.0001"); - Assert.AreEqual(f, -0.0001f); - - Assert.IsTrue(float.TryParse(" -0.0001", out result), $"TryParse failed for -0.0001 expecting: {f}"); - Assert.AreEqual(-0.0001f, result); - - f = float.Parse(" -10.0001"); - Assert.AreEqual(f, -10.0001f); - - Assert.IsTrue(float.TryParse(" -10.0001", out result), $"TryParse failed for -10.0001 expecting: {f}"); - Assert.AreEqual(-10.0001f, result); - - f = float.Parse("-0.01e-10"); - Assert.AreEqual(f, -0.01e-10f); - - Assert.IsTrue(float.TryParse("-0.01e-10", out result), $"TryParse failed for -0.01e-10 expecting: {f}"); - Assert.AreEqual(-0.01e-10f, result); - - // can't use Min/MaxValue.ToString() because the fast float-to-string routine only works in the range 2^64 to 2^-64 (there-about). - string t = "-3.40282347E+38"; // float.MinValue - Assert.AreEqual(float.MinValue, float.Parse(t), "Testing float min value parse"); - - t = "3.40282347E+38"; // float.MaxValue - Assert.AreEqual(float.MaxValue, float.Parse(t), "Testing float max value parse"); - } - - [TestMethod] - public void ParseFloat_Test_Invalid_Values() - { - string[] strArr = new string[] { - "", - " ", - " ", - "-0e-a", - "+123a4", - " +123f.1", - "123ea2", - "1.111.1", - " -123-e3", - " 123.456 777", - "1234567ee73", - " +1234e-77+", - "++1", - "--1", - "+1+", - " .1123abc", - " .123+456", - "+123e++10", - "+123e--10", - "-123e++10" - }; - - for (int i = 0; i < strArr.Length; i++) - { - OutputHelper.WriteLine($"parse {strArr[i]}"); - - Assert.ThrowsException(typeof(FormatException), - () => { float.Parse(strArr[i]); }, - $"Should throw exception of type FormatExeception while parsing string: '{strArr[i]}'"); - - Assert.IsFalse(float.TryParse(strArr[i], out float _), $"TryParse should return false while parsing string: '{strArr[i]}'"); - } - } - - [TestMethod] - public void ParseFloat_OverflowTests() - { - // Note we have to check hex values - again, the ToString() works over a subset of the range for double/float, and returns 'oor' or '-oor' for anything outside that range - string t = "-3.40282380E+38"; - Assert.AreEqual(float.NegativeInfinity, float.Parse(t), "High negative values should return float.NegativeInfinity value when parsed"); - - t = "3.40282380E+38"; - Assert.AreEqual(float.PositiveInfinity, float.Parse(t), "High positive values should return float.PositiveInfinity value when parsed"); - } - - private void CheckUValues(ulong start) - { - for (ulong i = start - 10; i < start + 10; i++) - { - ulong newVal = ulong.Parse(i.ToString()); - - Assert.IsTrue(ulong.TryParse(i.ToString(), out ulong result), $"TryParse failed for {i.ToString()} expecting: {newVal}"); - Assert.AreEqual(newVal, result); - - Assert.AreEqual(i, newVal); - } - } - - //========================================================================================= - // BoundaryTests - - - [TestMethod] - public void SByte_Boundary_Test_9() - { - - string[] strArr = new string[] { sbyte.MaxValue.ToString(), "127", sbyte.MinValue.ToString(), "-128" }; - sbyte[] _SByte = new sbyte[] { 127, 127, -128, -128 }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(sbyte.Parse(strArr[i]), _SByte[i]); - - Assert.IsTrue(sbyte.TryParse(strArr[i], out sbyte result), $"TryParse failed for {strArr[i]} expecting: {_SByte[i]}"); - Assert.AreEqual(_SByte[i], result); - } - } - - [TestMethod] - public void Byte_Boundary_Test_10() - { - string[] strArr = new string[] { byte.MaxValue.ToString(), "255", byte.MinValue.ToString(), "0" }; - byte[] _byte = new byte[] { 255, 255, 0, 0 }; - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(byte.Parse(strArr[i]), _byte[i]); - - Assert.IsTrue(byte.TryParse(strArr[i], out byte result), $"TryParse failed for {strArr[i]} expecting: {_byte[i]}"); - Assert.AreEqual(_byte[i], result); - } - } - - [TestMethod] - public void Int16_Boundary_Test_11() - { - string[] strArr = new string[] { short.MaxValue.ToString(), "32767", short.MinValue.ToString(), "-32768" }; - short[] _int16 = new short[] { 32767, 32767, -32768, -32768 }; - - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(short.Parse(strArr[i]), _int16[i]); - - Assert.IsTrue(short.TryParse(strArr[i], out short result), $"TryParse failed for {strArr[i]} expecting: {_int16[i]}"); - Assert.AreEqual(_int16[i], result); - } - } - - [TestMethod] - public void UInt16_Boundary_Test_12() - { - string[] strArr = new string[] { ushort.MaxValue.ToString(), "65535", ushort.MinValue.ToString(), "0" }; - ushort[] _uInt16 = new ushort[] { 65535, 65535, 0, 0 }; - - for (int i = 0; i < strArr.Length; i++) - { - Assert.IsTrue(ushort.TryParse(strArr[i], out ushort result), $"TryParse failed for {strArr[i]} expecting: {_uInt16[i]}"); - Assert.AreEqual(_uInt16[i], result); - - Assert.AreEqual(ushort.Parse(strArr[i]), _uInt16[i]); - } - } - - [TestMethod] - public void Int32_Boundary_Test_13() - { - string[] strArr = new string[] { int.MaxValue.ToString(), "2147483647", int.MinValue.ToString(), "-2147483648" }; - int[] _int32 = new int[] { 2147483647, 2147483647, -2147483648, -2147483648 }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.AreEqual(int.Parse(strArr[i]), _int32[i]); - - Assert.IsTrue(int.TryParse(strArr[i], out int result), $"TryParse failed for {strArr[i]} expecting: {_int32[i]}"); - Assert.AreEqual(_int32[i], result); - } - } - - [TestMethod] - public void UInt32_Boundary_Test_14() - { - string[] strArr = new string[] { uint.MaxValue.ToString(), "4294967295", uint.MinValue.ToString(), "0" }; - uint[] _uInt32 = new uint[] { 4294967295, 4294967295, 0, 0 }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.IsTrue(uint.TryParse(strArr[i], out uint result), $"TryParse failed for {strArr[i]} expecting: {_uInt32[i]}"); - Assert.AreEqual(_uInt32[i], result); - - Assert.AreEqual(uint.Parse(strArr[i]), _uInt32[i]); - } - } - - [TestMethod] - public void Int64_Boundary_Test_15() - { - string[] strArr = new string[] { long.MaxValue.ToString(), "9223372036854775807", long.MinValue.ToString(), "-9223372036854775808" }; - long[] _int64 = new long[] { 9223372036854775807, 9223372036854775807, -9223372036854775808, -9223372036854775808 }; - long temp = 0; - for (int i = 0; i < strArr.Length; i++) - { - temp = long.Parse(strArr[i]); - Assert.AreEqual(temp, _int64[i]); - } - } - - [TestMethod] - public void UInt64_Boundary_Test_16() - { - string[] strArr = new string[] { ulong.MaxValue.ToString(), "18446744073709551615", ulong.MinValue.ToString(), "0" }; - ulong[] _uInt64 = new ulong[] { 18446744073709551615, 18446744073709551615, 0, 0 }; - ulong temp = 0; - for (int i = 0; i < strArr.Length; i++) - { - temp = ulong.Parse(strArr[i]); - Assert.AreEqual(temp, _uInt64[i]); - } - } - - //============================================================================ - // ArgumentNullException tests - - public static string str = null; - - [TestMethod] - public void SByte_ArgumentNullException_Test_17() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { sbyte.Parse(str); }); - } - - [TestMethod] - public void SByte_TryParse_Test() - { - Assert.IsFalse(sbyte.TryParse(str, out sbyte _)); - } - - [TestMethod] - public void Byte_ArgumentNullException_Test_18() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { byte.Parse(str); }); - } - - [TestMethod] - public void Byte_TryParse_Test() - { - Assert.IsFalse(byte.TryParse(str, out byte _)); - } - - [TestMethod] - public void Int16_ArgumentNullException_Test_19() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { short.Parse(str); }); - } - - [TestMethod] - public void Int16_TryParse_Test() - { - Assert.IsFalse(short.TryParse(str, out short _)); - } - - [TestMethod] - public void UInt16_ArgumentNullException_Test_20() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { ushort.Parse(str); }); - } - - [TestMethod] - public void UInt16_TryParse_Test() - { - Assert.IsFalse(ushort.TryParse(str, out ushort _)); - } - - [TestMethod] - public void Int32_ArgumentNullException_Test_21() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { int.Parse(str); }); - } - - [TestMethod] - public void Int32_TryParse_Test() - { - Assert.IsFalse(int.TryParse(str, out int _)); - } - - [TestMethod] - public void UInt32_ArgumentNullException_Test_22() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { uint.Parse(str); }); - } - - [TestMethod] - public void UInt32_TryParse_Test() - { - Assert.IsFalse(uint.TryParse(str, out uint _)); - } - - [TestMethod] - public void Int64_ArgumentNullException_Test_23() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { long.Parse(str); }); - } - - [TestMethod] - public void Int64_TryParse_Test() - { - Assert.IsFalse(long.TryParse(str, out long _)); - } - - [TestMethod] - public void UInt64_ArgumentNullException_Test_24() - { - Assert.ThrowsException(typeof(ArgumentNullException), () => { ulong.Parse(str); }); - } - - [TestMethod] - public void UInt64_TryParse_Test() - { - Assert.IsFalse(ulong.TryParse(str, out ulong _)); - } - - /// - /// Used to generate random string of specified length and type - /// - /// An integer specifying the length on the random string - /// A RandomType enum specifying random string type - /// random string - private static string GetRandomString() - { - // Negative numbers indicate a random string length of 10-20 is desired. - Random s_random = new Random(); - int length = 10 + s_random.Next(11); - - char[] chars = new char[length]; - for (int i = 0; i < length; i++) - { - switch (s_random.Next(3)) - { - case 0: - // Get a random char between ascii 65 and 90 (upper case alphabets). - chars[i] = (char)(65 + s_random.Next(26)); - break; - case 1: - // Get a random char between ascii 97 and 122 (lower case alphabets). - chars[i] = (char)(97 + s_random.Next(26)); - break; - case 2: - // Get a random number 0 - 9 - chars[i] = (char)('0' + s_random.Next(10)); - break; - } - } - - return new string(chars); - } - - //============================================================================ - // FormatException tests - - [TestMethod] - public void ParseSByte_FormatException_Test_25() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = sbyte.Parse(strArr[i]); }); - - Assert.IsFalse(sbyte.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = sbyte.Parse(rdmString); }); - - Assert.IsFalse(sbyte.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseByte_FormatException_Test_26() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = byte.Parse(strArr[i]); }, $"Value '{strArr[i]}' did not throw exception of type FormatException"); - - Assert.IsFalse(byte.TryParse(strArr[i], out _)); - } - - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = byte.Parse(rdmString); }, $"Random string '{rdmString}' did not throw exception of FormatException"); - - Assert.IsFalse(byte.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseInt16_FormatException_Test_27() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = short.Parse(strArr[i]); }); - - Assert.IsFalse(short.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = short.Parse(rdmString); }); - - Assert.IsFalse(short.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseUInt16_FormatException_Test_28() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = ushort.Parse(strArr[i]); }); - - Assert.IsFalse(ushort.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = ushort.Parse(rdmString); }); - - Assert.IsFalse(ushort.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseInt32_FormatException_Test_29() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = int.Parse(strArr[i]); }); - - Assert.IsFalse(int.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = int.Parse(rdmString); }); - - Assert.IsFalse(int.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseUInt32_FormatException_Test_30() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = uint.Parse(strArr[i]); }); - - Assert.IsFalse(uint.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = uint.Parse(rdmString); }); - - Assert.IsFalse(uint.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseInt64_FormatException_Test_31() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = long.Parse(strArr[i]); }); - - Assert.IsFalse(long.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = long.Parse(rdmString); }); - - Assert.IsFalse(long.TryParse(rdmString, out _)); - } - } - - [TestMethod] - public void ParseUInt64_FormatException_Test_32() - { - string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(FormatException), () => { _ = ulong.Parse(strArr[i]); }); - - Assert.IsFalse(ulong.TryParse(strArr[i], out _)); - } - for (int i = 0; i < 5; i++) - { - string rdmString = GetRandomString(); - - Assert.ThrowsException(typeof(FormatException), () => { _ = ulong.Parse(rdmString); }); - - Assert.IsFalse(ulong.TryParse(rdmString, out _)); - } - } - - - //============================================================================ - // OverflowException tests - - - [TestMethod] - public void ParseSByte_OverflowException_Test_33() - { - string[] strArr = new string[] { ((long)sbyte.MinValue - 1).ToString(), ((long)sbyte.MinValue - 100).ToString(), - ((long)sbyte.MaxValue + 1).ToString(), ((long)sbyte.MaxValue + 100).ToString() }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = sbyte.Parse(strArr[i]); }, $"The value '{strArr[i]}' did not produce an exception type of ArgumentOutOfRange"); - - Assert.IsFalse(sbyte.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseByte_OverflowException_Test_34() - { - string[] strArr = new string[] { ((long)byte.MinValue - 1).ToString(), ((long)byte.MinValue - 100).ToString(), - ((long)byte.MaxValue + 1).ToString(), ((long)byte.MaxValue + 100).ToString() }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = byte.Parse(strArr[i]); }); - - Assert.IsFalse(byte.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseInt16_OverflowException_Test_35() - { - string[] strArr = new string[] { ((long)short.MinValue - 1).ToString(), ((long)short.MinValue - 100).ToString(), - ((long)short.MaxValue + 1).ToString(), ((long)short.MaxValue + 100).ToString() }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = short.Parse(strArr[i]); }); - - Assert.IsFalse(short.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseUInt16_OverflowException_Test_36() - { - string[] strArr = new string[] { ((long)ushort.MinValue - 1).ToString(), ((long)ushort.MinValue - 100).ToString(), - ((long)ushort.MaxValue + 1).ToString(), ((long)ushort.MaxValue + 100).ToString() }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = ushort.Parse(strArr[i]); }); - - Assert.IsFalse(ushort.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseInt32_OverflowException_Test_37() - { - string[] strArr = new string[] { ((long)int.MinValue - 1).ToString(), ((long)int.MinValue - 100).ToString(), - ((long)int.MaxValue + 1).ToString(), ((long)int.MaxValue + 100).ToString() }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = int.Parse(strArr[i]); }); - - Assert.IsFalse(int.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseUInt32_OverflowException_Test_38() - { - string[] strArr = new string[] { ((long)uint.MinValue - 1).ToString(), ((long)uint.MinValue - 100).ToString(), - ((long)uint.MaxValue + 1).ToString(), ((long)uint.MaxValue + 100).ToString() }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = uint.Parse(strArr[i]); }); - - Assert.IsFalse(uint.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseInt64_OverflowException_Test_39() - { - - string[] strArr = new string[] { "-9223372036854775809", "-9223372036854775900", - "9223372036854775808", "9223372036854775900" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = long.Parse(strArr[i]); }, $"An exception of type ArgumentOutOfRangeException was not thrown when values was {strArr[i]}"); - - Assert.IsFalse(long.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void ParseUInt64_OverflowException_Test_40() - { - string[] strArr = new string[] { "-1", "-100", "18446744073709551616", "18446744073709551700" }; - for (int i = 0; i < strArr.Length; i++) - { - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = ulong.Parse(strArr[i]); }); - - Assert.IsFalse(ulong.TryParse(strArr[i], out _)); - } - } - - [TestMethod] - public void Cast_Double_to_int64_Test_40() - { - double dbVal = new Random().Next(); - - // Convert to int and uint should keep the value - long l_val = (long)dbVal; - Assert.AreEqual(l_val, dbVal); - - ulong ul_val = (ulong)dbVal; - Assert.AreEqual(ul_val, dbVal); - - // Change sign to negative - dbVal = -dbVal; - - l_val = (long)dbVal; - Assert.AreEqual(l_val, dbVal); - - ul_val = (ulong)dbVal; - long ul_val_cast = (long)ul_val; - Assert.AreEqual(ul_val_cast, dbVal); - } - - - public enum MyEnum : short { Value = 25 } - public enum MyEnum1 { Value = 24 } - public enum MyEnum2 : short { Value = 23 } - - class CastTestClass - { - - } - - - [TestMethod] - public void box_unbox_Test_1() - { - // Creates objects for testing of different casts. - object o_enum = MyEnum.Value; - object o_enum1 = MyEnum1.Value; - object o_long = 24L; - object o_class = new CastTestClass(); - object o_guid = Guid.NewGuid(); - - // Try casts that shoud succeed. Any exception here means failure. - // First we try casts that should succeed. - // Casts between enums with the same basic type - MyEnum2 e2 = (MyEnum2)o_enum; // line 2 - // Cast from enum to primitive type that enum is based on - short sv = (short)o_enum; - Assert.AreEqual(sv, (short)MyEnum.Value); - - // Cast from enum to primitive type that enum is based on - int iv = (int)o_enum1; - Assert.AreEqual(iv, (short)MyEnum1.Value); - - int i_long = (int)(long)o_long; - CastTestClass cls = (CastTestClass)o_class; - Guid guid = (Guid)o_guid; - - // Now casts that should throw exception. Any cast that does not throw - means error. - Assert.ThrowsException(typeof(InvalidCastException), () => - { - MyEnum1 e1 = (MyEnum1)o_enum; - }, "Trying to cast incompatible enums - should throw InvalidCastException"); - - // Now casts that should throw exception. Any cast that does not throw - means error. - Assert.ThrowsException(typeof(InvalidCastException), () => - { - int i = (int)o_long; - }, "Trying to cast long to int - should throw InvalidCastException"); - - // Now casts that should throw exception. Any cast that does not throw - means error. - Assert.ThrowsException(typeof(InvalidCastException), () => - { - int i = (int)o_class; - }, "Trying to cast object to int - should throw InvalidCastException"); - - // Now casts that should throw exception. Any cast that does not throw - means error. - Assert.ThrowsException(typeof(InvalidCastException), () => - { - int i = (int)o_enum; - }, "Trying to cast enum to int - should throw InvalidCastException"); - - // Now casts that should throw exception. Any cast that does not throw - means error. - Assert.ThrowsException(typeof(InvalidCastException), () => - { - int i = (int)o_guid; - }, "Trying to cast Guid to int - should throw InvalidCastException"); - } - } -} +// +// Copyright (c) .NET Foundation and Contributors +// Portions Copyright (c) Microsoft Corporation. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +using nanoFramework.TestFramework; +using System; +using System.Diagnostics; + +namespace NFUnitTestSystemLib +{ + [TestClass] + class UnitTestParseTests + { + private static int[] _intArr = new int[0]; + + public static string[] GetRandomStringArray(int max, bool signed) + { + Random random = new Random(); + + string[] arr1 = new string[] { + "0", + "-0", + "+0", + "00000 ", + " -00000", + " +00000 ", + " 0 ", + " -00000 ", + "+123", + " +123 ", + " +123", + "+123 ", + "56", + "62", + "100", + "22" + }; + + string[] arr2 = new string[arr1.Length]; + + _intArr = new int[] { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 123, + 123, + 123, + 123, + 56, + 62, + 100, + 22, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + }; + + // sanity check for when the test arrays above change + Assert.AreEqual(_intArr.Length, 2 * arr1.Length); + + for (int i = 0; i < arr2.Length; i++) + { + if (signed && ((i % 2) == 0)) + { + _intArr[i + arr1.Length] = -(random.Next(max)); + arr2[i] = (_intArr[i + arr1.Length].ToString()); + } + else + { + _intArr[i + arr1.Length] = random.Next(max); + arr2[i] = _intArr[i + arr1.Length].ToString(); + } + } + + string[] arr = new string[_intArr.Length]; + + Array.Copy(arr1, arr, arr1.Length); + Array.Copy(arr2, 0, arr, arr1.Length, arr2.Length); + + return arr; + } + + [TestMethod] + public void ParseSByte_Test_1() + { + OutputHelper.WriteLine("SByte MinValue = " + sbyte.MinValue.ToString()); + OutputHelper.WriteLine("SByte MaxValue = " + sbyte.MaxValue.ToString()); + + string[] strArr = GetRandomStringArray(sbyte.MaxValue, true); + sbyte[] _sByte = new sbyte[_intArr.Length]; + for (int i = 0; i < _sByte.Length; i++) + { + _sByte[i] = (sbyte)_intArr[i]; + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(sbyte.Parse(strArr[i]), _sByte[i]); + + Assert.IsTrue(sbyte.TryParse(strArr[i], out sbyte result), $"TryParse failed for {strArr[i]} expecting: {_sByte[i]}"); + Assert.AreEqual(_sByte[i], result); + } + } + + [TestMethod] + public void ParseByte_Test_2() + { + OutputHelper.WriteLine("Byte MinValue = " + byte.MinValue.ToString()); + OutputHelper.WriteLine("Byte MaxValue = " + byte.MaxValue.ToString()); + + string[] strArr = GetRandomStringArray(byte.MaxValue, false); + byte[] _byte = new byte[_intArr.Length]; + + for (int i = 0; i < _byte.Length; i++) + { + _byte[i] = (byte)_intArr[i]; + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(byte.Parse(strArr[i]), _byte[i], $"Parse failed for {strArr[i]}, expecting: {_byte[i]}"); + + Assert.IsTrue(byte.TryParse(strArr[i], out byte result), $"TryParse failed for {strArr[i]} expecting: {_byte[i]}"); + Assert.AreEqual(_byte[i], result); + } + } + + [TestMethod] + public void ParseInt16_Test_3() + { + OutputHelper.WriteLine("Int16 MinValue = " + short.MinValue.ToString()); + OutputHelper.WriteLine("Int16 MaxValue = " + short.MaxValue.ToString()); + + string[] strArr = GetRandomStringArray(short.MaxValue, true); + short[] _int16 = new short[_intArr.Length]; + for (int i = 0; i < _int16.Length; i++) + { + _int16[i] = (short)_intArr[i]; + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(short.Parse(strArr[i]), _int16[i]); + + Assert.IsTrue(short.TryParse(strArr[i], out short result), $"TryParse failed for {strArr[i]} expecting: {_int16[i]}"); + Assert.AreEqual(_int16[i], result); + } + } + + [TestMethod] + public void ParseUInt16_Test_4() + { + OutputHelper.WriteLine("UInt16 MinValue = " + ushort.MinValue.ToString()); + OutputHelper.WriteLine("UInt16 MaxValue = " + ushort.MaxValue.ToString()); + + + string[] strArr = GetRandomStringArray(ushort.MaxValue, false); + ushort[] _uInt16 = new ushort[_intArr.Length]; + for (int i = 0; i < _uInt16.Length; i++) + { + _uInt16[i] = (ushort)_intArr[i]; + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.IsTrue(ushort.TryParse(strArr[i], out ushort result), $"TryParse failed for {strArr[i]} expecting: {_uInt16[i]}"); + Assert.AreEqual(_uInt16[i], result); + + Assert.AreEqual(ushort.Parse(strArr[i]), _uInt16[i]); + } + } + + [TestMethod] + public void ParseInt32_Test_5() + { + OutputHelper.WriteLine("Int32 MinValue = " + int.MinValue.ToString()); + OutputHelper.WriteLine("Int32 MaxValue = " + int.MaxValue.ToString()); + + string[] strArr = GetRandomStringArray(int.MaxValue, true); + int[] _int32 = new int[_intArr.Length]; + for (int i = 0; i < _int32.Length; i++) + { + _int32[i] = _intArr[i]; + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(int.Parse(strArr[i]), _int32[i]); + + Assert.IsTrue(int.TryParse(strArr[i], out int result), $"TryParse failed for {strArr[i]} expecting: {_int32[i]}"); + Assert.AreEqual(_int32[i], result); + } + } + + // ========================================================================== + + public static double Pow(double num, int power) + { + double val = 1; + for (int pow = 0; pow < power; pow++) + { + val = val * num; + } + + return val; + } + + [TestMethod] + public void ParseUInt32_Test_6() + { + OutputHelper.WriteLine("UInt32 MinValue = " + uint.MinValue.ToString()); + OutputHelper.WriteLine("UInt32 MaxValue = " + uint.MaxValue.ToString()); + + Random random = new Random(); + string[] strArr = new string[] { "0", "-0","+0", + "00000 ", " -00000"," +00000 ", + " 0 ", " -00000 ", + "+123", " +123 ", " +123", "+123 ", + "","","","","","","","","",""}; + uint[] _uInt32 = new uint[] { 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + for (int i = 12; i < _uInt32.Length; i++) + { + int power = random.Next(33); + _uInt32[i] = (uint)(Pow(2, power) - 1); + strArr[i] = _uInt32[i].ToString(); + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.IsTrue(uint.TryParse(strArr[i], out uint result), $"TryParse failed for {strArr[i]} expecting: {_uInt32[i]}"); + Assert.AreEqual(_uInt32[i], result); + + Assert.AreEqual(uint.Parse(strArr[i]), _uInt32[i]); + } + } + + [TestMethod] + public void ParseInt64_Test_7() + { + OutputHelper.WriteLine("Int64 MinValue = " + long.MinValue.ToString()); + OutputHelper.WriteLine("Int64 MaxValue = " + long.MaxValue.ToString()); + + Random random = new Random(); + string[] strArr = new string[] { "0", "-0","+0", + "00000 ", " -00000"," +00000 ", + " 0 ", " -00000 ", + "+123", " +123 ", " +123", "+123 ", + "","","","","","","","","",""}; + long[] _int64 = new long[] { 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + for (int i = 12; i < _int64.Length; i++) + { + int power = random.Next(64); + if (i % 2 == 0) + { + _int64[i] = (long)(-Pow(2, power) - 1); + } + else + { + _int64[i] = (long)(Pow(2, power) - 1); + } + strArr[i] = _int64[i].ToString(); + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(long.Parse(strArr[i]), _int64[i]); + + Assert.IsTrue(long.TryParse(strArr[i], out long result), $"TryParse failed for {strArr[i]} expecting: {_int64[i]}"); + Assert.AreEqual(_int64[i], result); + } + + //Int32: -2147483648 --> 2147483647 + CheckValues(int.MinValue); + CheckValues(int.MaxValue); + + //UInt32: 0 ---> 4294967295 + CheckValues(uint.MinValue); + CheckValues(uint.MaxValue); + + //Int64: -9223372036854775808 --> 9223372036854775807 + CheckValues(long.MinValue); + CheckValues(long.MaxValue); + + //Uint64: 0 --> 18446744073709551615 + CheckValues((long)ulong.MinValue); + } + + + private void CheckValues(long start) + { + long newVal = 0; + string temp; + for (long i = start - 10; i < start + 10; i++) + { + temp = i.ToString(); + newVal = long.Parse(temp); + Assert.AreEqual(i, newVal); + } + } + + [TestMethod] + public void ParseUInt64_Test_8() + { + OutputHelper.WriteLine("UInt64 MinValue = " + ulong.MinValue.ToString()); + OutputHelper.WriteLine("UInt64 MaxValue = " + ulong.MaxValue.ToString()); + + Random random = new Random(); + string[] strArr = new string[] { "0", "-0","+0", + "00000 ", " -00000"," +00000 ", + " 0 ", " -00000 ", + "+123", " +123 ", " +123", "+123 ", + "","","","","","","","","",""}; + ulong[] _uInt64 = new ulong[] { 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + for (int i = 12; i < _uInt64.Length; i++) + { + int power = random.Next(65); + _uInt64[i] = (ulong)(Pow(2, power) - 1); + strArr[i] = _uInt64[i].ToString(); + } + + for (int i = 0; i < strArr.Length; i++) + { + Assert.IsTrue(ulong.TryParse(strArr[i], out ulong result), $"TryParse failed for {strArr[i]} expecting: {_uInt64[i]}"); + Assert.AreEqual(_uInt64[i], result); + + result = ulong.Parse(strArr[i]); + Assert.AreEqual(_uInt64[i], result); + } + + //Int32: -2147483648 --> 2147483647 + CheckUValues(int.MaxValue); + + //UInt32: 0 ---> 4294967295 + CheckUValues(uint.MinValue); + CheckUValues(uint.MaxValue); + + //Int64: -9223372036854775808 --> 9223372036854775807 + CheckUValues(ulong.MaxValue); + + //Uint64: 0 --> 18446744073709551615 + CheckUValues(ulong.MinValue); + CheckUValues(ulong.MaxValue); + } + + [TestMethod] + public void ParseDouble_Test_Valid_Values() + { + string[] strArr = new string[] { + "0", + "-0", + "+0", + "00000 ", + " -00000", + " +00000 ", + " 0 ", + " -00000 ", + "+123", + " +123 ", + " +123", + "+123 ", + "567.89", + "-567.89", + "1E23", + "9007199254740997.0", + "9007199254740997.00000000000000000000000000000000000000000000000000000", + "5.005", + "5.050", + "50050.0", + "0.005", + "6250000000000000000000000000000000e-12", + "6250000e0", + "6250100e-5", + "625010.00e-4", + "62500e-4", + "62500", + "10e-3" + }; + + double[] _double = new double[] { + 0, + double.Parse("-0"), + double.Parse("+0"), + 0, + double.Parse("-0"), + 0, + 0, + double.Parse("-0"), + 123, + 123, + 123, + 123, + 567.89, + -567.89, + 1E23, + 9007199254740997.0, + 9007199254740996.0, + 5.005, + 5.050, + 50050.0, + 0.005, + 6250000000000000000000000000000000e-12, + 6.25e6, + 62.501, + 62.501, + 6.25, + 62500, + 0.01 + }; + + double result; + for (int i = 0; i < strArr.Length; i++) + { + OutputHelper.WriteLine($"Parsing {strArr[i]} expecting: {_double[i]}"); + + Assert.AreEqual(double.Parse(strArr[i]), _double[i], $"Failed while parsing string: {strArr[i]} expecting: {_double[i]}"); + + Assert.IsTrue(double.TryParse(strArr[i], out result), $"TryParse failed for {strArr[i]} expecting: {_double[i]}"); + Assert.AreEqual(_double[i], result); + } + + double d = double.Parse("-0.1"); + Assert.AreEqual(d, -0.1); + + Assert.IsTrue(double.TryParse("-0.1", out result), $"TryParse failed for -0.1 expecting: {d}"); + Assert.AreEqual(-0.1, result); + + d = double.Parse("0.1"); + Assert.AreEqual(d, 0.1); + + Assert.IsTrue(double.TryParse("0.1", out result), $"TryParse failed for 0.1 expecting: {d}"); + Assert.AreEqual(0.1, result); + + d = double.Parse(" -1.1"); + Assert.AreEqual(d, -1.1); + + Assert.IsTrue(double.TryParse(" -1.1", out result), $"TryParse failed for -1.1 expecting: {d}"); + Assert.AreEqual(-1.1, result); + + d = double.Parse(" -0.0001"); + Assert.AreEqual(d, -0.0001); + + Assert.IsTrue(double.TryParse(" -0.0001", out result), $"TryParse failed for -0.0001 expecting: {d}"); + Assert.AreEqual(-0.0001, result); + + d = double.Parse(" -10.0001"); + Assert.AreEqual(d, -10.0001); + + Assert.IsTrue(double.TryParse(" -10.0001", out result), $"TryParse failed for -10.0001 expecting: {d}"); + Assert.AreEqual(-10.0001, result); + + d = double.Parse("-0.01e-10"); + Assert.AreEqual(d, -0.01e-10); + + Assert.IsTrue(double.TryParse("-0.01e-10", out result), $"TryParse failed for -0.01e-10 expecting: {d}"); + Assert.AreEqual(-0.01e-10, result); + + // can't use Min/MaxValue.ToString() because the fast float-to-string routine only works in the range 2^64 to 2^-64 (there-about). + string t = "-1.7976931348623157E+308"; // double.MinValue + Assert.AreEqual(double.MinValue, double.Parse(t), "Testing double min value parse"); + + t = "1.7976931348623157E+308"; + Assert.AreEqual(double.MaxValue, double.Parse(t), "Testing double max value parse"); + } + + [TestMethod] + public void ParseDouble_Test_Invalid_Values() + { + string[] strArr = new string[] { + "", + " ", + " ", + "-0e-a", + "+123a4", + " +123f.1", + "123ea2", + "1.111.1", + " -123-e3", + " 123.456 777", + "1234567ee73", + " +1234e-77+", + "++1", + "--1", + "+1+", + " .1123abc", + " .123+456", + "+123e++10", + "+123e--10", + "-123e++10" + }; + + for (int i = 0; i < strArr.Length; i++) + { + OutputHelper.WriteLine($"parse {strArr[i]}"); + + Assert.ThrowsException(typeof(FormatException), + () => { double.Parse(strArr[i]); }, + $"Should throw exception of type FormatExeception while parsing string: '{strArr[i]}'"); + + Assert.IsFalse(double.TryParse(strArr[i], out double _), $"TryParse should return false while parsing string: '{strArr[i]}'"); + } + } + + [TestMethod] + public void ParseDouble_OverflowTests() + { + // Note we have to check hex values - again, the ToString() works over a subset of the range for double/float, and returns 'oor' or '-oor' for anything outside that range + string t = "-1.7976931348623180E+320"; + Assert.AreEqual(double.NegativeInfinity, double.Parse(t), "High negative values should return double.NegativeInfinity value when parsed"); + + t = "1.7976931348623180E+308"; + Assert.AreEqual(double.PositiveInfinity, double.Parse(t), "High positive values should return double.PositiveInfinity value when parsed"); + } + + [TestMethod] + public void ParseFloat_Test_Valid_Values() + { + string[] strArr = new string[] { + "0", + "-0", + "+0", + "00000 ", + " -00000", + " +00000 ", + " 0 ", + " -00000 ", + "+123", + " +123 ", + " +123", + "+123 ", + "567.89", + "-567.89", + "1E23", + "9007199254740997.0", + "9007199254740997.00000000000000000000000000000000000000000000000000000", + "5.005", + "5.050", + "50050.0", + "0.005", + "6250000000000000000000000000000000e-12", + "6250000e0", + "6250100e-5", + "625010.00e-4", + "62500e-4", + "62500", + "10e-3" + }; + + float[] _float = new float[] { + 0, + float.Parse("-0"), + float.Parse("+0"), + 0, + float.Parse("-0"), + 0, + 0, + float.Parse("-0"), + 123, + 123, + 123, + 123, + 567.89f, + -567.89f, + 1E23f, + 9007199254740997.0f, + 9007199254740996.0f, + 5.005f, + 5.050f, + 50050.0f, + 0.005f, + 6250000000000000000000000000000000e-12f, + 6.25e6f, + 62.501f, + 62.501f, + 6.25f, + 62500, + 0.01f + }; + + float result; + for (int i = 0; i < strArr.Length; i++) + { + OutputHelper.WriteLine($"Parsing {strArr[i]} expecting: {_float[i]}"); + + Assert.AreEqual(float.Parse(strArr[i]), _float[i], $"Failed while parsing string: {strArr[i]} expecting: {_float[i]}"); + + Assert.IsTrue(float.TryParse(strArr[i], out result), $"TryParse failed for {strArr[i]} expecting: {_float[i]}"); + Assert.AreEqual(_float[i], result); + } + + float f = float.Parse("-0.1"); + Assert.AreEqual(f, -0.1f); + + Assert.IsTrue(float.TryParse("-0.1", out result), $"TryParse failed for -0.1 expecting: {f}"); + Assert.AreEqual(-0.1f, result); + + f = float.Parse("0.1"); + Assert.AreEqual(f, 0.1f); + + Assert.IsTrue(float.TryParse("0.1", out result), $"TryParse failed for 0.1 expecting: {f}"); + Assert.AreEqual(0.1f, result); + + f = float.Parse(" -1.1"); + Assert.AreEqual(f, -1.1f); + + Assert.IsTrue(float.TryParse(" -1.1", out result), $"TryParse failed for -1.1 expecting: {f}"); + Assert.AreEqual(-1.1f, result); + + f = float.Parse(" -0.0001"); + Assert.AreEqual(f, -0.0001f); + + Assert.IsTrue(float.TryParse(" -0.0001", out result), $"TryParse failed for -0.0001 expecting: {f}"); + Assert.AreEqual(-0.0001f, result); + + f = float.Parse(" -10.0001"); + Assert.AreEqual(f, -10.0001f); + + Assert.IsTrue(float.TryParse(" -10.0001", out result), $"TryParse failed for -10.0001 expecting: {f}"); + Assert.AreEqual(-10.0001f, result); + + f = float.Parse("-0.01e-10"); + Assert.AreEqual(f, -0.01e-10f); + + Assert.IsTrue(float.TryParse("-0.01e-10", out result), $"TryParse failed for -0.01e-10 expecting: {f}"); + Assert.AreEqual(-0.01e-10f, result); + + // can't use Min/MaxValue.ToString() because the fast float-to-string routine only works in the range 2^64 to 2^-64 (there-about). + string t = "-3.40282347E+38"; // float.MinValue + Assert.AreEqual(float.MinValue, float.Parse(t), "Testing float min value parse"); + + t = "3.40282347E+38"; // float.MaxValue + Assert.AreEqual(float.MaxValue, float.Parse(t), "Testing float max value parse"); + } + + [TestMethod] + public void ParseFloat_Test_Invalid_Values() + { + string[] strArr = new string[] { + "", + " ", + " ", + "-0e-a", + "+123a4", + " +123f.1", + "123ea2", + "1.111.1", + " -123-e3", + " 123.456 777", + "1234567ee73", + " +1234e-77+", + "++1", + "--1", + "+1+", + " .1123abc", + " .123+456", + "+123e++10", + "+123e--10", + "-123e++10" + }; + + for (int i = 0; i < strArr.Length; i++) + { + OutputHelper.WriteLine($"parse {strArr[i]}"); + + Assert.ThrowsException(typeof(FormatException), + () => { float.Parse(strArr[i]); }, + $"Should throw exception of type FormatExeception while parsing string: '{strArr[i]}'"); + + Assert.IsFalse(float.TryParse(strArr[i], out float _), $"TryParse should return false while parsing string: '{strArr[i]}'"); + } + } + + [TestMethod] + public void ParseFloat_OverflowTests() + { + // Note we have to check hex values - again, the ToString() works over a subset of the range for double/float, and returns 'oor' or '-oor' for anything outside that range + string t = "-3.40282380E+38"; + Assert.AreEqual(float.NegativeInfinity, float.Parse(t), "High negative values should return float.NegativeInfinity value when parsed"); + + t = "3.40282380E+38"; + Assert.AreEqual(float.PositiveInfinity, float.Parse(t), "High positive values should return float.PositiveInfinity value when parsed"); + } + + private void CheckUValues(ulong start) + { + for (ulong i = start - 10; i < start + 10; i++) + { + ulong newVal = ulong.Parse(i.ToString()); + + Assert.IsTrue(ulong.TryParse(i.ToString(), out ulong result), $"TryParse failed for {i.ToString()} expecting: {newVal}"); + Assert.AreEqual(newVal, result); + + Assert.AreEqual(i, newVal); + } + } + + //========================================================================================= + // BoundaryTests + + + [TestMethod] + public void SByte_Boundary_Test_9() + { + + string[] strArr = new string[] { sbyte.MaxValue.ToString(), "127", sbyte.MinValue.ToString(), "-128" }; + sbyte[] _SByte = new sbyte[] { 127, 127, -128, -128 }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(sbyte.Parse(strArr[i]), _SByte[i]); + + Assert.IsTrue(sbyte.TryParse(strArr[i], out sbyte result), $"TryParse failed for {strArr[i]} expecting: {_SByte[i]}"); + Assert.AreEqual(_SByte[i], result); + } + } + + [TestMethod] + public void Byte_Boundary_Test_10() + { + string[] strArr = new string[] { byte.MaxValue.ToString(), "255", byte.MinValue.ToString(), "0" }; + byte[] _byte = new byte[] { 255, 255, 0, 0 }; + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(byte.Parse(strArr[i]), _byte[i]); + + Assert.IsTrue(byte.TryParse(strArr[i], out byte result), $"TryParse failed for {strArr[i]} expecting: {_byte[i]}"); + Assert.AreEqual(_byte[i], result); + } + } + + [TestMethod] + public void Int16_Boundary_Test_11() + { + string[] strArr = new string[] { short.MaxValue.ToString(), "32767", short.MinValue.ToString(), "-32768" }; + short[] _int16 = new short[] { 32767, 32767, -32768, -32768 }; + + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(short.Parse(strArr[i]), _int16[i]); + + Assert.IsTrue(short.TryParse(strArr[i], out short result), $"TryParse failed for {strArr[i]} expecting: {_int16[i]}"); + Assert.AreEqual(_int16[i], result); + } + } + + [TestMethod] + public void UInt16_Boundary_Test_12() + { + string[] strArr = new string[] { ushort.MaxValue.ToString(), "65535", ushort.MinValue.ToString(), "0" }; + ushort[] _uInt16 = new ushort[] { 65535, 65535, 0, 0 }; + + for (int i = 0; i < strArr.Length; i++) + { + Assert.IsTrue(ushort.TryParse(strArr[i], out ushort result), $"TryParse failed for {strArr[i]} expecting: {_uInt16[i]}"); + Assert.AreEqual(_uInt16[i], result); + + Assert.AreEqual(ushort.Parse(strArr[i]), _uInt16[i]); + } + } + + [TestMethod] + public void Int32_Boundary_Test_13() + { + string[] strArr = new string[] { int.MaxValue.ToString(), "2147483647", int.MinValue.ToString(), "-2147483648" }; + int[] _int32 = new int[] { 2147483647, 2147483647, -2147483648, -2147483648 }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.AreEqual(int.Parse(strArr[i]), _int32[i]); + + Assert.IsTrue(int.TryParse(strArr[i], out int result), $"TryParse failed for {strArr[i]} expecting: {_int32[i]}"); + Assert.AreEqual(_int32[i], result); + } + } + + [TestMethod] + public void UInt32_Boundary_Test_14() + { + string[] strArr = new string[] { uint.MaxValue.ToString(), "4294967295", uint.MinValue.ToString(), "0" }; + uint[] _uInt32 = new uint[] { 4294967295, 4294967295, 0, 0 }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.IsTrue(uint.TryParse(strArr[i], out uint result), $"TryParse failed for {strArr[i]} expecting: {_uInt32[i]}"); + Assert.AreEqual(_uInt32[i], result); + + Assert.AreEqual(uint.Parse(strArr[i]), _uInt32[i]); + } + } + + [TestMethod] + public void Int64_Boundary_Test_15() + { + string[] strArr = new string[] { long.MaxValue.ToString(), "9223372036854775807", long.MinValue.ToString(), "-9223372036854775808" }; + long[] _int64 = new long[] { 9223372036854775807, 9223372036854775807, -9223372036854775808, -9223372036854775808 }; + long temp = 0; + for (int i = 0; i < strArr.Length; i++) + { + temp = long.Parse(strArr[i]); + Assert.AreEqual(temp, _int64[i]); + } + } + + [TestMethod] + public void UInt64_Boundary_Test_16() + { + string[] strArr = new string[] { ulong.MaxValue.ToString(), "18446744073709551615", ulong.MinValue.ToString(), "0" }; + ulong[] _uInt64 = new ulong[] { 18446744073709551615, 18446744073709551615, 0, 0 }; + ulong temp = 0; + for (int i = 0; i < strArr.Length; i++) + { + temp = ulong.Parse(strArr[i]); + Assert.AreEqual(temp, _uInt64[i]); + } + } + + //============================================================================ + // ArgumentNullException tests + + public static string str = null; + + [TestMethod] + public void SByte_ArgumentNullException_Test_17() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { sbyte.Parse(str); }); + } + + [TestMethod] + public void SByte_TryParse_Test() + { + Assert.IsFalse(sbyte.TryParse(str, out sbyte _)); + } + + [TestMethod] + public void Byte_ArgumentNullException_Test_18() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { byte.Parse(str); }); + } + + [TestMethod] + public void Byte_TryParse_Test() + { + Assert.IsFalse(byte.TryParse(str, out byte _)); + } + + [TestMethod] + public void Int16_ArgumentNullException_Test_19() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { short.Parse(str); }); + } + + [TestMethod] + public void Int16_TryParse_Test() + { + Assert.IsFalse(short.TryParse(str, out short _)); + } + + [TestMethod] + public void UInt16_ArgumentNullException_Test_20() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { ushort.Parse(str); }); + } + + [TestMethod] + public void UInt16_TryParse_Test() + { + Assert.IsFalse(ushort.TryParse(str, out ushort _)); + } + + [TestMethod] + public void Int32_ArgumentNullException_Test_21() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { int.Parse(str); }); + } + + [TestMethod] + public void Int32_TryParse_Test() + { + Assert.IsFalse(int.TryParse(str, out int _)); + } + + [TestMethod] + public void UInt32_ArgumentNullException_Test_22() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { uint.Parse(str); }); + } + + [TestMethod] + public void UInt32_TryParse_Test() + { + Assert.IsFalse(uint.TryParse(str, out uint _)); + } + + [TestMethod] + public void Int64_ArgumentNullException_Test_23() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { long.Parse(str); }); + } + + [TestMethod] + public void Int64_TryParse_Test() + { + Assert.IsFalse(long.TryParse(str, out long _)); + } + + [TestMethod] + public void UInt64_ArgumentNullException_Test_24() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => { ulong.Parse(str); }); + } + + [TestMethod] + public void UInt64_TryParse_Test() + { + Assert.IsFalse(ulong.TryParse(str, out ulong _)); + } + + /// + /// Used to generate random string of specified length and type + /// + /// An integer specifying the length on the random string + /// A RandomType enum specifying random string type + /// random string + private static string GetRandomString() + { + // Negative numbers indicate a random string length of 10-20 is desired. + Random s_random = new Random(); + int length = 10 + s_random.Next(11); + + char[] chars = new char[length]; + for (int i = 0; i < length; i++) + { + switch (s_random.Next(3)) + { + case 0: + // Get a random char between ascii 65 and 90 (upper case alphabets). + chars[i] = (char)(65 + s_random.Next(26)); + break; + case 1: + // Get a random char between ascii 97 and 122 (lower case alphabets). + chars[i] = (char)(97 + s_random.Next(26)); + break; + case 2: + // Get a random number 0 - 9 + chars[i] = (char)('0' + s_random.Next(10)); + break; + } + } + + return new string(chars); + } + + //============================================================================ + // FormatException tests + + [TestMethod] + public void ParseSByte_FormatException_Test_25() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = sbyte.Parse(strArr[i]); }); + + Assert.IsFalse(sbyte.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = sbyte.Parse(rdmString); }); + + Assert.IsFalse(sbyte.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseByte_FormatException_Test_26() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = byte.Parse(strArr[i]); }, $"Value '{strArr[i]}' did not throw exception of type FormatException"); + + Assert.IsFalse(byte.TryParse(strArr[i], out _)); + } + + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = byte.Parse(rdmString); }, $"Random string '{rdmString}' did not throw exception of FormatException"); + + Assert.IsFalse(byte.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseInt16_FormatException_Test_27() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = short.Parse(strArr[i]); }); + + Assert.IsFalse(short.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = short.Parse(rdmString); }); + + Assert.IsFalse(short.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseUInt16_FormatException_Test_28() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = ushort.Parse(strArr[i]); }); + + Assert.IsFalse(ushort.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = ushort.Parse(rdmString); }); + + Assert.IsFalse(ushort.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseInt32_FormatException_Test_29() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = int.Parse(strArr[i]); }); + + Assert.IsFalse(int.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = int.Parse(rdmString); }); + + Assert.IsFalse(int.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseUInt32_FormatException_Test_30() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = uint.Parse(strArr[i]); }); + + Assert.IsFalse(uint.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = uint.Parse(rdmString); }); + + Assert.IsFalse(uint.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseInt64_FormatException_Test_31() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = long.Parse(strArr[i]); }); + + Assert.IsFalse(long.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = long.Parse(rdmString); }); + + Assert.IsFalse(long.TryParse(rdmString, out _)); + } + } + + [TestMethod] + public void ParseUInt64_FormatException_Test_32() + { + string[] strArr = new string[] { "", "1,234", "123e5", "a", "3.14159265358979" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(FormatException), () => { _ = ulong.Parse(strArr[i]); }); + + Assert.IsFalse(ulong.TryParse(strArr[i], out _)); + } + for (int i = 0; i < 5; i++) + { + string rdmString = GetRandomString(); + + Assert.ThrowsException(typeof(FormatException), () => { _ = ulong.Parse(rdmString); }); + + Assert.IsFalse(ulong.TryParse(rdmString, out _)); + } + } + + + //============================================================================ + // OverflowException tests + + + [TestMethod] + public void ParseSByte_OverflowException_Test_33() + { + string[] strArr = new string[] { ((long)sbyte.MinValue - 1).ToString(), ((long)sbyte.MinValue - 100).ToString(), + ((long)sbyte.MaxValue + 1).ToString(), ((long)sbyte.MaxValue + 100).ToString() }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = sbyte.Parse(strArr[i]); }, $"The value '{strArr[i]}' did not produce an exception type of ArgumentOutOfRange"); + + Assert.IsFalse(sbyte.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseByte_OverflowException_Test_34() + { + string[] strArr = new string[] { ((long)byte.MinValue - 1).ToString(), ((long)byte.MinValue - 100).ToString(), + ((long)byte.MaxValue + 1).ToString(), ((long)byte.MaxValue + 100).ToString() }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = byte.Parse(strArr[i]); }); + + Assert.IsFalse(byte.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseInt16_OverflowException_Test_35() + { + string[] strArr = new string[] { ((long)short.MinValue - 1).ToString(), ((long)short.MinValue - 100).ToString(), + ((long)short.MaxValue + 1).ToString(), ((long)short.MaxValue + 100).ToString() }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = short.Parse(strArr[i]); }); + + Assert.IsFalse(short.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseUInt16_OverflowException_Test_36() + { + string[] strArr = new string[] { ((long)ushort.MinValue - 1).ToString(), ((long)ushort.MinValue - 100).ToString(), + ((long)ushort.MaxValue + 1).ToString(), ((long)ushort.MaxValue + 100).ToString() }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = ushort.Parse(strArr[i]); }); + + Assert.IsFalse(ushort.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseInt32_OverflowException_Test_37() + { + string[] strArr = new string[] { ((long)int.MinValue - 1).ToString(), ((long)int.MinValue - 100).ToString(), + ((long)int.MaxValue + 1).ToString(), ((long)int.MaxValue + 100).ToString() }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = int.Parse(strArr[i]); }); + + Assert.IsFalse(int.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseUInt32_OverflowException_Test_38() + { + string[] strArr = new string[] { ((long)uint.MinValue - 1).ToString(), ((long)uint.MinValue - 100).ToString(), + ((long)uint.MaxValue + 1).ToString(), ((long)uint.MaxValue + 100).ToString() }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = uint.Parse(strArr[i]); }); + + Assert.IsFalse(uint.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseInt64_OverflowException_Test_39() + { + + string[] strArr = new string[] { "-9223372036854775809", "-9223372036854775900", + "9223372036854775808", "9223372036854775900" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = long.Parse(strArr[i]); }, $"An exception of type ArgumentOutOfRangeException was not thrown when values was {strArr[i]}"); + + Assert.IsFalse(long.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void ParseUInt64_OverflowException_Test_40() + { + string[] strArr = new string[] { "-1", "-100", "18446744073709551616", "18446744073709551700" }; + for (int i = 0; i < strArr.Length; i++) + { + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = ulong.Parse(strArr[i]); }); + + Assert.IsFalse(ulong.TryParse(strArr[i], out _)); + } + } + + [TestMethod] + public void Cast_Double_to_int64_Test_40() + { + double dbVal = new Random().Next(); + + // Convert to int and uint should keep the value + long l_val = (long)dbVal; + Assert.AreEqual(l_val, dbVal); + + ulong ul_val = (ulong)dbVal; + Assert.AreEqual(ul_val, dbVal); + + // Change sign to negative + dbVal = -dbVal; + + l_val = (long)dbVal; + Assert.AreEqual(l_val, dbVal); + + ul_val = (ulong)dbVal; + long ul_val_cast = (long)ul_val; + Assert.AreEqual(ul_val_cast, dbVal); + } + + + public enum MyEnum : short { Value = 25 } + public enum MyEnum1 { Value = 24 } + public enum MyEnum2 : short { Value = 23 } + + class CastTestClass + { + + } + + + [TestMethod] + public void box_unbox_Test_1() + { + // Creates objects for testing of different casts. + object o_enum = MyEnum.Value; + object o_enum1 = MyEnum1.Value; + object o_long = 24L; + object o_class = new CastTestClass(); + object o_guid = Guid.NewGuid(); + + // Try casts that shoud succeed. Any exception here means failure. + // First we try casts that should succeed. + // Casts between enums with the same basic type + MyEnum2 e2 = (MyEnum2)o_enum; // line 2 + // Cast from enum to primitive type that enum is based on + short sv = (short)o_enum; + Assert.AreEqual(sv, (short)MyEnum.Value); + + // Cast from enum to primitive type that enum is based on + int iv = (int)o_enum1; + Assert.AreEqual(iv, (short)MyEnum1.Value); + + int i_long = (int)(long)o_long; + CastTestClass cls = (CastTestClass)o_class; + Guid guid = (Guid)o_guid; + + // Now casts that should throw exception. Any cast that does not throw - means error. + Assert.ThrowsException(typeof(InvalidCastException), () => + { + MyEnum1 e1 = (MyEnum1)o_enum; + }, "Trying to cast incompatible enums - should throw InvalidCastException"); + + // Now casts that should throw exception. Any cast that does not throw - means error. + Assert.ThrowsException(typeof(InvalidCastException), () => + { + int i = (int)o_long; + }, "Trying to cast long to int - should throw InvalidCastException"); + + // Now casts that should throw exception. Any cast that does not throw - means error. + Assert.ThrowsException(typeof(InvalidCastException), () => + { + int i = (int)o_class; + }, "Trying to cast object to int - should throw InvalidCastException"); + + // Now casts that should throw exception. Any cast that does not throw - means error. + Assert.ThrowsException(typeof(InvalidCastException), () => + { + int i = (int)o_enum; + }, "Trying to cast enum to int - should throw InvalidCastException"); + + // Now casts that should throw exception. Any cast that does not throw - means error. + Assert.ThrowsException(typeof(InvalidCastException), () => + { + int i = (int)o_guid; + }, "Trying to cast Guid to int - should throw InvalidCastException"); + } + } +} From 37c85de3f058bbe55f0515ebd0d39ce343a9a92a Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Tue, 28 Jan 2025 18:58:31 -0800 Subject: [PATCH 32/70] Add `ExcludeFromStubs` attribute (#220) ***NO_CI*** (cherry picked from commit d291a827d64baa65b388b31fa4e9032543fcec99) --- .../CoreLibrary.NoReflection.nfproj | 1 + nanoFramework.CoreLibrary/CoreLibrary.nfproj | 1 + .../System/AttributeTargets.cs | 6 +++++- .../System/AttributeUsageAttribute.cs | 6 +++++- .../System/CLSCompliantAttribute.cs | 6 +++++- .../EditorBrowsableAttribute.cs | 4 ++++ nanoFramework.CoreLibrary/System/DBNull.cs | 6 +++++- .../Diagnostics/ConditionalAttribute.cs | 6 +++++- .../System/Diagnostics/DebuggerAttributes.cs | 20 +++++++++++++++---- .../System/FlagsAttribute.cs | 7 ++++++- .../System/NonSerializedAttribute.cs | 3 +++ .../System/ObsoleteAttribute.cs | 8 +++++--- .../System/ParamArrayAttribute.cs | 3 +++ .../System/Reflection/AssemblyAttributes.cs | 10 ++++++++++ .../AssemblyReflectionAttributes.cs | 11 ++++++++++ .../System/Reflection/BindingFlags.cs | 6 +++++- .../Reflection/DefaultMemberAttribute.cs | 6 +++++- .../Reflection/FieldReflectionAttributes.cs | 3 +++ .../System/Reflection/MethodImplAttributes.cs | 3 +++ .../ExcludeFromStubsAttribute.cs | 12 +++++++++++ .../CompilerServices/IndexerNameAttribute.cs | 4 +++- .../InternalsVisibleToAttribute.cs | 1 + .../CompilerServices/MethodImplAttribute.cs | 2 ++ .../Runtime/InteropServices/Attributes.cs | 6 ++++++ .../System/Runtime/InteropServices/CharSet.cs | 3 +++ .../Runtime/InteropServices/LayoutKind.cs | 3 +++ .../Runtime/Remoting/__TransparentProxy.cs | 6 +++++- .../System/SerializableAttribute.cs | 3 +++ .../System/ThreadAttributes.cs | 4 ++++ .../System/TypedReference.cs | 7 ++++++- nanoFramework.CoreLibrary/System/UIntPtr.cs | 6 +++++- 31 files changed, 154 insertions(+), 19 deletions(-) create mode 100644 nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 130979ee..091dba68 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -169,6 +169,7 @@ + diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index 25f65143..adb8b013 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -167,6 +167,7 @@ + diff --git a/nanoFramework.CoreLibrary/System/AttributeTargets.cs b/nanoFramework.CoreLibrary/System/AttributeTargets.cs index 31d1deb4..9a9b6937 100644 --- a/nanoFramework.CoreLibrary/System/AttributeTargets.cs +++ b/nanoFramework.CoreLibrary/System/AttributeTargets.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Specifies the application elements on which it is valid to apply an attribute. /// - [Flags, Serializable] + [ExcludeFromStubs] + [Flags] + [Serializable] public enum AttributeTargets { /// diff --git a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs index 1af0c3bf..af7c6189 100644 --- a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs +++ b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Specifies the usage of another attribute class. This class cannot be inherited. /// - [AttributeUsage(AttributeTargets.Class), Serializable] + [AttributeUsage(AttributeTargets.Class)] + [ExcludeFromStubs] + [Serializable] public sealed class AttributeUsageAttribute : Attribute { internal AttributeTargets _attributeTarget; diff --git a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs index 5ec3b70f..1afa16e8 100644 --- a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs +++ b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates whether a program element is compliant with the Common Language Specification (CLS). This class cannot be inherited. /// - [AttributeUsage(AttributeTargets.All), Serializable] + [AttributeUsage(AttributeTargets.All)] + [ExcludeFromStubs] + [Serializable] public sealed class CLSCompliantAttribute : Attribute { private bool _compliant; diff --git a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs index 45362efa..1d6f7acc 100644 --- a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs @@ -3,6 +3,9 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +using System.Runtime.CompilerServices; + namespace System.ComponentModel { using System; @@ -30,6 +33,7 @@ public enum EditorBrowsableState /// Specifies that a property or method is viewable in an editor. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate)] + [ExcludeFromStubs] #pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode() /////////////////////////////////////////////////////////////////////////////////////////////////////// // GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode // diff --git a/nanoFramework.CoreLibrary/System/DBNull.cs b/nanoFramework.CoreLibrary/System/DBNull.cs index a87821e0..962443a6 100644 --- a/nanoFramework.CoreLibrary/System/DBNull.cs +++ b/nanoFramework.CoreLibrary/System/DBNull.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System { /// /// Represents a nonexistent value. This class cannot be inherited. /// - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] public sealed class DBNull { diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs index 9a99beaf..cdee8dbc 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Diagnostics { /// /// Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined. /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true), Serializable] + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + [ExcludeFromStubs] + [Serializable] public sealed class ConditionalAttribute : Attribute { private readonly String _conditionString; diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs index 88222b39..6bcc97fd 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Diagnostics { using System; @@ -15,7 +17,9 @@ namespace System.Diagnostics /// Designer provided types and members that are not part of the code specifically created by the user can complicate the debugging experience. This attribute suppresses the display of these adjunct types and members in the debugger window and automatically steps through, rather than into, designer provided code. When the debugger encounters this attribute when stepping through user code, the user experience is to not see the designer provided code and to step to the next user-supplied code statement. /// The debugger behaviour when the is present is similar to using a combination of the attribute, which hides the code from the debugger, and the attribute, which tells the debugger to step through, rather than into, the code it is applied to. /// - [Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerStepThroughAttribute : Attribute { /// @@ -30,7 +34,9 @@ public DebuggerStepThroughAttribute() { } /// /// The attribute is used as an escape from the effect of a . When executing within the boundaries of the , designer-provided code is executed as a step-through until the next user supplied code is encountered. When context switches are made on a thread, the next user-supplied code module stepped into may not relate to the code that was in the process of being debugged. To avoid this debugging experience, use the to escape from stepping through code to running code. For example, in Visual Studio 2005, encountering a while stepping through code using the F10 key (or Step Over command) has the same effect as pressing the F5 key or using the Start Debugging command. /// - [Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerStepperBoundaryAttribute : Attribute { /// @@ -45,7 +51,9 @@ public DebuggerStepperBoundaryAttribute() { } /// /// The common language runtime attaches no semantics to this attribute. It is provided for use by source code debuggers. For example, the Visual Studio 2005 debugger does not stop in a method marked with this attribute and does not allow a breakpoint to be set in the method. Other debugger attributes recognized by the Visual Studio 2005 debugger are the and the . /// - [Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerHiddenAttribute : Attribute { /// @@ -61,7 +69,9 @@ public DebuggerHiddenAttribute() { } /// Designer provided types and members that are not part of the code specifically created by the user can complicate the debugging experience. This attribute suppresses the display of these adjunct types and members in the debugger window and automatically steps through, rather than into, designer provided code. When the debugger encounters this attribute when stepping through user code, the user experience is to not see the designer provided code and to step to the next user-supplied code statement. /// The debugger behaviour when the is present is similar to using a combination of the attribute, which hides the code from the debugger, and the attribute, which tells the debugger to step through, rather than into, the code it is applied to. /// - [Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerNonUserCodeAttribute : Attribute { /// @@ -233,6 +243,7 @@ public DebuggerBrowsableState State /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] + [ExcludeFromStubs] public sealed class DebuggerTypeProxyAttribute : Attribute { private readonly string _typeName; @@ -318,6 +329,7 @@ public string TargetTypeName /// Determines how a class or field is displayed in the debugger variable windows. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Assembly, AllowMultiple = true)] + [ExcludeFromStubs] public sealed class DebuggerDisplayAttribute : Attribute { private string _name; diff --git a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs index a26bbc25..b64a1740 100644 --- a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs +++ b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs @@ -3,12 +3,17 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that an enumeration can be treated as a bit field; that is, a set of flags. /// - [AttributeUsage(AttributeTargets.Enum), Serializable] + [AttributeUsage(AttributeTargets.Enum)] + [ExcludeFromStubs] + [Serializable] public class FlagsAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs index 9bc87970..d3833c93 100644 --- a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs +++ b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { @@ -11,6 +13,7 @@ namespace System /// Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Field)] + [ExcludeFromStubs] public sealed class NonSerializedAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs index c9654ab6..bcc03f15 100644 --- a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs @@ -4,14 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Marks the program elements that are no longer in use. This class cannot be inherited. /// - [Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | - AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate - , Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event |AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class ObsoleteAttribute : Attribute { private readonly String _message; diff --git a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs index 18f95880..8d9d667a 100644 --- a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Parameter)] + [ExcludeFromStubs] public sealed class ParamArrayAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs index 1ba39007..93f21f8f 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { using System; @@ -12,6 +14,7 @@ namespace System.Reflection /// Specifies which culture the assembly supports. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyCultureAttribute : Attribute { private readonly String _culture; @@ -41,6 +44,7 @@ public String Culture /// Specifies the version of the assembly being attributed. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyVersionAttribute : Attribute { private readonly String _version; @@ -70,6 +74,7 @@ public String Version /// Specifies the name of a file containing the key pair used to generate a strong name. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyKeyFileAttribute : Attribute { private readonly String _keyFile; @@ -99,6 +104,7 @@ public String KeyFile /// Specifies the name of a key container within the CSP containing the key pair used to generate a strong name. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyKeyNameAttribute : Attribute { private readonly String _keyName; @@ -128,6 +134,7 @@ public String KeyName /// Specifies that the assembly is not fully signed when created. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyDelaySignAttribute : Attribute { private readonly bool _delaySign; @@ -160,6 +167,7 @@ public bool DelaySign /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyFlagsAttribute : Attribute { private readonly AssemblyNameFlags _flags; @@ -203,6 +211,7 @@ public AssemblyFlagsAttribute(AssemblyNameFlags assemblyFlags) /// Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyFileVersionAttribute : Attribute { private readonly String _version; @@ -238,6 +247,7 @@ public String Version /// This attribute is specific of nanoFramework. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, Inherited = false)] + [ExcludeFromStubs] public sealed class AssemblyNativeVersionAttribute : Attribute { private readonly String _nativeVersion; diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs index c6fb1810..a7a87d07 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { using System; @@ -12,6 +14,7 @@ namespace System.Reflection /// Defines a copyright custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyCopyrightAttribute : Attribute { private readonly String _copyright; @@ -41,6 +44,7 @@ public String Copyright /// Defines a trademark custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyTrademarkAttribute : Attribute { private readonly String _trademark; @@ -70,6 +74,7 @@ public String Trademark /// Defines a product name custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyProductAttribute : Attribute { private readonly String _product; @@ -99,6 +104,7 @@ public String Product /// Defines a company name custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyCompanyAttribute : Attribute { private readonly String _company; @@ -128,6 +134,7 @@ public String Company /// Provides a text description for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyDescriptionAttribute : Attribute { private readonly String _description; @@ -157,6 +164,7 @@ public String Description /// Specifies a description for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyTitleAttribute : Attribute { private readonly String _title; @@ -186,6 +194,7 @@ public String Title /// Specifies the build configuration, such as retail or debug, for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyConfigurationAttribute : Attribute { private readonly String _configuration; @@ -215,6 +224,7 @@ public String Configuration /// Defines a friendly default alias for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyDefaultAliasAttribute : Attribute { private readonly String _defaultAlias; @@ -244,6 +254,7 @@ public String DefaultAlias /// Defines additional version information for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyInformationalVersionAttribute : Attribute { private readonly String _informationalVersion; diff --git a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs index 304b1d29..d2780308 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + #if NANOCLR_REFLECTION namespace System.Reflection @@ -13,7 +15,9 @@ namespace System.Reflection /// Specifies flags that control binding and the way in which the search for members and types is conducted by reflection. /// /// Available only in mscorlib build with support for System.Reflection. - [Flags, Serializable] + [Flags] + [ExcludeFromStubs] + [Serializable] public enum BindingFlags { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs index c171b98c..ccb817ae 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + #if NANOCLR_REFLECTION namespace System.Reflection @@ -14,7 +16,9 @@ namespace System.Reflection /// Defines the member of a type that is the default member used by InvokeMember. /// /// Available only in mscorlib build with support for System.Reflection. - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface), Serializable] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)] + [ExcludeFromStubs] + [Serializable] public sealed class DefaultMemberAttribute : Attribute { private readonly String _memberName; diff --git a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs index b196efbe..51ff343c 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs @@ -4,9 +4,12 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { [AttributeUsage(AttributeTargets.Field)] + [ExcludeFromStubs] internal sealed class FieldNoReflectionAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs index 0a98d172..8b8ca92c 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { using System; @@ -11,6 +13,7 @@ namespace System.Reflection /// /// Specifies flags for the attributes of a method implementation. /// + [ExcludeFromStubs] [Serializable] public enum MethodImplAttributes { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs new file mode 100644 index 00000000..cf9fcb2b --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace System.Runtime.CompilerServices +{ + /// + /// When a class, enum, or struct is marked with it will be excluded from the native stubs generated by .NET nanoFramework metadata processor. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] + public class ExcludeFromStubsAttribute: Attribute + { + } +} diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs index 2ea7e4b6..c01beb1f 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs @@ -9,7 +9,9 @@ namespace System.Runtime.CompilerServices /// /// Indicates the name by which an indexer is known in programming languages that do not support indexers directly. /// - [Serializable, AttributeUsage(AttributeTargets.Property)] + [AttributeUsage(AttributeTargets.Property)] + [ExcludeFromStubs] + [Serializable] public sealed class IndexerNameAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs index da3e5a8e..1990a8ed 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs @@ -10,6 +10,7 @@ namespace System.Runtime.CompilerServices /// Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly. /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + [ExcludeFromStubs] public sealed class InternalsVisibleToAttribute : Attribute { private readonly string _assemblyName; diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs index 00defffa..eb122e5a 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs @@ -9,6 +9,7 @@ namespace System.Runtime.CompilerServices /// /// Defines the details of how a method is implemented. /// + [ExcludeFromStubs] [Serializable] public enum MethodImplOptions { @@ -42,6 +43,7 @@ public enum MethodImplOptions /// /// Defines how a method is implemented. /// + [ExcludeFromStubs] [Serializable] public enum MethodCodeType { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs index 2f543ce7..7beb9512 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Runtime.InteropServices { /// /// Controls accessibility of an individual managed type or member, or of all types within an assembly, to COM. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, Inherited = false)] + [ExcludeFromStubs] public sealed class ComVisibleAttribute : Attribute { internal bool _val; @@ -36,6 +39,7 @@ public ComVisibleAttribute(bool visibility) /// Supplies an explicit System.Guid when an automatic GUID is undesirable. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Delegate, Inherited = false)] + [ExcludeFromStubs] public sealed class GuidAttribute : Attribute { internal String Val; @@ -62,6 +66,7 @@ public GuidAttribute(String guid) /// Indicates that data should be marshaled from callee back to caller. /// [AttributeUsage(AttributeTargets.Parameter)] + [ExcludeFromStubs] public sealed class OutAttribute : Attribute { } @@ -70,6 +75,7 @@ public sealed class OutAttribute : Attribute /// Lets you control the physical layout of the data fields of a class or structure in memory. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] + [ExcludeFromStubs] public sealed class StructLayoutAttribute : Attribute { internal LayoutKind Val; diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs index 3559023c..01b3d8d9 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs @@ -4,11 +4,14 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Runtime.InteropServices { /// /// Dictates which character set marshaled strings should use. /// + [ExcludeFromStubs] [Serializable] public enum CharSet { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs index b7dd2704..fbeb0a2d 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs @@ -4,11 +4,14 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Runtime.InteropServices { /// /// Controls the layout of an object when exported to unmanaged code. /// + [ExcludeFromStubs] [Serializable] public enum LayoutKind { diff --git a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs index b0a494f6..c6d92f9f 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs @@ -4,9 +4,13 @@ // See LICENSE file in the project root for full license information. // +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System.Runtime.Remoting.Proxies { - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] internal sealed class __TransparentProxy { } diff --git a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs index d8543808..8fde1875 100644 --- a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that a class can be serialized. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] + [ExcludeFromStubs] public sealed class SerializableAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs index d5708d3b..85eb49bb 100644 --- a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs +++ b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that the COM threading model for an application is single-threaded apartment (STA). /// [AttributeUsage(AttributeTargets.Method)] + [ExcludeFromStubs] public sealed class STAThreadAttribute : Attribute { /// @@ -24,6 +27,7 @@ public STAThreadAttribute() /// Indicates that the COM threading model for an application is multithreaded apartment (MTA). /// [AttributeUsage(AttributeTargets.Method)] + [ExcludeFromStubs] public sealed class MTAThreadAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/TypedReference.cs b/nanoFramework.CoreLibrary/System/TypedReference.cs index 310611e9..28e8f30c 100644 --- a/nanoFramework.CoreLibrary/System/TypedReference.cs +++ b/nanoFramework.CoreLibrary/System/TypedReference.cs @@ -3,13 +3,18 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System { /// /// Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location. /// - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] public struct TypedReference { } } diff --git a/nanoFramework.CoreLibrary/System/UIntPtr.cs b/nanoFramework.CoreLibrary/System/UIntPtr.cs index 613d1212..1d20096a 100644 --- a/nanoFramework.CoreLibrary/System/UIntPtr.cs +++ b/nanoFramework.CoreLibrary/System/UIntPtr.cs @@ -4,13 +4,17 @@ // See LICENSE file in the project root for full license information. // +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System { /// /// A platform-specific type that is used to represent a pointer or a handle. /// + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] [Serializable] - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] public struct UIntPtr { } From cce6f77f648ea641d685f416e6a69f30f012170a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 29 Jan 2025 03:26:47 +0000 Subject: [PATCH 33/70] Rework datetime handling in Convert (#222) ***NO_CI*** (cherry picked from commit 717def91fe3cd0ea67401551687c3762e8208c4e) --- nanoFramework.CoreLibrary/System/Convert.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Convert.cs b/nanoFramework.CoreLibrary/System/Convert.cs index 3957fc54..91ddf010 100644 --- a/nanoFramework.CoreLibrary/System/Convert.cs +++ b/nanoFramework.CoreLibrary/System/Convert.cs @@ -38,7 +38,7 @@ public static class Convert internal static extern double NativeToDouble(string value, bool throwException, out bool success); [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern DateTime NativeToDateTime(string value, bool throwException, out bool success); + internal static extern void NativeToDateTime(string value, bool throwException, out bool success, out DateTime result); /// /// Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value. @@ -177,10 +177,13 @@ public static byte ToByte(bool value) /// public static DateTime ToDateTime(string value) { - return NativeToDateTime( + NativeToDateTime( value, true, - out _); + out _, + out DateTime result); + + return result; } /// From 0051e0f5ee6fadff3952f35fe0da8371af224967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 29 Jan 2025 03:27:10 +0000 Subject: [PATCH 34/70] Fix `UtcNow` and `Today` (#221) ***NO_CI*** (cherry picked from commit 25908c2399c9f7862d69c641c436ea1ce4cbd608) --- nanoFramework.CoreLibrary/System/DateTime.cs | 29 ++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/DateTime.cs b/nanoFramework.CoreLibrary/System/DateTime.cs index b6b21567..7d67ae78 100644 --- a/nanoFramework.CoreLibrary/System/DateTime.cs +++ b/nanoFramework.CoreLibrary/System/DateTime.cs @@ -82,9 +82,12 @@ public enum DateTimeKind #endif // NANOCLR_REFLECTION public struct DateTime { - /// Our origin is at 1601/01/01:00:00:00.000 - /// While desktop CLR's origin is at 0001/01/01:00:00:00.000. - /// There are 504911232000000000 ticks between them which we are subtracting. + // Our origin is at 1601/01/01:00:00:00.000 + // While desktop CLR's origin is at 0001/01/01:00:00:00.000. + // There are 504911232000000000 ticks between them which we are subtracting. + ////////////////////////////////////////////////////////////////////////////////////////// + /// Keep in sync with native define TICKS_AT_ORIGIN @ corlib_native_System_DateTime.cpp // + ////////////////////////////////////////////////////////////////////////////////////////// [DebuggerBrowsable(DebuggerBrowsableState.Never)] private const long _ticksAtOrigin = 504911232000000000; @@ -195,7 +198,7 @@ public DateTime(long ticks) /// nanoFramework doesn't support local time, only UTC, so it's not possible to specify . /// public DateTime(long ticks, DateTimeKind kind) - :this(ticks) + : this(ticks) { // it's OK to check kind parameter only here // if it's invalid the exception will be thrown anyway and allows the constructor to be reused @@ -505,8 +508,7 @@ public int Month /// public static DateTime UtcNow { - [MethodImpl(MethodImplOptions.InternalCall)] - get => new DateTime(); + get => new DateTime(GetUtcNowAsTicks(), DateTimeKind.Utc); } /// @@ -556,8 +558,7 @@ public TimeSpan TimeOfDay /// public static DateTime Today { - [MethodImpl(MethodImplOptions.InternalCall)] - get => new DateTime(); + get => new DateTime(GetTodayAsTicks(), DateTimeKind.Utc); } /// @@ -826,10 +827,10 @@ public static bool TryParse( string s, out DateTime result) { - result = Convert.NativeToDateTime( - s, + Convert.NativeToDateTime(s, false, - out bool success); + out bool success, + out result); return success; } @@ -839,5 +840,11 @@ public static bool TryParse( [MethodImpl(MethodImplOptions.InternalCall)] private extern int GetDateTimePart(DateTimePart part); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern static long GetUtcNowAsTicks(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private extern static long GetTodayAsTicks(); } } From 6789454d7c2da27e463398f3ddd789258f1e9fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 29 Jan 2025 04:16:30 +0000 Subject: [PATCH 35/70] Remove unused files ***NO_CI*** (cherry picked from commit 545481991435c0bff0b513b6ae5b24ceb2919791) --- .github_changelog_generator | 13 ------- config/SignClient.json | 14 ------- config/filelist.txt | 2 - template.vssettings | 74 ------------------------------------- 4 files changed, 103 deletions(-) delete mode 100644 .github_changelog_generator delete mode 100644 config/SignClient.json delete mode 100644 config/filelist.txt delete mode 100644 template.vssettings diff --git a/.github_changelog_generator b/.github_changelog_generator deleted file mode 100644 index b445f956..00000000 --- a/.github_changelog_generator +++ /dev/null @@ -1,13 +0,0 @@ -user=nanoframework -project=CoreLibrary -issues=true -add_issues_wo_labels=false -add_pr_wo_labels=false -add_issues_wo_labels=false -filter_issues_by_milestone=false -exclude_labels=Area: Config-and-Build,Area: Infrastructure-and-Organization,reverted -enhancement_labels=Type: enhancement -bug_labels=Type: bug -merge_prefix=**Documentation and other chores:** -unreleased_label=**Changes available only in 'Preview' NuGet packages:** -author=false diff --git a/config/SignClient.json b/config/SignClient.json deleted file mode 100644 index 482177d3..00000000 --- a/config/SignClient.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "SignClient": { - "AzureAd": { - "AADInstance": "https://login.microsoftonline.com/", - "ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8", - "TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e" - }, - "Service": { - "Url": "https://codesign.dotnetfoundation.org/", - "ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001" - } - } - } - \ No newline at end of file diff --git a/config/filelist.txt b/config/filelist.txt deleted file mode 100644 index d337471a..00000000 --- a/config/filelist.txt +++ /dev/null @@ -1,2 +0,0 @@ -**/nanoFramework.CoreLibrary.* -**/nanoFramework.CoreLibrary.NoReflection.* \ No newline at end of file diff --git a/template.vssettings b/template.vssettings deleted file mode 100644 index 04850706..00000000 --- a/template.vssettings +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - 4 - false - 4 - true - - - 1 - 0 - 1 - 1 - 1 - 1 - 1 - 2 - 1 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 1 - 0 - 1 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 0 - 0 - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - - - - From cd5be82c3fd9f2815a4f6a983cc5fd40e0d27b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 29 Jan 2025 04:18:08 +0000 Subject: [PATCH 36/70] Work CI-CD - Updated AZDO trigger exclude list. - Remove tags as AZDO trigger. - Remove Azure private feed from nuget config. ***NO_CI*** (cherry picked from commit 7f1030befc9057fe986fbb581cb5bc9a5fc78979) --- NuGet.Config | 1 - azure-pipelines.yml | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index ef0bacfd..b02a9811 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -2,6 +2,5 @@ - diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1b7d4f3a..4becb72c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,17 +11,16 @@ trigger: exclude: - .github_changelog_generator - .gitignore + - .gitattributes + - .gitmodules + - .github/* - CHANGELOG.md - - CODE_OF_CONDUCT.md - LICENSE.md - README.md - NuGet.Config - assets/* - config/* - - .github/* - tags: - include: - - v* + - nanoFramework.TestFramework/* # PR always trigger build pr: From c33f1eabd562d3370f44d6e70c301b9200f01da2 Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Wed, 29 Jan 2025 04:43:43 -0800 Subject: [PATCH 37/70] Moving attributes from System.Runtime (#219) ***NO_CI*** (cherry picked from commit db43573874ce6d531c2b4f33f9a4445a71f89498) --- .../CallerArgumentExpressionAttributeTests.cs | 68 ++++++ .../CallerMemberNameAttributeTests.cs | 23 +++ .../NFUnitTestAttributes.nfproj | 3 + .../CoreLibrary.NoReflection.nfproj | 44 +++- nanoFramework.CoreLibrary/CoreLibrary.nfproj | 44 +++- .../CodeAnalysis/NullableAttributes.cs | 193 ++++++++++++++++++ .../CallerArgumentExpressionAttribute.cs | 28 +++ .../CallerMemberNameAttribute.cs | 21 ++ 8 files changed, 422 insertions(+), 2 deletions(-) create mode 100644 Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs create mode 100644 Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs create mode 100644 nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs create mode 100644 nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs create mode 100644 nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs diff --git a/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs b/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs new file mode 100644 index 00000000..0690fdaa --- /dev/null +++ b/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs @@ -0,0 +1,68 @@ +using System.Runtime.CompilerServices; +using nanoFramework.TestFramework; + +namespace NFUnitTestAttributes +{ + [TestClass] + public class CallerArgumentExpressionAttributeTests + { + public string Field = "Field value"; + + public string Property => "Property value"; + + [TestMethod] + public void CallerArgumentExpressionSetsParameterNameFromField() + { + var sut = new CallerArgumentExpressionAttributeTests(); + const string expect = "sut.Field"; + var actual = TestCallerArgumentExpression(sut.Field); + + Assert.AreEqual(expect, actual); + } + + [TestMethod] + public void CallerArgumentExpressionSetsParameterNameFromMethodParameter() + { + const string expect = "methodParameter"; + var actual = TestMethodParameter("Method parameter value"); + + Assert.AreEqual(expect, actual); + } + + [TestMethod] + public void CallerArgumentExpressionSetsParameterNameFromNull() + { + const string expect = "null"; + var actual = TestCallerArgumentExpression(null); + + Assert.AreEqual(expect, actual); + } + + [TestMethod] + public void CallerArgumentExpressionSetsParameterNameFromProperty() + { + var sut = new CallerArgumentExpressionAttributeTests(); + const string expect = "sut.Property"; + var actual = TestCallerArgumentExpression(sut.Property); + + Assert.AreEqual(expect, actual); + } + + [TestMethod] + public void CallerArgumentExpressionSetsParameterNameFromVariable() + { + const string variableName = "Variable value"; + const string expect = nameof(variableName); + var actual = TestCallerArgumentExpression(variableName); + + Assert.AreEqual(expect, actual); + } + + // ReSharper disable once EntityNameCapturedOnly.Local +#pragma warning disable IDE0060 + private static string TestCallerArgumentExpression(object objectValue, [CallerArgumentExpression(nameof(objectValue))] string parameterName = null) => parameterName; +#pragma warning restore IDE0060 + + private static string TestMethodParameter(string methodParameter) => TestCallerArgumentExpression(methodParameter); + } +} diff --git a/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs b/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs new file mode 100644 index 00000000..b94bb9d3 --- /dev/null +++ b/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs @@ -0,0 +1,23 @@ +using System.Runtime.CompilerServices; +using nanoFramework.TestFramework; + +namespace NFUnitTestAttributes +{ + [TestClass] + public class CallerMemberNameAttributeTests + { + [TestMethod] + public void CallerMemberNameAttributeGetsCallerMemberName() + { + const string expect = nameof(CallerMemberNameAttributeGetsCallerMemberName); + var actual = TestCallerMemberName(); + + Assert.AreEqual(expect, actual); + } + + // ReSharper disable once EntityNameCapturedOnly.Local +#pragma warning disable IDE0060 + private static string TestCallerMemberName([CallerMemberName] string memberName = null) => memberName; +#pragma warning restore IDE0060 + } +} diff --git a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj index c450a9a8..b310b5e6 100644 --- a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj +++ b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj @@ -21,9 +21,12 @@ true UnitTest v1.0 + default + + diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 091dba68..43cc7626 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -92,6 +92,7 @@ + @@ -170,6 +171,8 @@ + + @@ -242,6 +245,39 @@ false + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + false @@ -341,6 +377,12 @@ false + + false + + + false + false @@ -426,4 +468,4 @@ - \ No newline at end of file + diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index adb8b013..f8d775dc 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -166,6 +166,8 @@ + + @@ -178,6 +180,7 @@ + @@ -234,6 +237,39 @@ false + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + false @@ -336,7 +372,13 @@ false - + + false + + + false + + false diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs new file mode 100644 index 00000000..e5f971e7 --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs @@ -0,0 +1,193 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace System.Diagnostics.CodeAnalysis +{ + /// + /// Specifies that is allowed as an input even if the corresponding type disallows it. + /// + /// + /// To override a method that has a parameter annotated with this attribute, use the ? operator. For more information, see Nullable static analysis in the C# guide. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] + [ExcludeFromStubs] + public sealed class AllowNullAttribute : Attribute + { } + + /// + /// Specifies that null is disallowed as an input even if the corresponding type allows it. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] + [ExcludeFromStubs] + public sealed class DisallowNullAttribute : Attribute + { } + + /// + /// Specifies that an output may be null even if the corresponding type disallows it. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] + [ExcludeFromStubs] + public sealed class MaybeNullAttribute : Attribute + { } + + /// + /// Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] + [ExcludeFromStubs] + public sealed class NotNullAttribute : Attribute + { } + + /// + /// Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [ExcludeFromStubs] + public sealed class MaybeNullWhenAttribute : Attribute + { + /// + /// Initializes the attribute with the specified return value condition. + /// + /// + /// The return value condition. If the method returns this value, the associated parameter may be null. + /// + public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; + + /// + /// Gets the return value condition. + /// + public bool ReturnValue { get; } + } + + /// + /// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. + /// + [ExcludeFromStubs] + public sealed class NotNullWhenAttribute : Attribute + { + /// Initializes the attribute with the specified return value condition. + /// + /// The return value condition. If the method returns this value, the associated parameter will not be null. + /// + public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; + + /// Gets the return value condition. + public bool ReturnValue { get; } + } + + /// + /// Specifies that the output will be non-null if the named parameter is non-null. + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] + [ExcludeFromStubs] + public sealed class NotNullIfNotNullAttribute : Attribute + { + /// Initializes the attribute with the associated parameter name. + /// + /// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null. + /// + public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName; + + /// Gets the associated parameter name. + public string ParameterName { get; } + } + + /// + /// Applied to a method that will never return under any circumstance. + /// + [AttributeUsage(AttributeTargets.Method, Inherited = false)] + [ExcludeFromStubs] + public sealed class DoesNotReturnAttribute : Attribute + { } + + /// + /// Specifies that the method will not return if the associated Boolean parameter is passed the specified value. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [ExcludeFromStubs] + public sealed class DoesNotReturnIfAttribute : Attribute + { + /// Initializes the attribute with the specified parameter value. + /// + /// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to + /// the associated parameter matches this value. + /// + public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue; + + /// + /// Gets the condition parameter value. + /// + public bool ParameterValue { get; } + } + + /// + /// Specifies that the method or property will ensure that the listed field and property members have not-null values. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] + [ExcludeFromStubs] + public sealed class MemberNotNullAttribute : Attribute + { + /// Initializes the attribute with a field or property member. + /// + /// The field or property member that is promised to be not-null. + /// + public MemberNotNullAttribute(string member) => Members = new[] { member }; + + /// Initializes the attribute with the list of field and property members. + /// + /// The list of field and property members that are promised to be not-null. + /// + public MemberNotNullAttribute(params string[] members) => Members = members; + + /// + /// Gets field or property member names. + /// + public string[] Members { get; } + } + + /// + /// Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] + [ExcludeFromStubs] + public sealed class MemberNotNullWhenAttribute : Attribute + { + /// Initializes the attribute with the specified return value condition and a field or property member. + /// + /// The return value condition. If the method returns this value, the associated parameter will not be null. + /// + /// + /// The field or property member that is promised to be not-null. + /// + public MemberNotNullWhenAttribute(bool returnValue, string member) + { + ReturnValue = returnValue; + Members = new[] { member }; + } + + /// Initializes the attribute with the specified return value condition and list of field and property members. + /// + /// The return value condition. If the method returns this value, the associated parameter will not be null. + /// + /// + /// The list of field and property members that are promised to be not-null. + /// + public MemberNotNullWhenAttribute(bool returnValue, params string[] members) + { + ReturnValue = returnValue; + Members = members; + } + + /// + /// Gets the return value condition. + /// + public bool ReturnValue { get; } + + /// + /// Gets field or property member names. + /// + public string[] Members { get; } + } +} diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs new file mode 100644 index 00000000..b911e9f9 --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// ReSharper disable once CheckNamespace +namespace System.Runtime.CompilerServices +{ + /// + /// Indicates that a parameter captures the expression passed for another parameter as a string. + /// + [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] + [ExcludeFromStubs] + public sealed class CallerArgumentExpressionAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// The name of the parameter whose expression should be captured as a string. + public CallerArgumentExpressionAttribute(string parameterName) + { + ParameterName = parameterName; + } + + /// + /// Gets the name of the parameter whose expression should be captured as a string. + /// + public string ParameterName { get; } + } +} diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs new file mode 100644 index 00000000..7b25ce51 --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// ReSharper disable once CheckNamespace +namespace System.Runtime.CompilerServices +{ + /// + /// Allows you to obtain the method or property name of the caller to the method. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [ExcludeFromStubs] + public sealed class CallerMemberNameAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public CallerMemberNameAttribute() + { + } + } +} From 65a78a040717a1e6471ca305ac5d4891651e2e3a Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Wed, 29 Jan 2025 10:52:02 -0800 Subject: [PATCH 38/70] Add null helpers to argument exceptions (#223) ***NO_CI*** (cherry picked from commit 6089c77dee3020f7c06d0c79803d4a6b02139502) --- .../CoreLibrary.NoReflection.nfproj | 1 + nanoFramework.CoreLibrary/CoreLibrary.nfproj | 1 + .../System/ArgumentException.cs | 108 +++++++++++++----- .../System/ArgumentNullException.cs | 56 +++++++-- nanoFramework.CoreLibrary/System/String.cs | 4 +- 5 files changed, 128 insertions(+), 42 deletions(-) diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 43cc7626..15fb4472 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -37,6 +37,7 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true true + default true diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index f8d775dc..c9cd189f 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -38,6 +38,7 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true true + default true diff --git a/nanoFramework.CoreLibrary/System/ArgumentException.cs b/nanoFramework.CoreLibrary/System/ArgumentException.cs index cf7eea6f..f7b4f70e 100644 --- a/nanoFramework.CoreLibrary/System/ArgumentException.cs +++ b/nanoFramework.CoreLibrary/System/ArgumentException.cs @@ -4,6 +4,10 @@ // See LICENSE file in the project root for full license information. // +#nullable enable +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + namespace System { /// @@ -12,54 +16,55 @@ namespace System [Serializable] public class ArgumentException : SystemException { - private String _paramName; + // ReSharper disable InconsistentNaming + private static readonly string Arg_ArgumentException = "Value does not fall within the expected range."; + private static readonly string Arg_ParamName_Name = "(Parameter '%s')"; + private static readonly string Argument_EmptyString = "The value cannot be an empty string."; + // ReSharper restore InconsistentNaming + + private readonly string? _paramName; /// - /// Initializes a new instance of the ArgumentException class. + /// Initializes a new instance of the class. /// - public ArgumentException() + public ArgumentException(): base(Arg_ArgumentException) { } /// - /// Initializes a new instance of the ArgumentException class with a specified error message. + /// Initializes a new instance of the class with a specified error message. /// - /// The error message that explains the reason for the exception. - public ArgumentException(String message) - : base(message) + /// The error message that explains the reason for the exception. + public ArgumentException(string? message) : base(message ?? Arg_ArgumentException) { } /// - /// Initializes a new instance of the ArgumentException class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. /// - /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - public ArgumentException(String message, Exception innerException) - : base(message, innerException) + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. + public ArgumentException(string? message, Exception? innerException) : base(message ?? Arg_ArgumentException, innerException) { } /// - /// Initializes a new instance of the ArgumentException class with a specified error message, the parameter name, and a reference to the inner exception that is the cause of this exception. + /// Initializes a new instance of the class with a specified error message and the name of the parameter that causes this exception. /// /// The error message that explains the reason for the exception. - /// The name of the parameter that caused the current exception. - /// The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - public ArgumentException(String message, String paramName, Exception innerException) - : base(message, innerException) + /// The name of the parameter that caused the current exception. + public ArgumentException(string? message, string? paramName) : base(message ?? Arg_ArgumentException) { _paramName = paramName; } /// - /// Initializes a new instance of the ArgumentException class with a specified error message and the name of the parameter that causes this exception. + /// Initializes a new instance of the class with a specified error message, the parameter name, and a reference to the inner exception that is the cause of this exception. /// - /// The error message that explains the reason for the exception. - /// The name of the parameter that caused the current exception. - public ArgumentException(String message, String paramName) - - : base(message) + /// The error message that explains the reason for the exception. + /// The name of the parameter that caused the current exception. + /// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. + public ArgumentException(string? message, string? paramName, Exception? innerException) : base(message ?? Arg_ArgumentException, innerException) { _paramName = paramName; } @@ -70,13 +75,16 @@ public ArgumentException(String message, String paramName) /// /// A text string describing the details of the exception. /// - public override String Message + public override string Message { get { var s = base.Message; - if (!(_paramName == null || _paramName.Length == 0)) - return s + "\n" + "Invalid argument " + "'" + _paramName + "'"; + if (!string.IsNullOrEmpty(_paramName)) + { + s += " " + string.Format(Arg_ParamName_Name, _paramName); + } + return s; } } @@ -84,13 +92,51 @@ public override String Message /// /// Gets the name of the parameter that causes this exception. /// - /// - /// The parameter name. - /// - public virtual String ParamName + /// The parameter name. + public virtual string? ParamName => _paramName; + + /// Throws an exception if is null or empty. + /// The string argument to validate as non-null and non-empty. + /// The name of the parameter with which corresponds. + /// is null. + /// is empty. + public static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) + { + if (string.IsNullOrEmpty(argument)) + { + ThrowNullOrEmptyException(argument, paramName); + } + } + + /* TODO: Implement when string.IsNullOrWhiteSpace exists + /// Throws an exception if is null, empty, or consists only of white-space characters. + /// The string argument to validate. + /// The name of the parameter with which corresponds. + /// is null. + /// is empty or consists only of white-space characters. + public static void ThrowIfNullOrWhiteSpace([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) { - get { return _paramName; } + if (string.IsNullOrWhiteSpace(argument)) + { + ThrowNullOrWhiteSpaceException(argument, paramName); + } } + */ + [DoesNotReturn] + private static void ThrowNullOrEmptyException(string? argument, string? paramName) + { + ArgumentNullException.ThrowIfNull(argument, paramName); + throw new ArgumentException(Argument_EmptyString, paramName); + } + + /* TODO: Implement when string.IsNullOrWhiteSpace exists + [DoesNotReturn] + private static void ThrowNullOrWhiteSpaceException(string? argument, string? paramName) + { + ArgumentNullException.ThrowIfNull(argument, paramName); + throw new ArgumentException(SR.Argument_EmptyOrWhiteSpaceString, paramName); + } + */ } } diff --git a/nanoFramework.CoreLibrary/System/ArgumentNullException.cs b/nanoFramework.CoreLibrary/System/ArgumentNullException.cs index 68f719cb..cc69f8e1 100644 --- a/nanoFramework.CoreLibrary/System/ArgumentNullException.cs +++ b/nanoFramework.CoreLibrary/System/ArgumentNullException.cs @@ -3,6 +3,11 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +#nullable enable +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + namespace System { /// @@ -11,23 +16,54 @@ namespace System [Serializable] public class ArgumentNullException : ArgumentException { + // ReSharper disable InconsistentNaming + private static readonly string ArgumentNull_Generic = "Value cannot be null."; + // ReSharper restore InconsistentNaming + + /// + /// Initializes a new instance of the class. + /// + public ArgumentNullException(): base(ArgumentNull_Generic) + { + } + /// - /// Initializes a new instance of the ArgumentNullException class. + /// Initializes a new instance of the class with the name of the parameter that causes this exception. /// - public ArgumentNullException() - { } + /// The name of the parameter that caused the exception. + public ArgumentNullException(string? paramName) : base(ArgumentNull_Generic, paramName) + { + } /// - /// Initializes a new instance of the ArgumentNullException class with the name of the parameter that causes this exception. + /// Initializes a new instance of the class with a specified error message and the exception that is the cause of this exception. /// - /// The name of the parameter that caused the exception. - public ArgumentNullException(string argument) : base(null, argument) { } + /// The error message that explains the reason for this exception. + /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + public ArgumentNullException(string? message, Exception? innerException) : base(message ?? ArgumentNull_Generic, innerException) + { + } /// - /// Initializes an instance of the ArgumentNullException class with a specified error message and the name of the parameter that causes this exception. + /// Initializes an instance of the class with a specified error message and the name of the parameter that causes this exception. /// - /// The name of the parameter that caused the exception. - /// A message that describes the error. - public ArgumentNullException(String paramName, String message) : base(message, paramName) { } + /// The name of the parameter that caused the exception. + /// The error message that explains the reason for this exception. + public ArgumentNullException(string? paramName, string? message) : base(message ?? ArgumentNull_Generic, paramName) { } + + /// Throws an if is null. + /// The reference type argument to validate as non-null. + /// The name of the parameter with which corresponds. + public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) + { + if (argument is null) + { + Throw(paramName); + } + } + + [DoesNotReturn] + internal static void Throw(string? paramName) => + throw new ArgumentNullException(paramName); } } diff --git a/nanoFramework.CoreLibrary/System/String.cs b/nanoFramework.CoreLibrary/System/String.cs index 8a076190..52261739 100644 --- a/nanoFramework.CoreLibrary/System/String.cs +++ b/nanoFramework.CoreLibrary/System/String.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Diagnostics.CodeAnalysis; + namespace System { using Runtime.CompilerServices; @@ -825,7 +827,7 @@ public String PadRight(int totalWidth, char paddingChar = ' ') /// /// The string to test. /// if the value parameter is or an empty string (""); otherwise, . - public static bool IsNullOrEmpty(string value) + public static bool IsNullOrEmpty([NotNullWhen(false)] string value) { return value == null || value.Length == 0; } From 1f779f14aa76c292ce66303794d3f35dddc35cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 3 Feb 2025 10:20:17 +0000 Subject: [PATCH 39/70] Add editor config and spelling exclusion dic - Format all source code files with project rules. ***NO_CI*** (cherry picked from commit fef2df822f5bfb47f1a9e2bb3526bddd862d3519) --- .editorconfig | 216 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestArithmeticTest1.cs | 7 +- .../UnitTestArithmeticTest2.cs | 11 +- .../UnitTestExpressionTests.cs | 53 +- Tests/NFUnitTestArithmetic/UnitTestFormat.cs | 9 +- .../UnitTestOtherArithmeticTests.cs | 9 +- .../Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestArray/UnitTestOtherTests.cs | 12 +- Tests/NFUnitTestArray/UnitTestSimpleTests.cs | 10 +- .../CallerArgumentExpressionAttributeTests.cs | 5 +- .../CallerMemberNameAttributeTests.cs | 5 +- .../NFUnitTestAttributes/ConstructorTests.cs | 11 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestAttributesTest1.cs | 21 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestBasicConceptsTests.cs | 10 +- Tests/NFUnitTestBitConverter/BitConverter.cs | 11 +- Tests/NFUnitTestBitConverter/Helpers.cs | 7 +- .../Properties/AssemblyInfo.cs | 6 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestConstructorTest.cs | 12 +- .../NFUnitTestClasses/UnitTestConstsTests.cs | 11 +- .../UnitTestDeclarationTests.cs | 9 +- .../UnitTestDestructorTests.cs | 9 +- Tests/NFUnitTestClasses/UnitTestEventTests.cs | 10 +- Tests/NFUnitTestClasses/UnitTestFieldTests.cs | 9 +- .../UnitTestHashCodeTests.cs | 8 +- .../NFUnitTestClasses/UnitTestIndexerTests.cs | 9 +- .../NFUnitTestClasses/UnitTestMembersTests.cs | 6 +- .../NFUnitTestClasses/UnitTestMethodsTests.cs | 21 +- .../UnitTestOperatorTests.cs | 9 +- .../UnitTestPropertiesTests.cs | 9 +- .../NFUnitTestClasses/UnitTestStaticTests.cs | 9 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestBoxingTests.cs | 8 +- .../UnitTestConvertTests.cs | 10 +- .../UnitTestExprefTests.cs | 1830 ++++++++--------- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestDelegatesTests.cs | 10 +- .../NFUnitTestEnum/Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestEnum/UnitTestEnumTests.cs | 16 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestExceptionTests.cs | 10 +- Tests/NFUnitTestGC/Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestGC/TestGC.cs | 8 +- Tests/NFUnitTestGC/TestGCWithByteArrays.cs | 9 +- .../NFUnitTestGC/TestGCWithDateTimeArrays.cs | 9 +- Tests/NFUnitTestGC/TestGCWithObjectArrays.cs | 9 +- Tests/NFUnitTestGC/TestGCWithStringArrays.cs | 11 +- .../NFUnitTestGC/TestGCWithTimeSpanArrays.cs | 9 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestInterfaceTests.cs | 12 +- .../Properties/AssemblyInfo.cs | 6 +- .../NFUnitTestLexical/UnitTestLExicalTest1.cs | 9 +- .../NFUnitTestLexical/UnitTestLexicalTest2.cs | 20 +- Tests/NFUnitTestNamespace/NS_attribute_01.cs | 19 +- Tests/NFUnitTestNamespace/NS_attribute_02.cs | 9 +- Tests/NFUnitTestNamespace/NS_compunit_01A.cs | 7 +- Tests/NFUnitTestNamespace/NS_compunit_01B.cs | 7 +- Tests/NFUnitTestNamespace/NS_compunit_03A.cs | 7 +- Tests/NFUnitTestNamespace/NS_compunit_03B.cs | 8 +- Tests/NFUnitTestNamespace/NS_compunit_04A.cs | 7 +- Tests/NFUnitTestNamespace/NS_compunit_04B.cs | 7 +- Tests/NFUnitTestNamespace/NS_decl_14.cs | 15 +- Tests/NFUnitTestNamespace/NS_decl_15.cs | 15 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestNamespaceTests.cs | 35 +- .../Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestRecords/UnitTestRecords.cs | 6 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestStatementTests.cs | 6 +- .../Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestStruct/UnitTestStructs.cs | 10 +- .../Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestSystemLib/UnitTestBoolean.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestByte.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestChar.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestDateTime.cs | 29 +- Tests/NFUnitTestSystemLib/UnitTestDouble.cs | 11 +- Tests/NFUnitTestSystemLib/UnitTestGCTest.cs | 9 +- Tests/NFUnitTestSystemLib/UnitTestGuid.cs | 11 +- .../UnitTestInitLocalTests.cs | 12 +- Tests/NFUnitTestSystemLib/UnitTestInt16.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestInt32.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestInt64.cs | 7 +- .../NFUnitTestSystemLib/UnitTestParseTests.cs | 10 +- .../UnitTestReflectionAssemblyTest.cs | 10 +- .../UnitTestReflectionMemberTest.cs | 9 +- .../UnitTestReflectionTypeTest.cs | 14 +- Tests/NFUnitTestSystemLib/UnitTestSByte.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestSingle.cs | 7 +- .../UnitTestStringTests.cs | 10 +- Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs | 10 +- .../NFUnitTestSystemLib/UnitTestTypeTests.cs | 10 +- Tests/NFUnitTestSystemLib/UnitTestUInt16.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestUInt32.cs | 7 +- Tests/NFUnitTestSystemLib/UnitTestUInt64.cs | 7 +- .../UnitTestWeakReferenceTests.cs | 9 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestAutoResetEvents.cs | 10 +- .../NFUnitTestThread/UnitTestInterlocTests.cs | 10 +- .../NFUnitTestThread/UnitTestMonitorTests.cs | 12 +- Tests/NFUnitTestThread/UnitTestThreadTest.cs | 12 +- Tests/NFUnitTestThread/UnitTestTimeTests.cs | 10 +- .../NFUnitTestThread/UnitTestTimeoutTests.cs | 10 +- .../UnitTestWaitHandleTests.cs | 10 +- .../Properties/AssemblyInfo.cs | 6 +- .../UnitTestObjectTypeTests.cs | 7 +- Tests/NFUnitTestTypes/UnitTestSubTypeTests.cs | 14 +- Tests/NFUnitTestTypes/UnitTestTypes.cs | 8 +- .../UnitTestValueArrayTypess.cs | 10 +- .../UnitTestValueDefultConstTests.cs | 12 +- .../UnitTestValueFloatTests.cs | 9 +- .../UnitTestValueIntegralTests.cs | 9 +- .../UnitTestValueSimpleTests.cs | 10 +- Tests/NFUnitTestTypes/UnitTestValueTests.cs | 8 +- Tests/NFUnitTestTypes/UnitTestsSpanByte.cs | 14 +- Tests/NFUnitTestVariables/CategoryTests.cs | 9 +- .../Properties/AssemblyInfo.cs | 6 +- Tests/NFUnitTestVariables/VariableTests.cs | 9 +- .../TestFramework/Properties/AssemblyInfo.cs | 6 +- .../Properties/AssemblyInfo.cs | 6 +- nanoFramework.CoreLibrary/Friends.cs | 8 +- nanoFramework.CoreLibrary/System/Action.cs | 9 +- nanoFramework.CoreLibrary/System/AppDomain.cs | 7 +- .../System/AppDomainUnloadedException.cs | 7 +- .../System/ApplicationException.cs | 8 +- .../System/ArgumentException.cs | 9 +- .../System/ArgumentNullException.cs | 9 +- .../System/ArgumentOutOfRangeException.cs | 7 +- nanoFramework.CoreLibrary/System/Array.cs | 7 +- .../System/AssemblyInfo.cs | 7 +- .../System/AsyncCallback.cs | 7 +- nanoFramework.CoreLibrary/System/Attribute.cs | 7 +- .../System/AttributeTargets.cs | 7 +- .../System/AttributeUsageAttribute.cs | 7 +- .../System/BitConverter.cs | 7 +- nanoFramework.CoreLibrary/System/Boolean.cs | 7 +- nanoFramework.CoreLibrary/System/Byte.cs | 7 +- .../System/CLSCompliantAttribute.cs | 7 +- nanoFramework.CoreLibrary/System/Char.cs | 7 +- .../System/Collections/ArrayList.cs | 7 +- .../System/Collections/ICollection.cs | 7 +- .../System/Collections/IComparer.cs | 7 +- .../System/Collections/IEnumerable.cs | 7 +- .../System/Collections/IEnumerator.cs | 7 +- .../System/Collections/IEqualityComparer.cs | 7 +- .../System/Collections/IList.cs | 7 +- .../EditorBrowsableAttribute.cs | 7 +- nanoFramework.CoreLibrary/System/Console.cs | 6 +- nanoFramework.CoreLibrary/System/Convert.cs | 7 +- nanoFramework.CoreLibrary/System/DBNull.cs | 7 +- nanoFramework.CoreLibrary/System/DateTime.cs | 11 +- nanoFramework.CoreLibrary/System/DayOfWeek.cs | 7 +- nanoFramework.CoreLibrary/System/Delegate.cs | 8 +- .../Diagnostics/ConditionalAttribute.cs | 7 +- .../System/Diagnostics/Debug.cs | 7 +- .../System/Diagnostics/Debugger.cs | 7 +- .../System/Diagnostics/DebuggerAttributes.cs | 7 +- nanoFramework.CoreLibrary/System/Double.cs | 7 +- nanoFramework.CoreLibrary/System/Enum.cs | 7 +- nanoFramework.CoreLibrary/System/EventArgs.cs | 7 +- .../System/EventHandler.cs | 7 +- nanoFramework.CoreLibrary/System/Exception.cs | 7 +- .../System/FlagsAttribute.cs | 7 +- .../System/FormatException.cs | 8 +- nanoFramework.CoreLibrary/System/GC.cs | 7 +- .../System/Globalization/CultureInfo.cs | 9 +- .../System/Globalization/DateTimeFormat.cs | 9 +- .../Globalization/DateTimeFormatInfo.cs | 7 +- .../System/Globalization/NumberFormatInfo.cs | 7 +- nanoFramework.CoreLibrary/System/Guid.cs | 2 + .../System/IAsyncResult.cs | 7 +- .../System/ICloneable.cs | 7 +- .../System/IComparable.cs | 8 +- .../System/ICustomFormatter.cs | 7 +- .../System/IDisposable.cs | 7 +- .../System/IFormatProvider.cs | 7 +- .../System/IFormattable.cs | 7 +- .../System/IO/IOException.cs | 7 +- .../System/IndexOutOfRangeException.cs | 8 +- nanoFramework.CoreLibrary/System/Int16.cs | 7 +- nanoFramework.CoreLibrary/System/Int32.cs | 7 +- nanoFramework.CoreLibrary/System/Int64.cs | 7 +- nanoFramework.CoreLibrary/System/IntPtr.cs | 7 +- .../System/InvalidCastException.cs | 8 +- .../System/InvalidOperationException.cs | 7 +- .../System/MarshalByRefObject.cs | 7 +- nanoFramework.CoreLibrary/System/Math.cs | 7 +- .../System/MulticastDelegate.cs | 7 +- .../System/NonSerializedAttribute.cs | 7 +- .../System/NotImplementedException.cs | 7 +- .../System/NotSupportedException.cs | 7 +- .../System/NullReferenceException.cs | 8 +- nanoFramework.CoreLibrary/System/Number.cs | 7 +- nanoFramework.CoreLibrary/System/Object.cs | 7 +- .../System/ObjectDisposedException.cs | 7 +- .../System/ObsoleteAttribute.cs | 9 +- .../System/OutOfMemoryException.cs | 7 +- .../System/ParamArrayAttribute.cs | 7 +- .../System/PlatformNotSupportedException.cs | 8 +- nanoFramework.CoreLibrary/System/Random.cs | 7 +- .../System/Reflection/Assembly.cs | 11 +- .../System/Reflection/AssemblyAttributes.cs | 7 +- .../System/Reflection/AssemblyNameFlags.cs | 7 +- .../AssemblyReflectionAttributes.cs | 7 +- .../System/Reflection/Binder.cs | 7 +- .../System/Reflection/BindingFlags.cs | 7 +- .../System/Reflection/ConstructorInfo.cs | 9 +- .../Reflection/CustomAttributesHelpers.cs | 6 +- .../Reflection/DefaultMemberAttribute.cs | 7 +- .../System/Reflection/FieldInfo.cs | 9 +- .../Reflection/FieldReflectionAttributes.cs | 7 +- .../System/Reflection/IReflect.cs | 7 +- .../System/Reflection/MemberInfo.cs | 7 +- .../System/Reflection/MemberTypes.cs | 7 +- .../System/Reflection/MethodBase.cs | 9 +- .../System/Reflection/MethodImplAttributes.cs | 7 +- .../System/Reflection/MethodInfo.cs | 7 +- .../System/Reflection/ParameterInfo.cs | 8 +- .../System/Reflection/PropertyInfo.cs | 7 +- .../Reflection/RuntimeConstructorInfo.cs | 7 +- .../System/Reflection/RuntimeFieldInfo.cs | 7 +- .../System/Reflection/RuntimeMethodInfo.cs | 7 +- .../AccessedThroughPropertyAttribute.cs | 7 +- .../ExcludeFromStubsAttribute.cs | 5 +- .../CompilerServices/ExtensionAttribute.cs | 7 +- .../CompilerServices/IndexerNameAttribute.cs | 7 +- .../InternalsVisibleToAttribute.cs | 7 +- .../CompilerServices/IsExternalInit.cs | 7 +- .../CompilerServices/MethodImplAttribute.cs | 7 +- .../CompilerServices/RuntimeFeature.cs | 7 +- .../CompilerServices/RuntimeHelpers.cs | 7 +- .../Runtime/InteropServices/Attributes.cs | 7 +- .../System/Runtime/InteropServices/CharSet.cs | 7 +- .../Runtime/InteropServices/LayoutKind.cs | 7 +- .../Runtime/Remoting/RemotingServices.cs | 3 + .../Runtime/Remoting/__TransparentProxy.cs | 7 +- .../System/RuntimeArgumentHandle.cs | 7 +- .../System/RuntimeFieldHandle.cs | 7 +- .../System/RuntimeMethodHandle.cs | 8 +- .../System/RuntimeType.cs | 7 +- .../System/RuntimeTypeHandle.cs | 8 +- nanoFramework.CoreLibrary/System/SByte.cs | 7 +- .../System/SerializableAttribute.cs | 7 +- nanoFramework.CoreLibrary/System/Single.cs | 10 +- nanoFramework.CoreLibrary/System/SpanByte.cs | 7 +- nanoFramework.CoreLibrary/System/String.cs | 28 +- .../System/SystemException.cs | 7 +- .../System/TargetFrameworkAttribute.cs | 7 +- .../System/ThreadAttributes.cs | 7 +- .../System/Threading/AutoResetEvent.cs | 7 +- .../System/Threading/Interlocked.cs | 7 +- .../System/Threading/ManualResetEvent.cs | 7 +- .../System/Threading/Monitor.cs | 7 +- .../System/Threading/SpinWait.cs | 7 +- .../System/Threading/Thread.cs | 7 +- .../System/Threading/ThreadAbortException.cs | 7 +- .../System/Threading/ThreadPriority.cs | 7 +- .../System/Threading/ThreadStart.cs | 7 +- .../System/Threading/ThreadState.cs | 7 +- .../System/Threading/Timeout.cs | 7 +- .../System/Threading/Timer.cs | 7 +- .../System/Threading/WaitHandle.cs | 9 +- nanoFramework.CoreLibrary/System/TimeSpan.cs | 14 +- .../System/TimeoutException.cs | 7 +- nanoFramework.CoreLibrary/System/Type.cs | 9 +- nanoFramework.CoreLibrary/System/TypeCode.cs | 8 +- .../System/TypedReference.cs | 7 +- nanoFramework.CoreLibrary/System/UInt16.cs | 7 +- nanoFramework.CoreLibrary/System/UInt32.cs | 7 +- nanoFramework.CoreLibrary/System/UInt64.cs | 7 +- nanoFramework.CoreLibrary/System/UIntPtr.cs | 7 +- nanoFramework.CoreLibrary/System/ValueType.cs | 7 +- nanoFramework.CoreLibrary/System/Version.cs | 7 +- nanoFramework.CoreLibrary/System/Void.cs | 7 +- .../System/WeakReference.cs | 7 +- spelling_exclusion.dic | 1 + 279 files changed, 1927 insertions(+), 2448 deletions(-) create mode 100644 spelling_exclusion.dic diff --git a/.editorconfig b/.editorconfig index f33fc800..a5a9d5fe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,213 @@ -[*.cs] +# EditorConfig for Visual Studio 2022: https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022 -# S4200: Native methods should be wrapped -# It's OK to have native methods unwrapped in nanoFramework -dotnet_diagnostic.S4200.severity = none +# This is a top-most .editorconfig file +root = true + +#===================================================== +# +# nanoFramework specific settings +# +# +#===================================================== +[*] +# Generic EditorConfig settings +end_of_line = crlf +charset = utf-8-bom + +# Visual Studio spell checker +spelling_languages = en-us +spelling_checkable_types = strings,identifiers,comments +spelling_error_severity = information +spelling_exclusion_path = spelling_exclusion.dic + +#===================================================== +# +# Settings copied from the .NET runtime +# +# https://github.com/dotnet/runtime +# +#===================================================== +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +# Generated code +[*{_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs}] +generated_code = true + +# C# files +[*.cs] +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current + +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Types: use keywords instead of BCL types, and permit var only when the type is clear +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# name all constant fields using PascalCase +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# static fields should have s_ prefix +dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion +dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields +dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static +dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected +dotnet_naming_style.static_prefix_style.required_prefix = s_ +dotnet_naming_style.static_prefix_style.capitalization = camel_case + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# Code style defaults +csharp_using_directive_placement = outside_namespace:suggestion +dotnet_sort_system_directives_first = true +csharp_prefer_braces = true:silent +csharp_preserve_single_line_blocks = true:none +csharp_preserve_single_line_statements = false:none +csharp_prefer_static_local_function = true:suggestion +csharp_prefer_simple_using_statement = false:none +csharp_style_prefer_switch_expression = true:suggestion +dotnet_style_readonly_field = true:suggestion + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_collection_expression = when_types_exactly_match +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +csharp_prefer_simple_default_expression = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_constructors = true:silent +csharp_style_expression_bodied_operators = true:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = true:silent + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Other features +csharp_style_prefer_index_operator = false:none +csharp_style_prefer_range_operator = false:none +csharp_style_pattern_local_over_anonymous_function = false:none + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# License header +file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license. + +# C++ Files +[*.{cpp,h,in}] +curly_bracket_next_line = true +indent_brace_style = Allman + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +[*.{csproj,vbproj,proj,nativeproj,locproj}] +charset = utf-8 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{xml,stylecop,resx,ruleset}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +# YAML config files +[*.{yml,yaml}] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd,bat}] +end_of_line = crlf \ No newline at end of file diff --git a/Tests/NFUnitTestArithmetic/Properties/AssemblyInfo.cs b/Tests/NFUnitTestArithmetic/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestArithmetic/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestArithmetic/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs index ce80ef06..1f5b06c0 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest1.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs index 4378a870..33e39b56 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestArithmeticTest2.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestArithmetic { @@ -734,7 +729,7 @@ public void Arith_sub0051_Test() // Section 7.7.5 Assert.IsTrue(Arith_TestClass_sub0051.testMethod()); } - + //Compiled Test Cases class Arith_TestClass_opt001 { diff --git a/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs b/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs index ef83372f..7f6f1f5e 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestArithmetic { @@ -325,7 +321,7 @@ public void Exp_ident031_Test() // This code tests that if a primary expression consisting of a single identifier refers // to a member in an enclosing namespace, then the primary expression is evaluated // to that member and classified as a namespace or a type. - Assert.IsTrue(NS_ident031_I.ident031.testMethod()) ; + Assert.IsTrue(NS_ident031_I.ident031.testMethod()); } [TestMethod] public void Exp_ident032_Test() @@ -333,7 +329,7 @@ public void Exp_ident032_Test() // Section 7.2.2 // This code tests that if a primary expression consisting of a single identifier refers // to an imported type, then the primary expression refers to that type. - Assert.IsTrue(NS_ident032_I.ident032.testMethod()) ; + Assert.IsTrue(NS_ident032_I.ident032.testMethod()); } [TestMethod] public void Exp_ident033_Test() @@ -341,7 +337,7 @@ public void Exp_ident033_Test() // Section 7.2.2 // This code tests that if a primary expression consisting of a single identifier refers // to an imported type, then the primary expression refers to that type. - Assert.IsTrue(NS_ident033_O.NS_ident033_I.ident033.testMethod()) ; + Assert.IsTrue(NS_ident033_O.NS_ident033_I.ident033.testMethod()); } [TestMethod] public void Exp_ident034_Test() @@ -350,7 +346,7 @@ public void Exp_ident034_Test() // This code tests that if a primary expression consisting of a single identifier refers // to a single type in an imported namespace, then the primary expression refers to that // type. - Assert.IsTrue(NS_ident034_I.ident034.testMethod()) ; + Assert.IsTrue(NS_ident034_I.ident034.testMethod()); } [TestMethod] public void Exp_ident035_Test() @@ -359,7 +355,7 @@ public void Exp_ident035_Test() // This code tests that if a primary expression consisting of a single identifier refers // to a single type in an imported namespace, then the primary expression refers to that // type. - Assert.IsTrue(NS_ident035_O.NS_ident035_I.ident035.testMethod()) ; + Assert.IsTrue(NS_ident035_O.NS_ident035_I.ident035.testMethod()); } [TestMethod] public void Exp_ident038_Test() @@ -367,7 +363,7 @@ public void Exp_ident038_Test() // Section 7.2.2 // This code tests that if a primary expression consisting of a single identifier refers // to an imported type, then the primary expression refers to that type. - Assert.IsTrue(NS_ident038_I.ident038.testMethod()) ; + Assert.IsTrue(NS_ident038_I.ident038.testMethod()); } [TestMethod] public void Exp_ident039_Test() @@ -375,7 +371,7 @@ public void Exp_ident039_Test() // Section 7.2.2 // This code tests that if a primary expression consisting of a single identifier refers // to an imported type, then the primary expression refers to that type. - Assert.IsTrue(NS_ident039_O.NS_ident039_I.ident039.testMethod()) ; + Assert.IsTrue(NS_ident039_O.NS_ident039_I.ident039.testMethod()); } [TestMethod] @@ -384,7 +380,7 @@ public void Exp_ident040_Test() // Section 7.2.2 // This code tests that if a primary expression consisting of a single identifier refers // to an imported type, then the primary expression refers to that type. - Assert.IsTrue(NS_ident040_I.ident040.testMethod()) ; + Assert.IsTrue(NS_ident040_I.ident040.testMethod()); } [TestMethod] @@ -394,7 +390,7 @@ public void Exp_mem001_Test() // This code tests that if the primary expression consisting of the form E.I, where E // is a namespace and I is the name of an accessible member of that namespace, then the // result is the member, either a namespace or a type. - Assert.IsTrue(mem001.testMethod()) ; + Assert.IsTrue(mem001.testMethod()); } /* [TestMethod] @@ -417,7 +413,7 @@ public void Exp_mem003_Test() // Section 7.2.7 // This code tests that if the primary expression consisting of the form E.I, where E // is a type and I is also a type, then the result of the member is that type. - Assert.IsTrue(mem003.testMethod()) ; + Assert.IsTrue(mem003.testMethod()); } [TestMethod] public void Exp_mem004_Test() @@ -425,7 +421,7 @@ public void Exp_mem004_Test() // Section 7.2.7 // This code tests that if the primary expression consisting of the form E.I, where E // is a type and I is also a type, then the result of the member is that type. - Assert.IsTrue(mem004.testMethod()) ; + Assert.IsTrue(mem004.testMethod()); } [TestMethod] public void Exp_mem005_Test() @@ -799,35 +795,35 @@ public void Exp_lit001_Test() { // Section 7.2.1 // This code tests that a boolean-literal is of type bool. - Assert.IsTrue(lit001.testMethod()) ; + Assert.IsTrue(lit001.testMethod()); } [TestMethod] public void Exp_lit004_Test() { // Section 7.2.1 // This code tests that an int-literal is of type int. - Assert.IsTrue(lit004.testMethod()) ; + Assert.IsTrue(lit004.testMethod()); } [TestMethod] public void Exp_lit005_Test() { // Section 7.2.1 // This code tests that a long-literal is of type long. - Assert.IsTrue(lit005.testMethod()) ; + Assert.IsTrue(lit005.testMethod()); } [TestMethod] public void Exp_lit006_Test() { // Section 7.2.1 // This code tests that a float-literal is of type float. - Assert.IsTrue(lit006.testMethod()) ; + Assert.IsTrue(lit006.testMethod()); } [TestMethod] public void Exp_lit007_Test() { // Section 7.2.1 // This code tests that a double-literal is of type double. - Assert.IsTrue(lit007.testMethod()) ; + Assert.IsTrue(lit007.testMethod()); } [TestMethod] public void Exp_lit008_Test() @@ -863,7 +859,7 @@ public void Exp_base006_Test() // Section 7.2.8 // A base class access is permitted only in the block of a constructor, // an instance method, or an instance property accessor. - Assert.IsTrue(base006.testMethod()) ; + Assert.IsTrue(base006.testMethod()); } [TestMethod] public void Exp_base007_Test() @@ -871,7 +867,7 @@ public void Exp_base007_Test() // Section 7.2.8 // A base class access is permitted only in the block of a constructor, // an instance method, or an instance property accessor. - Assert.IsTrue(base007.testMethod()) ; + Assert.IsTrue(base007.testMethod()); } [TestMethod] public void Exp_base009_Test() @@ -879,7 +875,7 @@ public void Exp_base009_Test() // Section 7.2.8 // A base class access is permitted only in the block of a constructor, // an instance method, or an instance property accessor. - Assert.IsTrue(base009.testMethod()) ; + Assert.IsTrue(base009.testMethod()); } [TestMethod] public void Exp_base010_Test() @@ -887,7 +883,7 @@ public void Exp_base010_Test() // Section 7.2.8 // A base class access is permitted only in the block of a constructor, // an instance method, or an instance property accessor. - Assert.IsTrue(base010.testMethod()) ; + Assert.IsTrue(base010.testMethod()); } [TestMethod] public void Exp_base011_Test() @@ -3797,7 +3793,6 @@ public class Exp_TestClass_ident038_TC } namespace NS_ident038_I { - using Exp_TestClass_ident038_T; using Exp_TestClass_ident038_TC = Exp_TestClass_ident038_T2.Exp_TestClass_ident038_TC; public class ident038 { @@ -3836,7 +3831,6 @@ public class Exp_TestClass_ident039_TC namespace NS_ident039_O { using Exp_TestClass_ident039_TC = Exp_TestClass_ident039_T2.Exp_TestClass_ident039_TC; - using Exp_TestClass_ident039_T; namespace NS_ident039_I { public class ident039 @@ -3869,7 +3863,6 @@ public class Exp_TestClass_ident040_TC } namespace NS_ident040_I { - using Exp_TestClass_ident040_T; using Exp_TestClass_ident040_TC = Exp_TestClass_ident040_T.Exp_TestClass_ident040_TC; public class ident040 { diff --git a/Tests/NFUnitTestArithmetic/UnitTestFormat.cs b/Tests/NFUnitTestArithmetic/UnitTestFormat.cs index 097ed2fe..576a04ca 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestFormat.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestFormat.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Collections; +using nanoFramework.TestFramework; using static NFUnitTestArithmetic.SampleDisplay; namespace NFUnitTestArithmetic diff --git a/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs b/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs index dec31183..c3bf688c 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestArithmetic { diff --git a/Tests/NFUnitTestArray/Properties/AssemblyInfo.cs b/Tests/NFUnitTestArray/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestArray/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestArray/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestArray/UnitTestOtherTests.cs b/Tests/NFUnitTestArray/UnitTestOtherTests.cs index 50ed78ee..a10c6346 100644 --- a/Tests/NFUnitTestArray/UnitTestOtherTests.cs +++ b/Tests/NFUnitTestArray/UnitTestOtherTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestArray { @@ -112,7 +108,7 @@ public void Othercovariance_implicit_04_Test() { // Array Covariance // Verify covariance from any class-type S to any interface-type T, provided S implements T - Assert.IsTrue(Other_TestClass_covariance_implicit_04.testMethod()); + Assert.IsTrue(Other_TestClass_covariance_implicit_04.testMethod()); } [TestMethod] diff --git a/Tests/NFUnitTestArray/UnitTestSimpleTests.cs b/Tests/NFUnitTestArray/UnitTestSimpleTests.cs index 770b43b7..ff7bd6ea 100644 --- a/Tests/NFUnitTestArray/UnitTestSimpleTests.cs +++ b/Tests/NFUnitTestArray/UnitTestSimpleTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestArray { diff --git a/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs b/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs index 0690fdaa..07cd6fa6 100644 --- a/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs +++ b/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs @@ -1,4 +1,7 @@ -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; using nanoFramework.TestFramework; namespace NFUnitTestAttributes diff --git a/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs b/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs index b94bb9d3..fb114d72 100644 --- a/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs +++ b/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs @@ -1,4 +1,7 @@ -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; using nanoFramework.TestFramework; namespace NFUnitTestAttributes diff --git a/Tests/NFUnitTestAttributes/ConstructorTests.cs b/Tests/NFUnitTestAttributes/ConstructorTests.cs index 949dd635..b8aaeac2 100644 --- a/Tests/NFUnitTestAttributes/ConstructorTests.cs +++ b/Tests/NFUnitTestAttributes/ConstructorTests.cs @@ -1,4 +1,7 @@ -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; using nanoFramework.TestFramework; // ReSharper disable InconsistentNaming @@ -90,7 +93,7 @@ private static void AssertZeroParameterConstructorIsCalled(object[] attributes) } [TestClass] - public class When_Attribute_is_on_a_class: ConstructorTests + public class When_Attribute_is_on_a_class : ConstructorTests { private static object[] GetAttributes(Type testCases) { @@ -238,7 +241,7 @@ public class MultiParameterConstructorTestAttribute : Attribute { public MultiParameterConstructorTestAttribute() { - + } public MultiParameterConstructorTestAttribute(int intValue, string stringValue) @@ -256,7 +259,7 @@ public MultiParameterConstructorTestAttribute(int intValue, string stringValue) } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = true)] - public class SingleParameterConstructorTestAttribute: Attribute + public class SingleParameterConstructorTestAttribute : Attribute { public SingleParameterConstructorTestAttribute() { diff --git a/Tests/NFUnitTestAttributes/Properties/AssemblyInfo.cs b/Tests/NFUnitTestAttributes/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestAttributes/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestAttributes/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs b/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs index 511f56fc..5f68bcf4 100644 --- a/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs +++ b/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Diagnostics; using System.Runtime.InteropServices; +using nanoFramework.TestFramework; namespace NFUnitTestAttributes { @@ -159,14 +156,14 @@ public void Attrib_attrib036_1_Test() // 17.1 - A top-level, non-abstract attribute class must have public or // internal accessibility. Nested attribute classes may also be private, // protected, or protected internal. - Assert.IsTrue(Attrib_TestClass_attrib036_1.testMethod()); + Assert.IsTrue(Attrib_TestClass_attrib036_1.testMethod()); } [TestMethod] public void Attrib_attrib038_1_Test() { // Verify params keyword - Assert.IsTrue(Attrib_TestClass_attrib038_1.testMethod()); + Assert.IsTrue(Attrib_TestClass_attrib038_1.testMethod()); } [TestMethod] @@ -437,12 +434,12 @@ public static int Main_old() retval -= 2; Attrib_TestClass_attrib029_8_S1 s1 = new Attrib_TestClass_attrib029_8_S1(); s1.j = 10; - + if (10 == s1.j) { retval -= 4; } - + if (0 != retval) { OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); @@ -485,7 +482,7 @@ public static int Main_old() if (anInt == 5) retval -= 2; Attrib_TestClass_attrib029_9_S1 s1 = new Attrib_TestClass_attrib029_9_S1(); - + if (10 == s1.S1Method(10)) { retval -= 4; @@ -539,7 +536,7 @@ public static int Main_old() retval -= 2; } - if (0 != retval) + if (0 != retval) { OutputHelper.WriteLine("FAIL, retval==" + retval.ToString()); } diff --git a/Tests/NFUnitTestBasicConcepts/Properties/AssemblyInfo.cs b/Tests/NFUnitTestBasicConcepts/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestBasicConcepts/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestBasicConcepts/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs b/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs index 54aa877a..3333bce5 100644 --- a/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs +++ b/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestBasicConcepts { diff --git a/Tests/NFUnitTestBitConverter/BitConverter.cs b/Tests/NFUnitTestBitConverter/BitConverter.cs index 06d90a22..505c3ee9 100644 --- a/Tests/NFUnitTestBitConverter/BitConverter.cs +++ b/Tests/NFUnitTestBitConverter/BitConverter.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestBitConverter { @@ -221,7 +218,7 @@ public void BitConverterTest_LongBitsToDouble() public void IsNan() { double one = double.NaN; - if(!double.IsNaN(one)) + if (!double.IsNaN(one)) { throw new Exception($"double.NaN: {one} should be {double.NaN}"); } diff --git a/Tests/NFUnitTestBitConverter/Helpers.cs b/Tests/NFUnitTestBitConverter/Helpers.cs index 6b209da3..7ff37a27 100644 --- a/Tests/NFUnitTestBitConverter/Helpers.cs +++ b/Tests/NFUnitTestBitConverter/Helpers.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System; diff --git a/Tests/NFUnitTestBitConverter/Properties/AssemblyInfo.cs b/Tests/NFUnitTestBitConverter/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestBitConverter/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestBitConverter/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestClasses/Properties/AssemblyInfo.cs b/Tests/NFUnitTestClasses/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestClasses/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestClasses/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs b/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs index 155983bb..07c60596 100644 --- a/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs +++ b/Tests/NFUnitTestClasses/UnitTestConstructorTest.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestClasses { @@ -370,7 +366,7 @@ public void ConstructorName_01() ConstructorInfo[] constructors = classToTest.GetConstructors(); Assert.AreEqual(3, constructors.Length, $"Expecting 3 constructors, got {constructors.Length}."); - + foreach (ConstructorInfo constructorInfo in constructors) { Assert.AreEqual(constructorInfo.Name, ".ctor", $"Expecting '.ctor' as constructor name, but got: {constructorInfo.Name}"); diff --git a/Tests/NFUnitTestClasses/UnitTestConstsTests.cs b/Tests/NFUnitTestClasses/UnitTestConstsTests.cs index 161c3d7f..a325c03e 100644 --- a/Tests/NFUnitTestClasses/UnitTestConstsTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestConstsTests.cs @@ -1,13 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; -using System; -using System.Diagnostics; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs b/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs index 315eae1c..14968faf 100644 --- a/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs b/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs index 7b7bcb11..ecfbac26 100644 --- a/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestDestructorTests.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestEventTests.cs b/Tests/NFUnitTestClasses/UnitTestEventTests.cs index 83494f3d..b04353ee 100644 --- a/Tests/NFUnitTestClasses/UnitTestEventTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestEventTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestFieldTests.cs b/Tests/NFUnitTestClasses/UnitTestFieldTests.cs index 9df7b797..28dd2a3b 100644 --- a/Tests/NFUnitTestClasses/UnitTestFieldTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestFieldTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs b/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs index 05ee5af9..65c8fbde 100644 --- a/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestHashCodeTests.cs @@ -1,11 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs b/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs index 89710ef5..da824089 100644 --- a/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestIndexerTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestMembersTests.cs b/Tests/NFUnitTestClasses/UnitTestMembersTests.cs index 3118ab4f..135a1ff8 100644 --- a/Tests/NFUnitTestClasses/UnitTestMembersTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestMembersTests.cs @@ -1,6 +1,8 @@ -using nanoFramework.TestFramework; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs b/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs index 03619587..f0c9fc80 100644 --- a/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs @@ -1,6 +1,7 @@ -using nanoFramework.TestFramework; -using System; -using System.Diagnostics; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using nanoFramework.TestFramework; namespace NFUnitTestClasses { @@ -830,9 +831,9 @@ public void Methods134_Test() // inherited method simply hides the inherited // member. Assert.IsFalse(MethodsTestClass134.testMethod()); - // This failure indicates a test is now passing that previously failed by design. - // It previously marked as known failure because of bug # 21563 - // The Test owner needs to verify that the change was intentional and remove the known failure. + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] @@ -1199,9 +1200,9 @@ public void Methods195_Test() { // Tests if a new method does not overwrite a virtual method in a base class Assert.IsFalse(MethodsTestClass195.testMethod()); - // This failure indicates a test is now passing that previously failed by design. - // It previously marked as known failure because of bug # 21563 - // The Test owner needs to verify that the change was intentional and remove the known failure. + // This failure indicates a test is now passing that previously failed by design. + // It previously marked as known failure because of bug # 21563 + // The Test owner needs to verify that the change was intentional and remove the known failure. } [TestMethod] @@ -4163,7 +4164,7 @@ public class MethodsTestClass206 { public static bool testMethod() { - if(MethodsTestClass_Sub206.MyMeth(201) == 202) + if (MethodsTestClass_Sub206.MyMeth(201) == 202) { return true; } diff --git a/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs b/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs index cb342d1e..61741c6e 100644 --- a/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestOperatorTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs b/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs index 82b51aac..93a885ec 100644 --- a/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestClasses/UnitTestStaticTests.cs b/Tests/NFUnitTestClasses/UnitTestStaticTests.cs index 80617079..0e4b0392 100644 --- a/Tests/NFUnitTestClasses/UnitTestStaticTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestStaticTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestClasses { diff --git a/Tests/NFUnitTestConversions/Properties/AssemblyInfo.cs b/Tests/NFUnitTestConversions/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestConversions/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestConversions/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs b/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs index 8355ec60..bcc60b16 100644 --- a/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs +++ b/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs @@ -1,11 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; namespace NFUnitTestConversions { diff --git a/Tests/NFUnitTestConversions/UnitTestConvertTests.cs b/Tests/NFUnitTestConversions/UnitTestConvertTests.cs index 2bd030b7..709de6ba 100644 --- a/Tests/NFUnitTestConversions/UnitTestConvertTests.cs +++ b/Tests/NFUnitTestConversions/UnitTestConvertTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestConversions { diff --git a/Tests/NFUnitTestConversions/UnitTestExprefTests.cs b/Tests/NFUnitTestConversions/UnitTestExprefTests.cs index 8102410f..c9893ba3 100644 --- a/Tests/NFUnitTestConversions/UnitTestExprefTests.cs +++ b/Tests/NFUnitTestConversions/UnitTestExprefTests.cs @@ -1,926 +1,922 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestConversions { [TestClass] class UnitTestExprefTests { - [TestMethod] - public void Expref_obj_ref_Test() - { - // Converting from 'object' to a reference object. - Assert.IsTrue(ExprefTestClass_obj_ref.testMethod()); - } - - [TestMethod] - public void Expref_obj_ref_exc_Test() - { - - // Converting from 'object' to a reference object. - Assert.IsTrue(ExprefTestClass_obj_ref_exc.testMethod()); - } - - [TestMethod] - public void Expref_class_class_Test() - { - - // Tests that you can convert from a base class to a derived class - Assert.IsTrue(ExprefTestClass_class_class.testMethod()); - } - - [TestMethod] - public void Expref_class_class_exc_Test() - { - - // Tests that you can convert from a base class to a derived class - Assert.IsTrue(ExprefTestClass_class_class_exc.testMethod()); - } - - [TestMethod] - public void Expref_inter_struct_exc_Test() - { - - // Tests that you can convert from an interface to a struct that implements it. - Assert.IsTrue(ExprefTestClass_inter_struct_exc.testMethod()); - } - - [TestMethod] - public void Expref_class_inter_Test() - { - // Tests converting from a class to an interface that the class does not implement (but a derived class might). - Assert.IsTrue(ExprefTestClass_class_inter.testMethod()); - } - - [TestMethod] - public void Expref_class_inter_exc_Test() - { - // Tests converting from a class to an interface that the class does not implement (but a derived class might). - Assert.IsTrue(ExprefTestClass_class_inter_exc.testMethod()); - } - - [TestMethod] - public void Expref_inter_class_Test() - { - // Tests converting from an interface to a class - // From any interface-type S to any class-type T, provided T is not sealed, or provided T implements S. - // If T implements S: - Assert.IsTrue(ExprefTestClass_inter_class.testMethod()); - } - - [TestMethod] - public void Expref_inter_class2_Test() - { - // Tests converting from an interface to a class - Assert.IsTrue(ExprefTestClass_inter_class2.testMethod()); - } - - [TestMethod] - public void Expref_inter_class2_exc1_Test() - { - // Tests converting from an interface to a class - Assert.IsTrue(ExprefTestClass_inter_class2_exc1.testMethod()); - } - - [TestMethod] - public void Expref_inter_class2_exc2_Test() - { - - // Tests converting from an interface to a class - Assert.IsTrue(ExprefTestClass_inter_class2_exc2.testMethod()); - } - - [TestMethod] - public void Expref_inter_class_exc_Test() - { - - // Tests converting from an interface to a class - Assert.IsTrue(ExprefTestClass_inter_class_exc.testMethod()); - } - - [TestMethod] - public void Expref_inter_class_sealed_Test() - { - // Tests converting from an interface to a class - Assert.IsTrue(ExprefTestClass_inter_class_sealed.testMethod()); - } - - [TestMethod] - public void Expref_inter_class_sealed_exc_Test() - { - // Tests converting from an interface to a class - Assert.IsTrue(ExprefTestClass_inter_class_sealed_exc.testMethod()); - } - - [TestMethod] - public void Expref_inter_inter_Test() - { - // Tests converting from an interface to an interface - Assert.IsTrue(ExprefTestClass_inter_inter.testMethod()); - } - - [TestMethod] - public void Expref_inter_inter_exc_Test() - { - // Tests converting from an interface to an interface - Assert.IsTrue(ExprefTestClass_inter_inter_exc.testMethod()); - } - - [TestMethod] - public void Impenum_zero_Test() - { - // Tests whether 0 can be converted to various enum types... - Assert.IsTrue(ImpenumTestClass_zero.testMethod()); - } - - [TestMethod] - public void Impref_ref_obj_Test() - { - // Converting from a reference object to 'object' - Assert.IsTrue(ImprefTestClass_ref_obj.testMethod()); - } - - [TestMethod] - public void Impref_class_class_Test() - { - // Tests that you can convert from a class to a base class. - Assert.IsTrue(ImprefTestClass_class_class.testMethod()); - } - - [TestMethod] - public void Impref_class_inter_Test() - { - // Tests that you can convert from a class to an interface that it implements. - Assert.IsTrue(ImprefTestClass_class_inter.testMethod()); - } - - [TestMethod] - public void Impref_struct_inter_Test() - { - // Tests that you can convert from a struct to an interface that it implements. - Assert.IsTrue(ImprefTestClass_struct_inter.testMethod()); - } - - [TestMethod] - public void Impref_array_array_Test() - { - // Tests that you can convert from an array of one class to an array of another class... - Assert.IsTrue(ImprefTestClass_array_array.testMethod()); - } - - [TestMethod] - public void Impref_array_cloneable_Test() - { - // Tests that you can convert from an array to System.ICloneable; - Assert.IsTrue(ImprefTestClass_array_cloneable.testMethod()); - } - - [TestMethod] - public void Impref_null_ref_Test() - { - // Tests that you can convert from null to several reference types - Assert.IsTrue(ImprefTestClass_null_ref.testMethod()); - } - - [TestMethod] - public void Impref_delegate_to_SystemDotDelegate_Test() - { - // Tests that you can convert from a delegate type to System.Delegate - Assert.IsTrue(ImprefTestClass_delegate_to_SystemDotDelegate.testMethod()); - } - - - //Compiled Test Cases - public class ImprefTestClass_ref_obj_Sub - { - int func() { return (1); } - } - public class ImprefTestClass_ref_obj - { - public static bool testMethod() - { - ImprefTestClass_ref_obj_Sub test = new ImprefTestClass_ref_obj_Sub(); - object obj; - obj = test; - return true; - } - } - - class ImprefTestClass_class_class_Der1 - { - void i() { } - } - - class ImprefTestClass_class_class_Der2 : ImprefTestClass_class_class_Der1 - { - void j() { } - } - public class ImprefTestClass_class_class - { - public static bool testMethod() - { - ImprefTestClass_class_class_Der2 derivedClass = new ImprefTestClass_class_class_Der2(); - - ImprefTestClass_class_class_Der1 ImprefTestClass_class_class_Base; - ImprefTestClass_class_class_Base = derivedClass; - return true; - } - } - - interface ImprefTestClass_class_inter_Interface1 - { - void i(); - } - interface ImprefTestClass_class_inter_Interface2 - { - void j(); - } - - class ImprefTestClass_class_inter_Sub : ImprefTestClass_class_inter_Interface1, ImprefTestClass_class_inter_Interface2 - { - public void i() { } - public void j() { } - } - public class ImprefTestClass_class_inter - { - public static bool testMethod() - { - ImprefTestClass_class_inter_Sub ImprefTestClass_class_inter_Sub = new ImprefTestClass_class_inter_Sub(); - ImprefTestClass_class_inter_Interface2 inter2; - ImprefTestClass_class_inter_Interface1 inter1; - inter1 = ImprefTestClass_class_inter_Sub; - inter2 = ImprefTestClass_class_inter_Sub; - return true; - } - - } - - interface ImprefTestClass_struct_inter_Interface1 - { - void i(); - } - interface ImprefTestClass_struct_inter_Interface2 - { - void j(); - } - - struct ImprefTestClass_struct_inter_Sub : ImprefTestClass_struct_inter_Interface1, ImprefTestClass_struct_inter_Interface2 - { - public void i() { } - public void j() { } - } - public class ImprefTestClass_struct_inter - { - public static bool testMethod() - { - ImprefTestClass_struct_inter_Sub ImprefTestClass_struct_inter_Sub = new ImprefTestClass_struct_inter_Sub(); - ImprefTestClass_struct_inter_Interface2 inter2; - ImprefTestClass_struct_inter_Interface1 inter1; - inter2 = ImprefTestClass_struct_inter_Sub; - inter1 = ImprefTestClass_struct_inter_Sub; - return true; - } - } - - class ImprefTestClass_array_array_Base1 - { - public void i() { } - } - - class ImprefTestClass_array_array_Base2 : ImprefTestClass_array_array_Base1 - { - public void j() { } - } - public class ImprefTestClass_array_array - { - public static bool testMethod() - { - ImprefTestClass_array_array_Base2[] arrDer = new ImprefTestClass_array_array_Base2[1]; - ImprefTestClass_array_array_Base2 element = new ImprefTestClass_array_array_Base2(); - arrDer[0] = element; - ImprefTestClass_array_array_Base1[] arrBase = new ImprefTestClass_array_array_Base1[1]; - arrBase = arrDer; - element.j(); - arrBase[0].i(); - return true; - } - } - - class ImprefTestClass_array_cloneable_Derived - { - public void i() { } - } - - public class ImprefTestClass_array_cloneable - { - public static bool testMethod() - { - ImprefTestClass_array_cloneable_Derived[] arrBase = new ImprefTestClass_array_cloneable_Derived[1]; - ICloneable clone; - clone = arrBase; - return true; - } - } - - class ImprefTestClass_null_ref_Derived - { - public void i() { } - } - public class ImprefTestClass_null_ref - { - public static bool testMethod() - { - ImprefTestClass_null_ref_Derived classDer1; - String string1; - classDer1 = null; - string1 = null; - return true; - } - } - - delegate void ImprefTestClass_delegate_to_SystemDotDelegate_Delegate(); - class ImprefTestClass_delegate_to_SystemDotDelegate - { - public static void DoNothing() { } - public static bool testMethod() - { - ImprefTestClass_delegate_to_SystemDotDelegate_Delegate src = new ImprefTestClass_delegate_to_SystemDotDelegate_Delegate(ImprefTestClass_delegate_to_SystemDotDelegate.DoNothing); - System.Delegate dst = src; - src(); - return true; - } - } - - - enum ImpenumTestClass_zero_Test1 : int - { - a, - b, - c - } - enum ImpenumTestClass_zero_Test2 : short - { - a, - b, - c - } - enum ImpenumTestClass_zero_Test3 : long - { - a, - b, - c - } - public class ImpenumTestClass_zero - { - public static bool testMethod() - { - ImpenumTestClass_zero_Test1 t1 = 0; - ImpenumTestClass_zero_Test2 t2 = 0; - ImpenumTestClass_zero_Test3 t3 = 0; - return true; - } - } - - - //Compiled Test Cases - public class ExprefTestClass_obj_ref_Sub1 - { - public void func() {/*Old Print*/} - } - public class ExprefTestClass_obj_ref_Sub2 - { - public void func() {/*Old Print*/} - } - public class ExprefTestClass_obj_ref - { - public static bool testMethod() - { - ExprefTestClass_obj_ref_Sub1 test = new ExprefTestClass_obj_ref_Sub1(); - object obj; - obj = test; // implicit setup - test = (ExprefTestClass_obj_ref_Sub1)obj; - test.func(); - return true; - } - } - - public class ExprefTestClass_obj_ref_exc_Sub1 - { - int func() { return (1); } - } - public class ExprefTestClass_obj_ref_exc_Sub2 - { - int func() { return (1); } - } - public class ExprefTestClass_obj_ref_exc - { - public static bool testMethod() - { - ExprefTestClass_obj_ref_exc_Sub1 test = new ExprefTestClass_obj_ref_exc_Sub1(); - ExprefTestClass_obj_ref_exc_Sub2 test2; - object obj; - obj = test; // implicit setup - try - { - test2 = (ExprefTestClass_obj_ref_exc_Sub2)obj; // obj is *not* a test2 - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - - class ExprefTestClass_class_class_Base1 - { - void i() { } - } - - class ExprefTestClass_class_class_Base2 : ExprefTestClass_class_class_Base1 - { - void j() { } - } - public class ExprefTestClass_class_class - { - public static bool testMethod() - { - ExprefTestClass_class_class_Base2 derivedClass = new ExprefTestClass_class_class_Base2(); - - ExprefTestClass_class_class_Base1 myBase; - myBase = derivedClass; // implicit conversion - derivedClass = (ExprefTestClass_class_class_Base2)myBase; // test conversion - return true; - } - } - - class ExprefTestClass_class_class_exc_Base - { - void i() { } - } - - class ExprefTestClass_class_class_exc_Der1 : ExprefTestClass_class_class_exc_Base - { - void j() { } - } - class ExprefTestClass_class_class_exc_Der2 : ExprefTestClass_class_class_exc_Base - { - void k() { } - } - public class ExprefTestClass_class_class_exc - { - public static bool testMethod() - { - ExprefTestClass_class_class_exc_Der1 derivedClass = new ExprefTestClass_class_class_exc_Der1(); - - ExprefTestClass_class_class_exc_Base myBase; - ExprefTestClass_class_class_exc_Der2 derivedClass3; - myBase = derivedClass; // implicit conversion - try - { - derivedClass3 = (ExprefTestClass_class_class_exc_Der2)myBase; // test conversion - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - - interface ExprefTestClass_inter_struct_exc_Interface1 - { - void i(); - } - public interface ExprefTestClass_inter_struct_exc_Interface2 - { - void j(); - } - - struct ExprefTestClass_inter_struct_exc_struct1 : ExprefTestClass_inter_struct_exc_Interface1 - { - public void i() - {//Old Print - } - } - struct TheStruct2 : ExprefTestClass_inter_struct_exc_Interface1 - { - public void i() - {//Old Print - } - } - - public class ExprefTestClass_inter_struct_exc - { - public static bool testMethod() - { - //Old Print - ExprefTestClass_inter_struct_exc_struct1 theStruct1 = new ExprefTestClass_inter_struct_exc_struct1(); - //Old Print - return true; - theStruct1.i(); - ExprefTestClass_inter_struct_exc_Interface1 ExprefTestClass_inter_struct_exc_Interface1; - ExprefTestClass_inter_struct_exc_Interface1 = theStruct1; - theStruct1 = (ExprefTestClass_inter_struct_exc_struct1)ExprefTestClass_inter_struct_exc_Interface1; - theStruct1.i(); - TheStruct2 theStruct2; - theStruct2 = (TheStruct2)ExprefTestClass_inter_struct_exc_Interface1; - theStruct2.i(); - //ExprefTestClass_inter_struct_exc.TestRoutine(ExprefTestClass_inter_struct_exc_Interface1); - // NOTE: Currently detects this during compile time; try passing ExprefTestClass_inter_struct_exc_Interface1 to a method - // to see if that will defeat the compile-time flow analysis. - } - } - interface ExprefTestClass_class_inter_I1 - { - void i(); - } - interface ExprefTestClass_class_inter_I2 - { - void j(); - } - - class ExprefTestClass_class_inter_C1 : ExprefTestClass_class_inter_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_class_inter_C2 : ExprefTestClass_class_inter_C1, ExprefTestClass_class_inter_I2 - { - public void j() - {//Old Print - } - } - public class ExprefTestClass_class_inter - { - public static bool testMethod() - { - ExprefTestClass_class_inter_C1 thebase = new ExprefTestClass_class_inter_C2(); - try - { - ExprefTestClass_class_inter_I2 i2 = (ExprefTestClass_class_inter_I2)thebase; - i2.j(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_class_inter_exc_I1 - { - void i(); - } - interface ExprefTestClass_class_inter_exc_I2 - { - void j(); - } - - class ExprefTestClass_class_inter_exc_C1 : ExprefTestClass_class_inter_exc_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_class_inter_exc_C2 : ExprefTestClass_class_inter_exc_C1 - { - } - public class ExprefTestClass_class_inter_exc - { - public static bool testMethod() - { - ExprefTestClass_class_inter_exc_C1 thebase = new ExprefTestClass_class_inter_exc_C2(); - try - { - ExprefTestClass_class_inter_exc_I2 i2 = (ExprefTestClass_class_inter_exc_I2)thebase; - i2.j(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class_I1 - { - void i(); - } - class ExprefTestClass_inter_class_C1 : ExprefTestClass_inter_class_I1 - { - public void i() {/*Old Print*/} - } - class ExprefTestClass_inter_class_C2 : ExprefTestClass_inter_class_I1 - { - public void i() {/*Old Print*/} - } - public class ExprefTestClass_inter_class - { - public static bool testMethod() - { - ExprefTestClass_inter_class_I1 inter = new ExprefTestClass_inter_class_C1(); - try - { - ExprefTestClass_inter_class_C1 c1 = (ExprefTestClass_inter_class_C1)inter; - c1.i(); - } - catch (System.Exception) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class2_I1 - { - void i(); - } - interface ExprefTestClass_inter_class2_I2 - { - void j(); - } - class ExprefTestClass_inter_class2_C1 : ExprefTestClass_inter_class2_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_inter_class2_C2 : ExprefTestClass_inter_class2_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_inter_class2_C3 : ExprefTestClass_inter_class2_C1, ExprefTestClass_inter_class2_I2 - { - public void j() - {//Old Print - } - } - public class ExprefTestClass_inter_class2 - { - public static bool testMethod() - { - ExprefTestClass_inter_class2_I2 inter = new ExprefTestClass_inter_class2_C3(); - try - { - ExprefTestClass_inter_class2_C1 c1 = (ExprefTestClass_inter_class2_C1)inter; - c1.i(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class2_exc1_I1 - { - void i(); - } - interface ExprefTestClass_inter_class2_exc1_I2 - { - void j(); - } - class ExprefTestClass_inter_class2_exc1_C1 : ExprefTestClass_inter_class2_exc1_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_inter_class2_exc1_C2 : ExprefTestClass_inter_class2_exc1_I2 - { - public void j() - {//Old Print - } - } - public class ExprefTestClass_inter_class2_exc1 - { - public static bool testMethod() - { - ExprefTestClass_inter_class2_exc1_I2 inter = new ExprefTestClass_inter_class2_exc1_C2(); - try - { - ExprefTestClass_inter_class2_exc1_C1 c1 = (ExprefTestClass_inter_class2_exc1_C1)inter; - c1.i(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class2_exc2_I1 - { - void i(); - } - interface ExprefTestClass_inter_class2_exc2_I2 - { - void j(); - } - class ExprefTestClass_inter_class2_exc2_C1 : ExprefTestClass_inter_class2_exc2_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_inter_class2_exc2_C2 : ExprefTestClass_inter_class2_exc2_I2 - { - public void j() - {//Old Print - } - } - class ExprefTestClass_inter_class2_exc2_C3 : ExprefTestClass_inter_class2_exc2_C1 - { - } - public class ExprefTestClass_inter_class2_exc2 - { - public static bool testMethod() - { - ExprefTestClass_inter_class2_exc2_I2 inter = new ExprefTestClass_inter_class2_exc2_C2(); - try - { - ExprefTestClass_inter_class2_exc2_C1 c1 = (ExprefTestClass_inter_class2_exc2_C1)inter; - c1.i(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class_exc_I1 - { - void i(); - } - class ExprefTestClass_inter_class_exc_C1 : ExprefTestClass_inter_class_exc_I1 - { - public void i() - {//Old Print - } - } - class ExprefTestClass_inter_class_exc_C2 : ExprefTestClass_inter_class_exc_I1 - { - public void i() - {//Old Print - } - } - public class ExprefTestClass_inter_class_exc - { - public static bool testMethod() - { - ExprefTestClass_inter_class_exc_I1 inter = new ExprefTestClass_inter_class_exc_C1(); - try - { - ExprefTestClass_inter_class_exc_C2 c2 = (ExprefTestClass_inter_class_exc_C2)inter; - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class_sealed_I1 - { - void i(); - } - sealed class ExprefTestClass_inter_class_sealed_C1 : ExprefTestClass_inter_class_sealed_I1 - { - public void i() {/*Old Print*/} - } - class ExprefTestClass_inter_class_sealed_C2 : ExprefTestClass_inter_class_sealed_I1 - { - public void i() {/*Old Print*/} - } - public class ExprefTestClass_inter_class_sealed - { - public static bool testMethod() - { - ExprefTestClass_inter_class_sealed_I1 inter = new ExprefTestClass_inter_class_sealed_C1(); - try - { - ExprefTestClass_inter_class_sealed_C1 c1 = (ExprefTestClass_inter_class_sealed_C1)inter; - c1.i(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_class_sealed_exc_I1 - { - void i(); - } - sealed class ExprefTestClass_inter_class_sealed_exc_C1 : ExprefTestClass_inter_class_sealed_exc_I1 - { - public void i() {/*Old Print*/} - } - class ExprefTestClass_inter_class_sealed_exc_C2 : ExprefTestClass_inter_class_sealed_exc_I1 - { - public void i() {/*Old Print*/} - } - public class ExprefTestClass_inter_class_sealed_exc - { - public static bool testMethod() - { - ExprefTestClass_inter_class_sealed_exc_I1 inter = new ExprefTestClass_inter_class_sealed_exc_C1(); - try - { - ExprefTestClass_inter_class_sealed_exc_C2 c2 = (ExprefTestClass_inter_class_sealed_exc_C2)inter; - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - interface ExprefTestClass_inter_inter_I1 - { - void i(); - } - interface ExprefTestClass_inter_inter_I2 - { - void j(); - } - - class ExprefTestClass_inter_inter_C1 : ExprefTestClass_inter_inter_I1 - { - public void i() {/*Old Print*/} - } - class ExprefTestClass_inter_inter_C2 : ExprefTestClass_inter_inter_C1, ExprefTestClass_inter_inter_I2 - { - public void j() {/*Old Print*/} - } - public class ExprefTestClass_inter_inter - { - public static bool testMethod() - { - ExprefTestClass_inter_inter_I2 i2 = (ExprefTestClass_inter_inter_I2)new ExprefTestClass_inter_inter_C2(); - try - { - ExprefTestClass_inter_inter_I1 i1 = (ExprefTestClass_inter_inter_I1)i2; - i1.i(); - } - catch (System.Exception e) - { - //Old Print - } - return true; - - } - } - interface ExprefTestClass_inter_inter_exc_I1 - { - void i(); - } - interface ExprefTestClass_inter_inter_exc_I2 - { - void j(); - } - interface ExprefTestClass_inter_inter_exc_I3 - { - void k(); - } - - class ExprefTestClass_inter_inter_exc_C1 : ExprefTestClass_inter_inter_exc_I1 - { - public void i() {/*Old Print*/} - } - class ExprefTestClass_inter_inter_exc_C2 : ExprefTestClass_inter_inter_exc_C1, ExprefTestClass_inter_inter_exc_I2 - { - public void j() {/*Old Print*/} - } - public class ExprefTestClass_inter_inter_exc - { - public static bool testMethod() - { - ExprefTestClass_inter_inter_exc_I2 i2 = (ExprefTestClass_inter_inter_exc_I2)new ExprefTestClass_inter_inter_exc_C2(); - try - { - ExprefTestClass_inter_inter_exc_I3 i3 = (ExprefTestClass_inter_inter_exc_I3)i2; - } - catch (System.Exception e) - { - //Old Print - } - return true; - } - } - - } + [TestMethod] + public void Expref_obj_ref_Test() + { + // Converting from 'object' to a reference object. + Assert.IsTrue(ExprefTestClass_obj_ref.testMethod()); + } + + [TestMethod] + public void Expref_obj_ref_exc_Test() + { + + // Converting from 'object' to a reference object. + Assert.IsTrue(ExprefTestClass_obj_ref_exc.testMethod()); + } + + [TestMethod] + public void Expref_class_class_Test() + { + + // Tests that you can convert from a base class to a derived class + Assert.IsTrue(ExprefTestClass_class_class.testMethod()); + } + + [TestMethod] + public void Expref_class_class_exc_Test() + { + + // Tests that you can convert from a base class to a derived class + Assert.IsTrue(ExprefTestClass_class_class_exc.testMethod()); + } + + [TestMethod] + public void Expref_inter_struct_exc_Test() + { + + // Tests that you can convert from an interface to a struct that implements it. + Assert.IsTrue(ExprefTestClass_inter_struct_exc.testMethod()); + } + + [TestMethod] + public void Expref_class_inter_Test() + { + // Tests converting from a class to an interface that the class does not implement (but a derived class might). + Assert.IsTrue(ExprefTestClass_class_inter.testMethod()); + } + + [TestMethod] + public void Expref_class_inter_exc_Test() + { + // Tests converting from a class to an interface that the class does not implement (but a derived class might). + Assert.IsTrue(ExprefTestClass_class_inter_exc.testMethod()); + } + + [TestMethod] + public void Expref_inter_class_Test() + { + // Tests converting from an interface to a class + // From any interface-type S to any class-type T, provided T is not sealed, or provided T implements S. + // If T implements S: + Assert.IsTrue(ExprefTestClass_inter_class.testMethod()); + } + + [TestMethod] + public void Expref_inter_class2_Test() + { + // Tests converting from an interface to a class + Assert.IsTrue(ExprefTestClass_inter_class2.testMethod()); + } + + [TestMethod] + public void Expref_inter_class2_exc1_Test() + { + // Tests converting from an interface to a class + Assert.IsTrue(ExprefTestClass_inter_class2_exc1.testMethod()); + } + + [TestMethod] + public void Expref_inter_class2_exc2_Test() + { + + // Tests converting from an interface to a class + Assert.IsTrue(ExprefTestClass_inter_class2_exc2.testMethod()); + } + + [TestMethod] + public void Expref_inter_class_exc_Test() + { + + // Tests converting from an interface to a class + Assert.IsTrue(ExprefTestClass_inter_class_exc.testMethod()); + } + + [TestMethod] + public void Expref_inter_class_sealed_Test() + { + // Tests converting from an interface to a class + Assert.IsTrue(ExprefTestClass_inter_class_sealed.testMethod()); + } + + [TestMethod] + public void Expref_inter_class_sealed_exc_Test() + { + // Tests converting from an interface to a class + Assert.IsTrue(ExprefTestClass_inter_class_sealed_exc.testMethod()); + } + + [TestMethod] + public void Expref_inter_inter_Test() + { + // Tests converting from an interface to an interface + Assert.IsTrue(ExprefTestClass_inter_inter.testMethod()); + } + + [TestMethod] + public void Expref_inter_inter_exc_Test() + { + // Tests converting from an interface to an interface + Assert.IsTrue(ExprefTestClass_inter_inter_exc.testMethod()); + } + + [TestMethod] + public void Impenum_zero_Test() + { + // Tests whether 0 can be converted to various enum types... + Assert.IsTrue(ImpenumTestClass_zero.testMethod()); + } + + [TestMethod] + public void Impref_ref_obj_Test() + { + // Converting from a reference object to 'object' + Assert.IsTrue(ImprefTestClass_ref_obj.testMethod()); + } + + [TestMethod] + public void Impref_class_class_Test() + { + // Tests that you can convert from a class to a base class. + Assert.IsTrue(ImprefTestClass_class_class.testMethod()); + } + + [TestMethod] + public void Impref_class_inter_Test() + { + // Tests that you can convert from a class to an interface that it implements. + Assert.IsTrue(ImprefTestClass_class_inter.testMethod()); + } + + [TestMethod] + public void Impref_struct_inter_Test() + { + // Tests that you can convert from a struct to an interface that it implements. + Assert.IsTrue(ImprefTestClass_struct_inter.testMethod()); + } + + [TestMethod] + public void Impref_array_array_Test() + { + // Tests that you can convert from an array of one class to an array of another class... + Assert.IsTrue(ImprefTestClass_array_array.testMethod()); + } + + [TestMethod] + public void Impref_array_cloneable_Test() + { + // Tests that you can convert from an array to System.ICloneable; + Assert.IsTrue(ImprefTestClass_array_cloneable.testMethod()); + } + + [TestMethod] + public void Impref_null_ref_Test() + { + // Tests that you can convert from null to several reference types + Assert.IsTrue(ImprefTestClass_null_ref.testMethod()); + } + + [TestMethod] + public void Impref_delegate_to_SystemDotDelegate_Test() + { + // Tests that you can convert from a delegate type to System.Delegate + Assert.IsTrue(ImprefTestClass_delegate_to_SystemDotDelegate.testMethod()); + } + + + //Compiled Test Cases + public class ImprefTestClass_ref_obj_Sub + { + int func() { return (1); } + } + public class ImprefTestClass_ref_obj + { + public static bool testMethod() + { + ImprefTestClass_ref_obj_Sub test = new ImprefTestClass_ref_obj_Sub(); + object obj; + obj = test; + return true; + } + } + + class ImprefTestClass_class_class_Der1 + { + void i() { } + } + + class ImprefTestClass_class_class_Der2 : ImprefTestClass_class_class_Der1 + { + void j() { } + } + public class ImprefTestClass_class_class + { + public static bool testMethod() + { + ImprefTestClass_class_class_Der2 derivedClass = new ImprefTestClass_class_class_Der2(); + + ImprefTestClass_class_class_Der1 ImprefTestClass_class_class_Base; + ImprefTestClass_class_class_Base = derivedClass; + return true; + } + } + + interface ImprefTestClass_class_inter_Interface1 + { + void i(); + } + interface ImprefTestClass_class_inter_Interface2 + { + void j(); + } + + class ImprefTestClass_class_inter_Sub : ImprefTestClass_class_inter_Interface1, ImprefTestClass_class_inter_Interface2 + { + public void i() { } + public void j() { } + } + public class ImprefTestClass_class_inter + { + public static bool testMethod() + { + ImprefTestClass_class_inter_Sub ImprefTestClass_class_inter_Sub = new ImprefTestClass_class_inter_Sub(); + ImprefTestClass_class_inter_Interface2 inter2; + ImprefTestClass_class_inter_Interface1 inter1; + inter1 = ImprefTestClass_class_inter_Sub; + inter2 = ImprefTestClass_class_inter_Sub; + return true; + } + + } + + interface ImprefTestClass_struct_inter_Interface1 + { + void i(); + } + interface ImprefTestClass_struct_inter_Interface2 + { + void j(); + } + + struct ImprefTestClass_struct_inter_Sub : ImprefTestClass_struct_inter_Interface1, ImprefTestClass_struct_inter_Interface2 + { + public void i() { } + public void j() { } + } + public class ImprefTestClass_struct_inter + { + public static bool testMethod() + { + ImprefTestClass_struct_inter_Sub ImprefTestClass_struct_inter_Sub = new ImprefTestClass_struct_inter_Sub(); + ImprefTestClass_struct_inter_Interface2 inter2; + ImprefTestClass_struct_inter_Interface1 inter1; + inter2 = ImprefTestClass_struct_inter_Sub; + inter1 = ImprefTestClass_struct_inter_Sub; + return true; + } + } + + class ImprefTestClass_array_array_Base1 + { + public void i() { } + } + + class ImprefTestClass_array_array_Base2 : ImprefTestClass_array_array_Base1 + { + public void j() { } + } + public class ImprefTestClass_array_array + { + public static bool testMethod() + { + ImprefTestClass_array_array_Base2[] arrDer = new ImprefTestClass_array_array_Base2[1]; + ImprefTestClass_array_array_Base2 element = new ImprefTestClass_array_array_Base2(); + arrDer[0] = element; + ImprefTestClass_array_array_Base1[] arrBase = new ImprefTestClass_array_array_Base1[1]; + arrBase = arrDer; + element.j(); + arrBase[0].i(); + return true; + } + } + + class ImprefTestClass_array_cloneable_Derived + { + public void i() { } + } + + public class ImprefTestClass_array_cloneable + { + public static bool testMethod() + { + ImprefTestClass_array_cloneable_Derived[] arrBase = new ImprefTestClass_array_cloneable_Derived[1]; + ICloneable clone; + clone = arrBase; + return true; + } + } + + class ImprefTestClass_null_ref_Derived + { + public void i() { } + } + public class ImprefTestClass_null_ref + { + public static bool testMethod() + { + ImprefTestClass_null_ref_Derived classDer1; + String string1; + classDer1 = null; + string1 = null; + return true; + } + } + + delegate void ImprefTestClass_delegate_to_SystemDotDelegate_Delegate(); + class ImprefTestClass_delegate_to_SystemDotDelegate + { + public static void DoNothing() { } + public static bool testMethod() + { + ImprefTestClass_delegate_to_SystemDotDelegate_Delegate src = new ImprefTestClass_delegate_to_SystemDotDelegate_Delegate(ImprefTestClass_delegate_to_SystemDotDelegate.DoNothing); + System.Delegate dst = src; + src(); + return true; + } + } + + + enum ImpenumTestClass_zero_Test1 : int + { + a, + b, + c + } + enum ImpenumTestClass_zero_Test2 : short + { + a, + b, + c + } + enum ImpenumTestClass_zero_Test3 : long + { + a, + b, + c + } + public class ImpenumTestClass_zero + { + public static bool testMethod() + { + ImpenumTestClass_zero_Test1 t1 = 0; + ImpenumTestClass_zero_Test2 t2 = 0; + ImpenumTestClass_zero_Test3 t3 = 0; + return true; + } + } + + + //Compiled Test Cases + public class ExprefTestClass_obj_ref_Sub1 + { + public void func() {/*Old Print*/} + } + public class ExprefTestClass_obj_ref_Sub2 + { + public void func() {/*Old Print*/} + } + public class ExprefTestClass_obj_ref + { + public static bool testMethod() + { + ExprefTestClass_obj_ref_Sub1 test = new ExprefTestClass_obj_ref_Sub1(); + object obj; + obj = test; // implicit setup + test = (ExprefTestClass_obj_ref_Sub1)obj; + test.func(); + return true; + } + } + + public class ExprefTestClass_obj_ref_exc_Sub1 + { + int func() { return (1); } + } + public class ExprefTestClass_obj_ref_exc_Sub2 + { + int func() { return (1); } + } + public class ExprefTestClass_obj_ref_exc + { + public static bool testMethod() + { + ExprefTestClass_obj_ref_exc_Sub1 test = new ExprefTestClass_obj_ref_exc_Sub1(); + ExprefTestClass_obj_ref_exc_Sub2 test2; + object obj; + obj = test; // implicit setup + try + { + test2 = (ExprefTestClass_obj_ref_exc_Sub2)obj; // obj is *not* a test2 + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + + class ExprefTestClass_class_class_Base1 + { + void i() { } + } + + class ExprefTestClass_class_class_Base2 : ExprefTestClass_class_class_Base1 + { + void j() { } + } + public class ExprefTestClass_class_class + { + public static bool testMethod() + { + ExprefTestClass_class_class_Base2 derivedClass = new ExprefTestClass_class_class_Base2(); + + ExprefTestClass_class_class_Base1 myBase; + myBase = derivedClass; // implicit conversion + derivedClass = (ExprefTestClass_class_class_Base2)myBase; // test conversion + return true; + } + } + + class ExprefTestClass_class_class_exc_Base + { + void i() { } + } + + class ExprefTestClass_class_class_exc_Der1 : ExprefTestClass_class_class_exc_Base + { + void j() { } + } + class ExprefTestClass_class_class_exc_Der2 : ExprefTestClass_class_class_exc_Base + { + void k() { } + } + public class ExprefTestClass_class_class_exc + { + public static bool testMethod() + { + ExprefTestClass_class_class_exc_Der1 derivedClass = new ExprefTestClass_class_class_exc_Der1(); + + ExprefTestClass_class_class_exc_Base myBase; + ExprefTestClass_class_class_exc_Der2 derivedClass3; + myBase = derivedClass; // implicit conversion + try + { + derivedClass3 = (ExprefTestClass_class_class_exc_Der2)myBase; // test conversion + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + + interface ExprefTestClass_inter_struct_exc_Interface1 + { + void i(); + } + public interface ExprefTestClass_inter_struct_exc_Interface2 + { + void j(); + } + + struct ExprefTestClass_inter_struct_exc_struct1 : ExprefTestClass_inter_struct_exc_Interface1 + { + public void i() + {//Old Print + } + } + struct TheStruct2 : ExprefTestClass_inter_struct_exc_Interface1 + { + public void i() + {//Old Print + } + } + + public class ExprefTestClass_inter_struct_exc + { + public static bool testMethod() + { + //Old Print + ExprefTestClass_inter_struct_exc_struct1 theStruct1 = new ExprefTestClass_inter_struct_exc_struct1(); + //Old Print + return true; + theStruct1.i(); + ExprefTestClass_inter_struct_exc_Interface1 ExprefTestClass_inter_struct_exc_Interface1; + ExprefTestClass_inter_struct_exc_Interface1 = theStruct1; + theStruct1 = (ExprefTestClass_inter_struct_exc_struct1)ExprefTestClass_inter_struct_exc_Interface1; + theStruct1.i(); + TheStruct2 theStruct2; + theStruct2 = (TheStruct2)ExprefTestClass_inter_struct_exc_Interface1; + theStruct2.i(); + //ExprefTestClass_inter_struct_exc.TestRoutine(ExprefTestClass_inter_struct_exc_Interface1); + // NOTE: Currently detects this during compile time; try passing ExprefTestClass_inter_struct_exc_Interface1 to a method + // to see if that will defeat the compile-time flow analysis. + } + } + interface ExprefTestClass_class_inter_I1 + { + void i(); + } + interface ExprefTestClass_class_inter_I2 + { + void j(); + } + + class ExprefTestClass_class_inter_C1 : ExprefTestClass_class_inter_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_class_inter_C2 : ExprefTestClass_class_inter_C1, ExprefTestClass_class_inter_I2 + { + public void j() + {//Old Print + } + } + public class ExprefTestClass_class_inter + { + public static bool testMethod() + { + ExprefTestClass_class_inter_C1 thebase = new ExprefTestClass_class_inter_C2(); + try + { + ExprefTestClass_class_inter_I2 i2 = (ExprefTestClass_class_inter_I2)thebase; + i2.j(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_class_inter_exc_I1 + { + void i(); + } + interface ExprefTestClass_class_inter_exc_I2 + { + void j(); + } + + class ExprefTestClass_class_inter_exc_C1 : ExprefTestClass_class_inter_exc_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_class_inter_exc_C2 : ExprefTestClass_class_inter_exc_C1 + { + } + public class ExprefTestClass_class_inter_exc + { + public static bool testMethod() + { + ExprefTestClass_class_inter_exc_C1 thebase = new ExprefTestClass_class_inter_exc_C2(); + try + { + ExprefTestClass_class_inter_exc_I2 i2 = (ExprefTestClass_class_inter_exc_I2)thebase; + i2.j(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class_I1 + { + void i(); + } + class ExprefTestClass_inter_class_C1 : ExprefTestClass_inter_class_I1 + { + public void i() {/*Old Print*/} + } + class ExprefTestClass_inter_class_C2 : ExprefTestClass_inter_class_I1 + { + public void i() {/*Old Print*/} + } + public class ExprefTestClass_inter_class + { + public static bool testMethod() + { + ExprefTestClass_inter_class_I1 inter = new ExprefTestClass_inter_class_C1(); + try + { + ExprefTestClass_inter_class_C1 c1 = (ExprefTestClass_inter_class_C1)inter; + c1.i(); + } + catch (System.Exception) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class2_I1 + { + void i(); + } + interface ExprefTestClass_inter_class2_I2 + { + void j(); + } + class ExprefTestClass_inter_class2_C1 : ExprefTestClass_inter_class2_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_inter_class2_C2 : ExprefTestClass_inter_class2_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_inter_class2_C3 : ExprefTestClass_inter_class2_C1, ExprefTestClass_inter_class2_I2 + { + public void j() + {//Old Print + } + } + public class ExprefTestClass_inter_class2 + { + public static bool testMethod() + { + ExprefTestClass_inter_class2_I2 inter = new ExprefTestClass_inter_class2_C3(); + try + { + ExprefTestClass_inter_class2_C1 c1 = (ExprefTestClass_inter_class2_C1)inter; + c1.i(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class2_exc1_I1 + { + void i(); + } + interface ExprefTestClass_inter_class2_exc1_I2 + { + void j(); + } + class ExprefTestClass_inter_class2_exc1_C1 : ExprefTestClass_inter_class2_exc1_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_inter_class2_exc1_C2 : ExprefTestClass_inter_class2_exc1_I2 + { + public void j() + {//Old Print + } + } + public class ExprefTestClass_inter_class2_exc1 + { + public static bool testMethod() + { + ExprefTestClass_inter_class2_exc1_I2 inter = new ExprefTestClass_inter_class2_exc1_C2(); + try + { + ExprefTestClass_inter_class2_exc1_C1 c1 = (ExprefTestClass_inter_class2_exc1_C1)inter; + c1.i(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class2_exc2_I1 + { + void i(); + } + interface ExprefTestClass_inter_class2_exc2_I2 + { + void j(); + } + class ExprefTestClass_inter_class2_exc2_C1 : ExprefTestClass_inter_class2_exc2_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_inter_class2_exc2_C2 : ExprefTestClass_inter_class2_exc2_I2 + { + public void j() + {//Old Print + } + } + class ExprefTestClass_inter_class2_exc2_C3 : ExprefTestClass_inter_class2_exc2_C1 + { + } + public class ExprefTestClass_inter_class2_exc2 + { + public static bool testMethod() + { + ExprefTestClass_inter_class2_exc2_I2 inter = new ExprefTestClass_inter_class2_exc2_C2(); + try + { + ExprefTestClass_inter_class2_exc2_C1 c1 = (ExprefTestClass_inter_class2_exc2_C1)inter; + c1.i(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class_exc_I1 + { + void i(); + } + class ExprefTestClass_inter_class_exc_C1 : ExprefTestClass_inter_class_exc_I1 + { + public void i() + {//Old Print + } + } + class ExprefTestClass_inter_class_exc_C2 : ExprefTestClass_inter_class_exc_I1 + { + public void i() + {//Old Print + } + } + public class ExprefTestClass_inter_class_exc + { + public static bool testMethod() + { + ExprefTestClass_inter_class_exc_I1 inter = new ExprefTestClass_inter_class_exc_C1(); + try + { + ExprefTestClass_inter_class_exc_C2 c2 = (ExprefTestClass_inter_class_exc_C2)inter; + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class_sealed_I1 + { + void i(); + } + sealed class ExprefTestClass_inter_class_sealed_C1 : ExprefTestClass_inter_class_sealed_I1 + { + public void i() {/*Old Print*/} + } + class ExprefTestClass_inter_class_sealed_C2 : ExprefTestClass_inter_class_sealed_I1 + { + public void i() {/*Old Print*/} + } + public class ExprefTestClass_inter_class_sealed + { + public static bool testMethod() + { + ExprefTestClass_inter_class_sealed_I1 inter = new ExprefTestClass_inter_class_sealed_C1(); + try + { + ExprefTestClass_inter_class_sealed_C1 c1 = (ExprefTestClass_inter_class_sealed_C1)inter; + c1.i(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_class_sealed_exc_I1 + { + void i(); + } + sealed class ExprefTestClass_inter_class_sealed_exc_C1 : ExprefTestClass_inter_class_sealed_exc_I1 + { + public void i() {/*Old Print*/} + } + class ExprefTestClass_inter_class_sealed_exc_C2 : ExprefTestClass_inter_class_sealed_exc_I1 + { + public void i() {/*Old Print*/} + } + public class ExprefTestClass_inter_class_sealed_exc + { + public static bool testMethod() + { + ExprefTestClass_inter_class_sealed_exc_I1 inter = new ExprefTestClass_inter_class_sealed_exc_C1(); + try + { + ExprefTestClass_inter_class_sealed_exc_C2 c2 = (ExprefTestClass_inter_class_sealed_exc_C2)inter; + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + interface ExprefTestClass_inter_inter_I1 + { + void i(); + } + interface ExprefTestClass_inter_inter_I2 + { + void j(); + } + + class ExprefTestClass_inter_inter_C1 : ExprefTestClass_inter_inter_I1 + { + public void i() {/*Old Print*/} + } + class ExprefTestClass_inter_inter_C2 : ExprefTestClass_inter_inter_C1, ExprefTestClass_inter_inter_I2 + { + public void j() {/*Old Print*/} + } + public class ExprefTestClass_inter_inter + { + public static bool testMethod() + { + ExprefTestClass_inter_inter_I2 i2 = (ExprefTestClass_inter_inter_I2)new ExprefTestClass_inter_inter_C2(); + try + { + ExprefTestClass_inter_inter_I1 i1 = (ExprefTestClass_inter_inter_I1)i2; + i1.i(); + } + catch (System.Exception e) + { + //Old Print + } + return true; + + } + } + interface ExprefTestClass_inter_inter_exc_I1 + { + void i(); + } + interface ExprefTestClass_inter_inter_exc_I2 + { + void j(); + } + interface ExprefTestClass_inter_inter_exc_I3 + { + void k(); + } + + class ExprefTestClass_inter_inter_exc_C1 : ExprefTestClass_inter_inter_exc_I1 + { + public void i() {/*Old Print*/} + } + class ExprefTestClass_inter_inter_exc_C2 : ExprefTestClass_inter_inter_exc_C1, ExprefTestClass_inter_inter_exc_I2 + { + public void j() {/*Old Print*/} + } + public class ExprefTestClass_inter_inter_exc + { + public static bool testMethod() + { + ExprefTestClass_inter_inter_exc_I2 i2 = (ExprefTestClass_inter_inter_exc_I2)new ExprefTestClass_inter_inter_exc_C2(); + try + { + ExprefTestClass_inter_inter_exc_I3 i3 = (ExprefTestClass_inter_inter_exc_I3)i2; + } + catch (System.Exception e) + { + //Old Print + } + return true; + } + } + + } } diff --git a/Tests/NFUnitTestDelegates/Properties/AssemblyInfo.cs b/Tests/NFUnitTestDelegates/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestDelegates/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestDelegates/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs b/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs index a4591558..11714ac6 100644 --- a/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs +++ b/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestDelegates { diff --git a/Tests/NFUnitTestEnum/Properties/AssemblyInfo.cs b/Tests/NFUnitTestEnum/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestEnum/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestEnum/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestEnum/UnitTestEnumTests.cs b/Tests/NFUnitTestEnum/UnitTestEnumTests.cs index 647eb5df..4eaef607 100644 --- a/Tests/NFUnitTestEnum/UnitTestEnumTests.cs +++ b/Tests/NFUnitTestEnum/UnitTestEnumTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestEnum { @@ -415,7 +411,7 @@ public void Enum_EqualsTest_01() public class Enum_TestClass_Equals { public enum e1 { one = 1, two = 2, three = 3 }; - + public static void TestMethod() { var e1_one = e1.one; @@ -2528,8 +2524,8 @@ public static void TestMethod() OutputHelper.WriteLine(r.ToString()); Assert.AreEqual((int)r, 0x000f); } - } - + } + public class TestClassEnumFlags05 { public static void TestMethod() diff --git a/Tests/NFUnitTestException/Properties/AssemblyInfo.cs b/Tests/NFUnitTestException/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestException/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestException/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestException/UnitTestExceptionTests.cs b/Tests/NFUnitTestException/UnitTestExceptionTests.cs index 103f94b0..5c770958 100644 --- a/Tests/NFUnitTestException/UnitTestExceptionTests.cs +++ b/Tests/NFUnitTestException/UnitTestExceptionTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestException { diff --git a/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs b/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs index a3735af6..00843163 100644 --- a/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestGC/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestGC/TestGC.cs b/Tests/NFUnitTestGC/TestGC.cs index 3bf6bfcb..0bec97a8 100644 --- a/Tests/NFUnitTestGC/TestGC.cs +++ b/Tests/NFUnitTestGC/TestGC.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; namespace NFUnitTestGC { diff --git a/Tests/NFUnitTestGC/TestGCWithByteArrays.cs b/Tests/NFUnitTestGC/TestGCWithByteArrays.cs index 045f1767..1e236ab9 100644 --- a/Tests/NFUnitTestGC/TestGCWithByteArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithByteArrays.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestGC { diff --git a/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs b/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs index 102064ba..f840e0dc 100644 --- a/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithDateTimeArrays.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestGC { diff --git a/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs b/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs index e11be754..d0681ee6 100644 --- a/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithObjectArrays.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestGC { diff --git a/Tests/NFUnitTestGC/TestGCWithStringArrays.cs b/Tests/NFUnitTestGC/TestGCWithStringArrays.cs index f69c30e1..8c1beaa0 100644 --- a/Tests/NFUnitTestGC/TestGCWithStringArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithStringArrays.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestGC { @@ -22,7 +19,7 @@ public void TestCompactionForNotFixedStringArray() OutputHelper.WriteLine($"Starting iteration {loop}"); // First we create objects and holes that keeps some space that could be used by compaction. - + // Small count so compaction does not happen. HolderForString[] arrayOfStrings = new HolderForString[10]; RunStringAllocations(arrayOfStrings); diff --git a/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs b/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs index 5d272ec3..d9e4865a 100644 --- a/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs +++ b/Tests/NFUnitTestGC/TestGCWithTimeSpanArrays.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestGC { diff --git a/Tests/NFUnitTestInterface/Properties/AssemblyInfo.cs b/Tests/NFUnitTestInterface/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestInterface/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestInterface/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs b/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs index d52cb308..e1790974 100644 --- a/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs +++ b/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Collections; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestInterface { @@ -3433,7 +3429,7 @@ public SampleOrder(DateTime purchase, double cost) // OutputHelper.WriteLine($"Data about {c.Name}"); // OutputHelper.WriteLine($"Joined on {c.DateJoined}. Made {c.PreviousOrders.Count} orders, the last on {c.LastOrder}"); // // Reminders: - + // foreach (var item in c.Reminders) // { // OutputHelper.WriteLine($"\t{(item as Reminder).Subject} on {(item as Reminder).Date}"); diff --git a/Tests/NFUnitTestLexical/Properties/AssemblyInfo.cs b/Tests/NFUnitTestLexical/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestLexical/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestLexical/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs b/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs index 964c397c..da799c4c 100644 --- a/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs +++ b/Tests/NFUnitTestLexical/UnitTestLExicalTest1.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #define \u0066endf2 @@ -12,9 +9,9 @@ #define end\u0066 -using nanoFramework.TestFramework; using System; using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestLexical { diff --git a/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs b/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs index 1387cd1f..8c80db93 100644 --- a/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs +++ b/Tests/NFUnitTestLexical/UnitTestLexicalTest2.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #define while //Lexical_TestClass_pre_009 @@ -61,9 +58,8 @@ #define for //Lexical_TestClass_preproc_39 -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestLexical { @@ -253,8 +249,8 @@ public static int Main_old(string[] args) { int i = 2; #if while - while (--i > 0) - ; + while (--i > 0) + ; #endif return (i > 0 ? 1 : 0); } @@ -270,7 +266,7 @@ public static int Main_old(string[] args) { int i = 6; #if True1 == true - i--; + i--; #endif #if False1 == false i--; @@ -283,12 +279,12 @@ public static int Main_old(string[] args) #error #else #elif True2 == True1 #endif #if (True1 != false) && ((False1) == False2) && (true || false) - i--; + i--; #else #error #if (True != false) && ((False1) == False2) && (true || false) #endif #if ((true == True1) != (false && true)) - i--; + i--; #else #error ((true == True1) != (false && true)) #endif diff --git a/Tests/NFUnitTestNamespace/NS_attribute_01.cs b/Tests/NFUnitTestNamespace/NS_attribute_01.cs index 08817a26..0c79c795 100644 --- a/Tests/NFUnitTestNamespace/NS_attribute_01.cs +++ b/Tests/NFUnitTestNamespace/NS_attribute_01.cs @@ -1,22 +1,19 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; [assembly: CLSCompliant(true)] class NS_TestClass_attribute_01 { - public void printClassName() - { - OutputHelper.WriteLine("Class A"); - } + public void printClassName() + { + OutputHelper.WriteLine("Class A"); + } - static void Main_old() {} + static void Main_old() { } public static bool testMethod() { diff --git a/Tests/NFUnitTestNamespace/NS_attribute_02.cs b/Tests/NFUnitTestNamespace/NS_attribute_02.cs index 11bbfe35..c6a2d5e1 100644 --- a/Tests/NFUnitTestNamespace/NS_attribute_02.cs +++ b/Tests/NFUnitTestNamespace/NS_attribute_02.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; [module: CLSCompliant(true)] diff --git a/Tests/NFUnitTestNamespace/NS_compunit_01A.cs b/Tests/NFUnitTestNamespace/NS_compunit_01A.cs index 6396093b..d48058ae 100644 --- a/Tests/NFUnitTestNamespace/NS_compunit_01A.cs +++ b/Tests/NFUnitTestNamespace/NS_compunit_01A.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestNamespace/NS_compunit_01B.cs b/Tests/NFUnitTestNamespace/NS_compunit_01B.cs index a54710c3..cc25a81c 100644 --- a/Tests/NFUnitTestNamespace/NS_compunit_01B.cs +++ b/Tests/NFUnitTestNamespace/NS_compunit_01B.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestNamespace/NS_compunit_03A.cs b/Tests/NFUnitTestNamespace/NS_compunit_03A.cs index 7841dae5..8b0def48 100644 --- a/Tests/NFUnitTestNamespace/NS_compunit_03A.cs +++ b/Tests/NFUnitTestNamespace/NS_compunit_03A.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestNamespace/NS_compunit_03B.cs b/Tests/NFUnitTestNamespace/NS_compunit_03B.cs index ea116c92..d0049725 100644 --- a/Tests/NFUnitTestNamespace/NS_compunit_03B.cs +++ b/Tests/NFUnitTestNamespace/NS_compunit_03B.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + using nanoFramework.TestFramework; class NS_TestClass_compunit_03B diff --git a/Tests/NFUnitTestNamespace/NS_compunit_04A.cs b/Tests/NFUnitTestNamespace/NS_compunit_04A.cs index f55208fb..b0403f85 100644 --- a/Tests/NFUnitTestNamespace/NS_compunit_04A.cs +++ b/Tests/NFUnitTestNamespace/NS_compunit_04A.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace NS_TestClass_compunit_04_first { diff --git a/Tests/NFUnitTestNamespace/NS_compunit_04B.cs b/Tests/NFUnitTestNamespace/NS_compunit_04B.cs index 49c755cd..0932756c 100644 --- a/Tests/NFUnitTestNamespace/NS_compunit_04B.cs +++ b/Tests/NFUnitTestNamespace/NS_compunit_04B.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace NS_TestClass_compunit_04_second { diff --git a/Tests/NFUnitTestNamespace/NS_decl_14.cs b/Tests/NFUnitTestNamespace/NS_decl_14.cs index 06891922..84e021ea 100644 --- a/Tests/NFUnitTestNamespace/NS_decl_14.cs +++ b/Tests/NFUnitTestNamespace/NS_decl_14.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace NS_TestClass_decl_14_one.NS_TestClass_decl_14_two.NS_TestClass_decl_14_three { - class C - { - public int j; - } + class C + { + public int j; + } } \ No newline at end of file diff --git a/Tests/NFUnitTestNamespace/NS_decl_15.cs b/Tests/NFUnitTestNamespace/NS_decl_15.cs index f53ef60a..3e17846b 100644 --- a/Tests/NFUnitTestNamespace/NS_decl_15.cs +++ b/Tests/NFUnitTestNamespace/NS_decl_15.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace NS_TestClass_decl_15_one.NS_TestClass_decl_15_two.NS_TestClass_decl_15_three { - class C - { - public int j; - } + class C + { + public int j; + } } \ No newline at end of file diff --git a/Tests/NFUnitTestNamespace/Properties/AssemblyInfo.cs b/Tests/NFUnitTestNamespace/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestNamespace/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestNamespace/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs b/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs index 06ccae15..c36a507b 100644 --- a/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs +++ b/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs @@ -1,13 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; - +using nanoFramework.TestFramework; using NS_TestClass_alias_10_F = NS_TestClass_alias_10_Foo.Bar; namespace NFUnitTestNamespace @@ -29,7 +24,7 @@ public void NS_attribute_02_Test() { // Section 9.1 Compilation Units // Verify that the CLSCompliant attribute is allowed at the module level in a comp. unit (cause a warning) - Assert.IsTrue(NS_TestClass_attribute_02.testMethod()) ; + Assert.IsTrue(NS_TestClass_attribute_02.testMethod()); } [TestMethod] @@ -37,7 +32,7 @@ public void NS_compunit_01_Test() { // Section 9.1 Compilation Units // Verify that a program with multiple files depending on each other works - Assert.IsTrue(NS_TestClass_compunit_01.testMethod()) ; + Assert.IsTrue(NS_TestClass_compunit_01.testMethod()); } [TestMethod] @@ -1184,8 +1179,8 @@ class A { } namespace NS_TestClass_alias_04 { - using F = NS_TestClass_alias_04_Foo.Bar; using System; + using F = NS_TestClass_alias_04_Foo.Bar; class B : F.A { @@ -1216,8 +1211,6 @@ class B : NS_TestClass_alias_10_F.A { } namespace NS_TestClass_alias_10 { - using System; - class C : NS_TestClass_alias_10_F.A { } class main @@ -1236,9 +1229,6 @@ public static bool testMethod() namespace NS_TestClass_alias_13 { - using tns = NS_TestClass_alias_13; - using System; - class main { public static int Main_old() @@ -1255,9 +1245,6 @@ public static bool testMethod() namespace NS_TestClass_alias_14 { - using tns = NS_TestClass_alias_14.main; - using System; - class main { public static int Main_old() @@ -1280,7 +1267,6 @@ class A { } namespace NS_TestClass_direct_01 { using NS_TestClass_direct_01_Foo.Bar; - using System; class B : A { } @@ -1312,9 +1298,6 @@ public void showMessage() namespace NS_TestClass_direct_02 { - using NS_TestClass_direct_02_Foo.Bar; - using System; - class A { public void showMessage() @@ -1346,9 +1329,6 @@ class A { } namespace NS_TestClass_direct_03 { - using NS_TestClass_direct_03_Foo.Bar; - using System; - class A { public int i; @@ -1386,10 +1366,7 @@ class A { } namespace NS_TestClass_direct_05 { - using NS_TestClass_direct_05_Foo; - using NS_TestClass_direct_05_Bar; using A = NS_TestClass_direct_05_Foo.A; - using System; class main { diff --git a/Tests/NFUnitTestRecords/Properties/AssemblyInfo.cs b/Tests/NFUnitTestRecords/Properties/AssemblyInfo.cs index a3735af6..00843163 100644 --- a/Tests/NFUnitTestRecords/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestRecords/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestRecords/UnitTestRecords.cs b/Tests/NFUnitTestRecords/UnitTestRecords.cs index a66a5422..f661042b 100644 --- a/Tests/NFUnitTestRecords/UnitTestRecords.cs +++ b/Tests/NFUnitTestRecords/UnitTestRecords.cs @@ -1,5 +1,5 @@ -using nanoFramework.TestFramework; -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace NFUnitTestRecords { @@ -14,7 +14,7 @@ namespace NFUnitTestRecords // var dob = new DateTime(1998, 1, 31); // var id = Guid.NewGuid(); // var emptyGuid = Guid.Empty; - + // var newPerson = new Person(firstName, lastName, dob) // { // Id = emptyGuid, diff --git a/Tests/NFUnitTestStatementsTests/Properties/AssemblyInfo.cs b/Tests/NFUnitTestStatementsTests/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestStatementsTests/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestStatementsTests/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs b/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs index 4478c125..207bf0cf 100644 --- a/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs +++ b/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs @@ -1,6 +1,8 @@ -using nanoFramework.TestFramework; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestStatementsTests { diff --git a/Tests/NFUnitTestStruct/Properties/AssemblyInfo.cs b/Tests/NFUnitTestStruct/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestStruct/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestStruct/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestStruct/UnitTestStructs.cs b/Tests/NFUnitTestStruct/UnitTestStructs.cs index 257824c3..4d0b1f9d 100644 --- a/Tests/NFUnitTestStruct/UnitTestStructs.cs +++ b/Tests/NFUnitTestStruct/UnitTestStructs.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestStruct { diff --git a/Tests/NFUnitTestSystemLib/Properties/AssemblyInfo.cs b/Tests/NFUnitTestSystemLib/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestSystemLib/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestSystemLib/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestSystemLib/UnitTestBoolean.cs b/Tests/NFUnitTestSystemLib/UnitTestBoolean.cs index 27662120..3461a9eb 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestBoolean.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestBoolean.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestByte.cs b/Tests/NFUnitTestSystemLib/UnitTestByte.cs index b8e43c02..788b4187 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestByte.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestByte.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestChar.cs b/Tests/NFUnitTestSystemLib/UnitTestChar.cs index 388ec269..c2a8566f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestChar.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestChar.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs index cfabe632..0ae888af 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Globalization; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { @@ -196,7 +193,7 @@ public void DateTime_ToStringTest08() Assert.AreEqual(dt.Day, int.Parse(dtOutput1.Substring(3, 2)), "Wrong output1 in for 'dd'"); // check 'yyyy' Assert.AreEqual(dt.Year, int.Parse(dtOutput1.Substring(6, 4)), "Wrong output1 for 'yyyy'"); - + // check '/' Assert.AreEqual("/", dtOutput1.Substring(2, 1), "Wrong output1 in for '-'"); Assert.AreEqual("/", dtOutput1.Substring(5, 1), "Wrong output1 in for '-'"); @@ -249,10 +246,10 @@ public void DateTime_ToStringTest09() Assert.AreEqual(",", dtOutput1.Substring(endIndex, 1), "Wrong output1 in for ','"); // check ' ' Assert.AreEqual(" ", dtOutput1.Substring(endIndex + 1, 1), "Wrong output1 in for ' '"); - + // check 'dd' Assert.AreEqual(dt.Day, int.Parse(dtOutput1.Substring(endIndex + 2, 2)), "Wrong output1 in for 'dd'"); - + // check ' ' Assert.AreEqual(" ", dtOutput1.Substring(endIndex + 4, 1), "Wrong output1 in for ' '"); @@ -449,7 +446,7 @@ public void DateTime_ToStringTest11() throw new Exception($"Caught {ex.Message} when Trying DateTime.ToString(\"{specifier1}\")"); } } - + [TestMethod] public void DateTime_ToStringTest12() { @@ -768,7 +765,7 @@ public void DateTime_ToStringTest16() // check 'MMM' Assert.AreEqual( - DateTimeFormatInfo.CurrentInfo.AbbreviatedMonthNames[dt.Month -1], + DateTimeFormatInfo.CurrentInfo.AbbreviatedMonthNames[dt.Month - 1], dtOutput1.Substring(8, 3), "Wrong output1 in for 'MMM'"); Assert.AreEqual( DateTimeFormatInfo.CurrentInfo.AbbreviatedMonthNames[dt.Month - 1], @@ -910,7 +907,7 @@ public void DateTime_ToStringTest18() // expected format is HH:mm:ss int length = 8; - + // check length Assert.IsTrue(dtOutput1.Length >= length, $"Wrong output1 length: {dtOutput1.Length}, should have been at least {length}"); @@ -1398,14 +1395,14 @@ public void DateTime_ToStringTest26() Assert.AreEqual(dt.Hour, int.Parse(dtOutput1.Substring(7, 2)), "Wrong output1 in for 'HH'"); // check 'mm' - Assert.AreEqual(dt.Minute, int.Parse(dtOutput1.Substring(7+3, 2)), "Wrong output1 in for 'mm'"); + Assert.AreEqual(dt.Minute, int.Parse(dtOutput1.Substring(7 + 3, 2)), "Wrong output1 in for 'mm'"); // check 'ss' - Assert.AreEqual(dt.Second, int.Parse(dtOutput1.Substring(7+6, 2)), "Wrong output1 in for 'ss'"); + Assert.AreEqual(dt.Second, int.Parse(dtOutput1.Substring(7 + 6, 2)), "Wrong output1 in for 'ss'"); // check ':' - Assert.AreEqual(":", dtOutput1.Substring(7+2, 1), "Wrong output1 in for ':'"); - Assert.AreEqual(":", dtOutput1.Substring(7+5, 1), "Wrong output1 in for ':'"); + Assert.AreEqual(":", dtOutput1.Substring(7 + 2, 1), "Wrong output1 in for ':'"); + Assert.AreEqual(":", dtOutput1.Substring(7 + 5, 1), "Wrong output1 in for ':'"); // check ' ' Assert.AreEqual(" ", dtOutput1.Substring(2, 1), "Wrong output1 in for ' '"); diff --git a/Tests/NFUnitTestSystemLib/UnitTestDouble.cs b/Tests/NFUnitTestSystemLib/UnitTestDouble.cs index 7b847c30..de6a49ce 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDouble.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDouble.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; @@ -94,11 +91,11 @@ public void Equals() Assert.AreEqual(test.Expected, (double)test.D1 == d2); Assert.AreEqual(!test.Expected, (double)test.D1 != d2); } - + Assert.AreEqual(test.Expected, test.D1.GetHashCode().Equals(d2.GetHashCode())); } - if(test.Expected) + if (test.Expected) { Assert.IsTrue(test.D1.Equals(test.Value)); } diff --git a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs index 18358d7e..05c73642 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestGuid.cs b/Tests/NFUnitTestSystemLib/UnitTestGuid.cs index 7b351c3f..e2b3ea3b 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGuid.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGuid.cs @@ -1,13 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Collections; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs b/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs index 89ea8ecd..fea53af7 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Collections; -using System.Diagnostics; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { @@ -55,7 +51,7 @@ public void SystemType1_GetType_Test() // assigned to a object container (this used to lead to a access violation) Type type = typeof(int); list.Add(type); - string name = ((Type)list[i]).Name; + string name = ((Type)list[i]).Name; Assert.AreEqual(name, "Int32"); i++; diff --git a/Tests/NFUnitTestSystemLib/UnitTestInt16.cs b/Tests/NFUnitTestSystemLib/UnitTestInt16.cs index f4bb464e..7af03806 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestInt16.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestInt16.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestInt32.cs b/Tests/NFUnitTestSystemLib/UnitTestInt32.cs index cfaff43a..a6e20ede 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestInt32.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestInt32.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestInt64.cs b/Tests/NFUnitTestSystemLib/UnitTestInt64.cs index bbaee5e4..82b927ee 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestInt64.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestInt64.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs b/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs index 02d732b2..89fde6e7 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestParseTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestReflectionAssemblyTest.cs b/Tests/NFUnitTestSystemLib/UnitTestReflectionAssemblyTest.cs index 8be56104..61196017 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestReflectionAssemblyTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestReflectionAssemblyTest.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs b/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs index 96cc73b9..54b56ec2 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs @@ -1,12 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs b/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs index 0126ffd3..ad60549c 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; using System.Collections; -using System.Diagnostics; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { @@ -135,7 +131,7 @@ public void SystemReflectionType_RuntimeType_Test1() TestEnum en = TestEnum.Item1; t = en.GetType(); Assert.IsType(t.DeclaringType, typeof(UnitTestReflectionTypeTest)); - Assert.IsTrue( t.IsEnum); + Assert.IsTrue(t.IsEnum); Assert.IsFalse(t.IsAbstract); Assert.IsFalse(t.IsClass); Assert.IsFalse(t.IsPublic); @@ -152,7 +148,7 @@ public void SystemReflectionType_SystemType_Test2() Assert.IsFalse(typeof(Array).IsValueType); Assert.IsTrue(typeof(TestStruct).IsValueType); Assert.IsTrue(typeof(Type).IsSubclassOf(typeof(MemberInfo))); - Assert.AreEqual(typeof(Type).GetInterfaces()[0].Name , "IReflect"); + Assert.AreEqual(typeof(Type).GetInterfaces()[0].Name, "IReflect"); Assert.IsTrue(typeof(MyDelegate).IsInstanceOfType(new MyDelegate(MyDelegateImpl))); // Get known type from assembly qualified type name Culture and PublicKeyToken are used by debugger to identify types diff --git a/Tests/NFUnitTestSystemLib/UnitTestSByte.cs b/Tests/NFUnitTestSystemLib/UnitTestSByte.cs index 5b278fff..46b907a2 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestSByte.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestSByte.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestSingle.cs b/Tests/NFUnitTestSystemLib/UnitTestSingle.cs index c7e950c8..6d9eea6f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestSingle.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestSingle.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs index 1c9a3e12..46b94cfd 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestStringTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs b/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs index 6dcc3754..99472af7 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs b/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs index 6580cac9..90f09b2f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Reflection; +using nanoFramework.TestFramework; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestSystemLib/UnitTestUInt16.cs b/Tests/NFUnitTestSystemLib/UnitTestUInt16.cs index 8738df4f..53b19d6f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestUInt16.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestUInt16.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestUInt32.cs b/Tests/NFUnitTestSystemLib/UnitTestUInt32.cs index 3fb4389c..19f32666 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestUInt32.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestUInt32.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestUInt64.cs b/Tests/NFUnitTestSystemLib/UnitTestUInt64.cs index 5d9c229e..1863885f 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestUInt64.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestUInt64.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; diff --git a/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs b/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs index 0e9387b9..837e9399 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestWeakReferenceTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestSystemLib { diff --git a/Tests/NFUnitTestThread/Properties/AssemblyInfo.cs b/Tests/NFUnitTestThread/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestThread/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestThread/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs b/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs index 0d56c314..9acecefc 100644 --- a/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs +++ b/Tests/NFUnitTestThread/UnitTestAutoResetEvents.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { diff --git a/Tests/NFUnitTestThread/UnitTestInterlocTests.cs b/Tests/NFUnitTestThread/UnitTestInterlocTests.cs index 61328d68..2c67bff5 100644 --- a/Tests/NFUnitTestThread/UnitTestInterlocTests.cs +++ b/Tests/NFUnitTestThread/UnitTestInterlocTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { diff --git a/Tests/NFUnitTestThread/UnitTestMonitorTests.cs b/Tests/NFUnitTestThread/UnitTestMonitorTests.cs index 1e1c292c..621e5513 100644 --- a/Tests/NFUnitTestThread/UnitTestMonitorTests.cs +++ b/Tests/NFUnitTestThread/UnitTestMonitorTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { @@ -214,7 +210,7 @@ public void Monitor5_Repeatedly_Lock_Unlock_Test() if (!lockResult) { // Failure : both threads passed lock - throw new Exception("Failure : both threads passed lock"); + throw new Exception("Failure : both threads passed lock"); } // unlocking the final lock and verifying the waiting thread continues flag.Set(); diff --git a/Tests/NFUnitTestThread/UnitTestThreadTest.cs b/Tests/NFUnitTestThread/UnitTestThreadTest.cs index 5733c31b..3a45d57f 100644 --- a/Tests/NFUnitTestThread/UnitTestThreadTest.cs +++ b/Tests/NFUnitTestThread/UnitTestThreadTest.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { @@ -549,7 +545,7 @@ public void Threading_Suspend_Resume_Test7() public static bool sleptCorrect(int Msec) { - TimeSpan zeroDuration = new TimeSpan(0); + TimeSpan zeroDuration = new TimeSpan(0); const long TicksPerMillisecond = TimeSpan.TicksPerMillisecond; long startTime = DateTime.UtcNow.Ticks; diff --git a/Tests/NFUnitTestThread/UnitTestTimeTests.cs b/Tests/NFUnitTestThread/UnitTestTimeTests.cs index 60e57c1a..711c433b 100644 --- a/Tests/NFUnitTestThread/UnitTestTimeTests.cs +++ b/Tests/NFUnitTestThread/UnitTestTimeTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { diff --git a/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs b/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs index 03d0f892..ba7b33e0 100644 --- a/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs +++ b/Tests/NFUnitTestThread/UnitTestTimeoutTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { diff --git a/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs b/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs index c81581ec..80be7a5b 100644 --- a/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs +++ b/Tests/NFUnitTestThread/UnitTestWaitHandleTests.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; using System.Threading; +using nanoFramework.TestFramework; namespace NFUnitTestThread { diff --git a/Tests/NFUnitTestTypes/Properties/AssemblyInfo.cs b/Tests/NFUnitTestTypes/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestTypes/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestTypes/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs b/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs index e5b57de3..b4e464f1 100644 --- a/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs @@ -1,10 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; namespace NFUnitTestTypes { diff --git a/Tests/NFUnitTestTypes/UnitTestSubTypeTests.cs b/Tests/NFUnitTestTypes/UnitTestSubTypeTests.cs index cbe069e4..89404ce3 100644 --- a/Tests/NFUnitTestTypes/UnitTestSubTypeTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestSubTypeTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestTypes { @@ -16,11 +12,11 @@ class UnitTestSubTypeTests // Class1 and SubClass1 used for testing type def of inherited classes class Class1 { - public class SubClass1 + public class SubClass1 { void Method1() { - + } } diff --git a/Tests/NFUnitTestTypes/UnitTestTypes.cs b/Tests/NFUnitTestTypes/UnitTestTypes.cs index 12947d22..79615b1f 100644 --- a/Tests/NFUnitTestTypes/UnitTestTypes.cs +++ b/Tests/NFUnitTestTypes/UnitTestTypes.cs @@ -1,11 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; namespace NFUnitTestTypes { diff --git a/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs b/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs index a9c69f2b..f1d16d23 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestTypes { diff --git a/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs b/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs index 6670c3ba..6f56423b 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueDefultConstTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestTypes { @@ -242,7 +238,7 @@ public class ValueDefault_ConstTestClass16 public static void testMethod() { uint b = new uint(); - Assert.AreEqual(b , (uint)0) ; + Assert.AreEqual(b, (uint)0); } } diff --git a/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs b/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs index 8b772fa7..5c9cdd91 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; // disable a number of warnings that we are intentionally going to test #pragma warning disable CS1718 // Comparison made to same variable diff --git a/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs b/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs index 81bf0c72..e35203f5 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; // disable a number of warnings that we are intentionally going to test #pragma warning disable CS1718 // Comparison made to same variable diff --git a/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs b/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs index 767faa0d..803e6ca9 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs @@ -1,12 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; -using System.Diagnostics; +using nanoFramework.TestFramework; namespace NFUnitTestTypes { diff --git a/Tests/NFUnitTestTypes/UnitTestValueTests.cs b/Tests/NFUnitTestTypes/UnitTestValueTests.cs index d81910ca..6c69e409 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueTests.cs @@ -1,11 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; namespace NFUnitTestTypes { diff --git a/Tests/NFUnitTestTypes/UnitTestsSpanByte.cs b/Tests/NFUnitTestTypes/UnitTestsSpanByte.cs index e196eadd..e4ffde13 100644 --- a/Tests/NFUnitTestTypes/UnitTestsSpanByte.cs +++ b/Tests/NFUnitTestTypes/UnitTestsSpanByte.cs @@ -1,10 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestTypes { @@ -85,11 +83,11 @@ public void RaisingExceptionsOfAllKindsTests() public void ToArrayTest() { byte[] array = new byte[16] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; - + SpanByte span = new(array); - + byte[] toArray = span.ToArray(); - + CollectionAssert.AreEqual(array, toArray, "Original array and SpanByte.ToArray should be the same"); } diff --git a/Tests/NFUnitTestVariables/CategoryTests.cs b/Tests/NFUnitTestVariables/CategoryTests.cs index 3e8c7e25..dca43e4f 100644 --- a/Tests/NFUnitTestVariables/CategoryTests.cs +++ b/Tests/NFUnitTestVariables/CategoryTests.cs @@ -1,11 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework.TestFramework; using System; +using nanoFramework.TestFramework; namespace NFUnitTestVariables { diff --git a/Tests/NFUnitTestVariables/Properties/AssemblyInfo.cs b/Tests/NFUnitTestVariables/Properties/AssemblyInfo.cs index 0383fb89..4ec31859 100644 --- a/Tests/NFUnitTestVariables/Properties/AssemblyInfo.cs +++ b/Tests/NFUnitTestVariables/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/NFUnitTestVariables/VariableTests.cs b/Tests/NFUnitTestVariables/VariableTests.cs index 6d810af1..23f35eb1 100644 --- a/Tests/NFUnitTestVariables/VariableTests.cs +++ b/Tests/NFUnitTestVariables/VariableTests.cs @@ -1,12 +1,7 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using nanoFramework.TestFramework; -using System; -using System.Diagnostics; namespace NFUnitTestVariables { diff --git a/Tests/TestFramework/Properties/AssemblyInfo.cs b/Tests/TestFramework/Properties/AssemblyInfo.cs index 61f731f9..cb282cfb 100644 --- a/Tests/TestFramework/Properties/AssemblyInfo.cs +++ b/Tests/TestFramework/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/Tests/UnitTestLauncher/Properties/AssemblyInfo.cs b/Tests/UnitTestLauncher/Properties/AssemblyInfo.cs index 262254df..cfae6976 100644 --- a/Tests/UnitTestLauncher/Properties/AssemblyInfo.cs +++ b/Tests/UnitTestLauncher/Properties/AssemblyInfo.cs @@ -1,5 +1,7 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/nanoFramework.CoreLibrary/Friends.cs b/nanoFramework.CoreLibrary/Friends.cs index ffb1c951..97c62887 100644 --- a/nanoFramework.CoreLibrary/Friends.cs +++ b/nanoFramework.CoreLibrary/Friends.cs @@ -1,9 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// See LICENSE file in the project root for full license information. -// - -using System.Runtime.CompilerServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Math, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.ResourceManager, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] diff --git a/nanoFramework.CoreLibrary/System/Action.cs b/nanoFramework.CoreLibrary/System/Action.cs index 5028682b..c59194bd 100644 --- a/nanoFramework.CoreLibrary/System/Action.cs +++ b/nanoFramework.CoreLibrary/System/Action.cs @@ -1,13 +1,8 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { - using System.Runtime.CompilerServices; - /// /// Encapsulates a method that has no parameters and does not return a value. /// diff --git a/nanoFramework.CoreLibrary/System/AppDomain.cs b/nanoFramework.CoreLibrary/System/AppDomain.cs index 7c8786f7..6334ffaa 100644 --- a/nanoFramework.CoreLibrary/System/AppDomain.cs +++ b/nanoFramework.CoreLibrary/System/AppDomain.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. /////////////////////////////////////////////////// // DEV NOTE: to enable the AppDomain API add // diff --git a/nanoFramework.CoreLibrary/System/AppDomainUnloadedException.cs b/nanoFramework.CoreLibrary/System/AppDomainUnloadedException.cs index bf994af1..c3d49ef5 100644 --- a/nanoFramework.CoreLibrary/System/AppDomainUnloadedException.cs +++ b/nanoFramework.CoreLibrary/System/AppDomainUnloadedException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/ApplicationException.cs b/nanoFramework.CoreLibrary/System/ApplicationException.cs index 1938fe8a..1a8d84c1 100644 --- a/nanoFramework.CoreLibrary/System/ApplicationException.cs +++ b/nanoFramework.CoreLibrary/System/ApplicationException.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/ArgumentException.cs b/nanoFramework.CoreLibrary/System/ArgumentException.cs index f7b4f70e..0710e6b2 100644 --- a/nanoFramework.CoreLibrary/System/ArgumentException.cs +++ b/nanoFramework.CoreLibrary/System/ArgumentException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #nullable enable using System.Diagnostics.CodeAnalysis; @@ -27,7 +24,7 @@ public class ArgumentException : SystemException /// /// Initializes a new instance of the class. /// - public ArgumentException(): base(Arg_ArgumentException) + public ArgumentException() : base(Arg_ArgumentException) { } diff --git a/nanoFramework.CoreLibrary/System/ArgumentNullException.cs b/nanoFramework.CoreLibrary/System/ArgumentNullException.cs index cc69f8e1..951ea82b 100644 --- a/nanoFramework.CoreLibrary/System/ArgumentNullException.cs +++ b/nanoFramework.CoreLibrary/System/ArgumentNullException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #nullable enable using System.Diagnostics.CodeAnalysis; @@ -23,7 +20,7 @@ public class ArgumentNullException : ArgumentException /// /// Initializes a new instance of the class. /// - public ArgumentNullException(): base(ArgumentNull_Generic) + public ArgumentNullException() : base(ArgumentNull_Generic) { } diff --git a/nanoFramework.CoreLibrary/System/ArgumentOutOfRangeException.cs b/nanoFramework.CoreLibrary/System/ArgumentOutOfRangeException.cs index 14caf04c..950a7351 100644 --- a/nanoFramework.CoreLibrary/System/ArgumentOutOfRangeException.cs +++ b/nanoFramework.CoreLibrary/System/ArgumentOutOfRangeException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Array.cs b/nanoFramework.CoreLibrary/System/Array.cs index dd7c1dcc..49f36498 100644 --- a/nanoFramework.CoreLibrary/System/Array.cs +++ b/nanoFramework.CoreLibrary/System/Array.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Collections; using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/AssemblyInfo.cs b/nanoFramework.CoreLibrary/System/AssemblyInfo.cs index fe2c5fcb..c3f1af55 100644 --- a/nanoFramework.CoreLibrary/System/AssemblyInfo.cs +++ b/nanoFramework.CoreLibrary/System/AssemblyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System; using System.Reflection; diff --git a/nanoFramework.CoreLibrary/System/AsyncCallback.cs b/nanoFramework.CoreLibrary/System/AsyncCallback.cs index 8f96d73c..348eaf07 100644 --- a/nanoFramework.CoreLibrary/System/AsyncCallback.cs +++ b/nanoFramework.CoreLibrary/System/AsyncCallback.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Attribute.cs b/nanoFramework.CoreLibrary/System/Attribute.cs index 981d1d7e..5542f468 100644 --- a/nanoFramework.CoreLibrary/System/Attribute.cs +++ b/nanoFramework.CoreLibrary/System/Attribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/AttributeTargets.cs b/nanoFramework.CoreLibrary/System/AttributeTargets.cs index 9a9b6937..b3ac3344 100644 --- a/nanoFramework.CoreLibrary/System/AttributeTargets.cs +++ b/nanoFramework.CoreLibrary/System/AttributeTargets.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs index af7c6189..9e5bd8d9 100644 --- a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs +++ b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/BitConverter.cs b/nanoFramework.CoreLibrary/System/BitConverter.cs index 8adec02d..e0d3929a 100644 --- a/nanoFramework.CoreLibrary/System/BitConverter.cs +++ b/nanoFramework.CoreLibrary/System/BitConverter.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Boolean.cs b/nanoFramework.CoreLibrary/System/Boolean.cs index 10ef2002..bbcf10df 100644 --- a/nanoFramework.CoreLibrary/System/Boolean.cs +++ b/nanoFramework.CoreLibrary/System/Boolean.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Byte.cs b/nanoFramework.CoreLibrary/System/Byte.cs index b8e7bb7a..ca394783 100644 --- a/nanoFramework.CoreLibrary/System/Byte.cs +++ b/nanoFramework.CoreLibrary/System/Byte.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs index 1afa16e8..8a1837ce 100644 --- a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs +++ b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Char.cs b/nanoFramework.CoreLibrary/System/Char.cs index cb4c5733..a9943c1c 100644 --- a/nanoFramework.CoreLibrary/System/Char.cs +++ b/nanoFramework.CoreLibrary/System/Char.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs b/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs index 37ba86e6..d6f283ba 100644 --- a/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs +++ b/nanoFramework.CoreLibrary/System/Collections/ArrayList.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Collections/ICollection.cs b/nanoFramework.CoreLibrary/System/Collections/ICollection.cs index dae24c45..c764422d 100644 --- a/nanoFramework.CoreLibrary/System/Collections/ICollection.cs +++ b/nanoFramework.CoreLibrary/System/Collections/ICollection.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Collections { diff --git a/nanoFramework.CoreLibrary/System/Collections/IComparer.cs b/nanoFramework.CoreLibrary/System/Collections/IComparer.cs index 345838da..1f686231 100644 --- a/nanoFramework.CoreLibrary/System/Collections/IComparer.cs +++ b/nanoFramework.CoreLibrary/System/Collections/IComparer.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Collections { diff --git a/nanoFramework.CoreLibrary/System/Collections/IEnumerable.cs b/nanoFramework.CoreLibrary/System/Collections/IEnumerable.cs index 943d8c1d..d66ecf55 100644 --- a/nanoFramework.CoreLibrary/System/Collections/IEnumerable.cs +++ b/nanoFramework.CoreLibrary/System/Collections/IEnumerable.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Collections { diff --git a/nanoFramework.CoreLibrary/System/Collections/IEnumerator.cs b/nanoFramework.CoreLibrary/System/Collections/IEnumerator.cs index f3283ed5..d75b31e5 100644 --- a/nanoFramework.CoreLibrary/System/Collections/IEnumerator.cs +++ b/nanoFramework.CoreLibrary/System/Collections/IEnumerator.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Collections { diff --git a/nanoFramework.CoreLibrary/System/Collections/IEqualityComparer.cs b/nanoFramework.CoreLibrary/System/Collections/IEqualityComparer.cs index 0035e01c..d4ffc68f 100644 --- a/nanoFramework.CoreLibrary/System/Collections/IEqualityComparer.cs +++ b/nanoFramework.CoreLibrary/System/Collections/IEqualityComparer.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Collections { diff --git a/nanoFramework.CoreLibrary/System/Collections/IList.cs b/nanoFramework.CoreLibrary/System/Collections/IList.cs index d2960207..90e0f63b 100644 --- a/nanoFramework.CoreLibrary/System/Collections/IList.cs +++ b/nanoFramework.CoreLibrary/System/Collections/IList.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Collections { diff --git a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs index 1d6f7acc..e8852f64 100644 --- a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Console.cs b/nanoFramework.CoreLibrary/System/Console.cs index f4eb435a..34794cc1 100644 --- a/nanoFramework.CoreLibrary/System/Console.cs +++ b/nanoFramework.CoreLibrary/System/Console.cs @@ -1,7 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Convert.cs b/nanoFramework.CoreLibrary/System/Convert.cs index 91ddf010..6c96d256 100644 --- a/nanoFramework.CoreLibrary/System/Convert.cs +++ b/nanoFramework.CoreLibrary/System/Convert.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/DBNull.cs b/nanoFramework.CoreLibrary/System/DBNull.cs index 962443a6..9b496d71 100644 --- a/nanoFramework.CoreLibrary/System/DBNull.cs +++ b/nanoFramework.CoreLibrary/System/DBNull.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/DateTime.cs b/nanoFramework.CoreLibrary/System/DateTime.cs index 7d67ae78..dd479247 100644 --- a/nanoFramework.CoreLibrary/System/DateTime.cs +++ b/nanoFramework.CoreLibrary/System/DateTime.cs @@ -1,12 +1,11 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { - using Runtime.CompilerServices; - using Globalization; using System.Diagnostics; + using Globalization; + using Runtime.CompilerServices; // Summary: // Specifies whether a System.DateTime object represents a local time, a Coordinated diff --git a/nanoFramework.CoreLibrary/System/DayOfWeek.cs b/nanoFramework.CoreLibrary/System/DayOfWeek.cs index fd044ec8..fa395bcc 100644 --- a/nanoFramework.CoreLibrary/System/DayOfWeek.cs +++ b/nanoFramework.CoreLibrary/System/DayOfWeek.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Delegate.cs b/nanoFramework.CoreLibrary/System/Delegate.cs index 3f8b8de3..9824d68f 100644 --- a/nanoFramework.CoreLibrary/System/Delegate.cs +++ b/nanoFramework.CoreLibrary/System/Delegate.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { using Reflection; diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs index cdee8dbc..9bc9735a 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/Debug.cs b/nanoFramework.CoreLibrary/System/Diagnostics/Debug.cs index 5265424c..88636c52 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/Debug.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/Debug.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs b/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs index eec51721..37dbc481 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/Debugger.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs index 6bcc97fd..73fb989e 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Double.cs b/nanoFramework.CoreLibrary/System/Double.cs index 1c82478e..1ac08057 100644 --- a/nanoFramework.CoreLibrary/System/Double.cs +++ b/nanoFramework.CoreLibrary/System/Double.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Enum.cs b/nanoFramework.CoreLibrary/System/Enum.cs index bf0ab526..162849f1 100644 --- a/nanoFramework.CoreLibrary/System/Enum.cs +++ b/nanoFramework.CoreLibrary/System/Enum.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/EventArgs.cs b/nanoFramework.CoreLibrary/System/EventArgs.cs index 02654f5b..9bae6d2b 100644 --- a/nanoFramework.CoreLibrary/System/EventArgs.cs +++ b/nanoFramework.CoreLibrary/System/EventArgs.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/EventHandler.cs b/nanoFramework.CoreLibrary/System/EventHandler.cs index 08465adb..bfb099c6 100644 --- a/nanoFramework.CoreLibrary/System/EventHandler.cs +++ b/nanoFramework.CoreLibrary/System/EventHandler.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Exception.cs b/nanoFramework.CoreLibrary/System/Exception.cs index 1f06b080..5eabb555 100644 --- a/nanoFramework.CoreLibrary/System/Exception.cs +++ b/nanoFramework.CoreLibrary/System/Exception.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs index b64a1740..2c0fbd50 100644 --- a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs +++ b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/FormatException.cs b/nanoFramework.CoreLibrary/System/FormatException.cs index 97bc0c32..0485c0eb 100644 --- a/nanoFramework.CoreLibrary/System/FormatException.cs +++ b/nanoFramework.CoreLibrary/System/FormatException.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/GC.cs b/nanoFramework.CoreLibrary/System/GC.cs index 7d8a4699..13f07e8c 100644 --- a/nanoFramework.CoreLibrary/System/GC.cs +++ b/nanoFramework.CoreLibrary/System/GC.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Globalization/CultureInfo.cs b/nanoFramework.CoreLibrary/System/Globalization/CultureInfo.cs index 68154088..2c90a820 100644 --- a/nanoFramework.CoreLibrary/System/Globalization/CultureInfo.cs +++ b/nanoFramework.CoreLibrary/System/Globalization/CultureInfo.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #define ENABLE_CROSS_APPDOMAIN namespace System.Globalization { - using Runtime.CompilerServices; using System; + using Runtime.CompilerServices; /// /// Provides information about a specific culture (called a locale for unmanaged code development). diff --git a/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormat.cs b/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormat.cs index 97cbed87..8bce1a70 100644 --- a/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormat.cs +++ b/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormat.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Globalization { @@ -343,7 +340,7 @@ private static String FormatCustomized(DateTime dateTime, String format, DateTim fraction /= 10; effectiveDigits--; } - + tempResult = FormatDigits((int)fraction, precision); } else throw new ArgumentException("Format_InvalidString"); diff --git a/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormatInfo.cs b/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormatInfo.cs index 428ed367..b321d8a4 100644 --- a/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormatInfo.cs +++ b/nanoFramework.CoreLibrary/System/Globalization/DateTimeFormatInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. // ReSharper disable InconsistentNaming #define ENABLE_CROSS_APPDOMAIN diff --git a/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs b/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs index 195cf35b..01040c9a 100644 --- a/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs +++ b/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Globalization { diff --git a/nanoFramework.CoreLibrary/System/Guid.cs b/nanoFramework.CoreLibrary/System/Guid.cs index dc93a14c..07079219 100644 --- a/nanoFramework.CoreLibrary/System/Guid.cs +++ b/nanoFramework.CoreLibrary/System/Guid.cs @@ -1,3 +1,5 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/IAsyncResult.cs b/nanoFramework.CoreLibrary/System/IAsyncResult.cs index 9bcef95f..69a169a6 100644 --- a/nanoFramework.CoreLibrary/System/IAsyncResult.cs +++ b/nanoFramework.CoreLibrary/System/IAsyncResult.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/ICloneable.cs b/nanoFramework.CoreLibrary/System/ICloneable.cs index 47462b25..873eb024 100644 --- a/nanoFramework.CoreLibrary/System/ICloneable.cs +++ b/nanoFramework.CoreLibrary/System/ICloneable.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/IComparable.cs b/nanoFramework.CoreLibrary/System/IComparable.cs index 6f7b76b2..f73543dd 100644 --- a/nanoFramework.CoreLibrary/System/IComparable.cs +++ b/nanoFramework.CoreLibrary/System/IComparable.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/ICustomFormatter.cs b/nanoFramework.CoreLibrary/System/ICustomFormatter.cs index 68520944..363868e5 100644 --- a/nanoFramework.CoreLibrary/System/ICustomFormatter.cs +++ b/nanoFramework.CoreLibrary/System/ICustomFormatter.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/IDisposable.cs b/nanoFramework.CoreLibrary/System/IDisposable.cs index 9a3bf035..ee008093 100644 --- a/nanoFramework.CoreLibrary/System/IDisposable.cs +++ b/nanoFramework.CoreLibrary/System/IDisposable.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/IFormatProvider.cs b/nanoFramework.CoreLibrary/System/IFormatProvider.cs index 58c8446a..bec7984b 100644 --- a/nanoFramework.CoreLibrary/System/IFormatProvider.cs +++ b/nanoFramework.CoreLibrary/System/IFormatProvider.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/IFormattable.cs b/nanoFramework.CoreLibrary/System/IFormattable.cs index dd537d00..d30a55a6 100644 --- a/nanoFramework.CoreLibrary/System/IFormattable.cs +++ b/nanoFramework.CoreLibrary/System/IFormattable.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/IO/IOException.cs b/nanoFramework.CoreLibrary/System/IO/IOException.cs index 70ba65cd..3d3bc803 100644 --- a/nanoFramework.CoreLibrary/System/IO/IOException.cs +++ b/nanoFramework.CoreLibrary/System/IO/IOException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.IO { diff --git a/nanoFramework.CoreLibrary/System/IndexOutOfRangeException.cs b/nanoFramework.CoreLibrary/System/IndexOutOfRangeException.cs index d8b409f2..14ec52ac 100644 --- a/nanoFramework.CoreLibrary/System/IndexOutOfRangeException.cs +++ b/nanoFramework.CoreLibrary/System/IndexOutOfRangeException.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/Int16.cs b/nanoFramework.CoreLibrary/System/Int16.cs index 17710d34..ecc102c8 100644 --- a/nanoFramework.CoreLibrary/System/Int16.cs +++ b/nanoFramework.CoreLibrary/System/Int16.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Int32.cs b/nanoFramework.CoreLibrary/System/Int32.cs index d888258b..9f4112ca 100644 --- a/nanoFramework.CoreLibrary/System/Int32.cs +++ b/nanoFramework.CoreLibrary/System/Int32.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Int64.cs b/nanoFramework.CoreLibrary/System/Int64.cs index 82e16633..22a11ae0 100644 --- a/nanoFramework.CoreLibrary/System/Int64.cs +++ b/nanoFramework.CoreLibrary/System/Int64.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/IntPtr.cs b/nanoFramework.CoreLibrary/System/IntPtr.cs index d57c526e..149bbf2c 100644 --- a/nanoFramework.CoreLibrary/System/IntPtr.cs +++ b/nanoFramework.CoreLibrary/System/IntPtr.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/InvalidCastException.cs b/nanoFramework.CoreLibrary/System/InvalidCastException.cs index f8850e3f..1ccf7ba9 100644 --- a/nanoFramework.CoreLibrary/System/InvalidCastException.cs +++ b/nanoFramework.CoreLibrary/System/InvalidCastException.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/InvalidOperationException.cs b/nanoFramework.CoreLibrary/System/InvalidOperationException.cs index 1da0f6eb..c9c25ef0 100644 --- a/nanoFramework.CoreLibrary/System/InvalidOperationException.cs +++ b/nanoFramework.CoreLibrary/System/InvalidOperationException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/MarshalByRefObject.cs b/nanoFramework.CoreLibrary/System/MarshalByRefObject.cs index ec1e64f9..7933dc4b 100644 --- a/nanoFramework.CoreLibrary/System/MarshalByRefObject.cs +++ b/nanoFramework.CoreLibrary/System/MarshalByRefObject.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Math.cs b/nanoFramework.CoreLibrary/System/Math.cs index a5b4136b..551f6d44 100644 --- a/nanoFramework.CoreLibrary/System/Math.cs +++ b/nanoFramework.CoreLibrary/System/Math.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/MulticastDelegate.cs b/nanoFramework.CoreLibrary/System/MulticastDelegate.cs index 8e2c4b42..24bbf7b9 100644 --- a/nanoFramework.CoreLibrary/System/MulticastDelegate.cs +++ b/nanoFramework.CoreLibrary/System/MulticastDelegate.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs index d3833c93..ee673ab8 100644 --- a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs +++ b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/NotImplementedException.cs b/nanoFramework.CoreLibrary/System/NotImplementedException.cs index e76b202c..c5360de8 100644 --- a/nanoFramework.CoreLibrary/System/NotImplementedException.cs +++ b/nanoFramework.CoreLibrary/System/NotImplementedException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/NotSupportedException.cs b/nanoFramework.CoreLibrary/System/NotSupportedException.cs index d1588b3f..6421c796 100644 --- a/nanoFramework.CoreLibrary/System/NotSupportedException.cs +++ b/nanoFramework.CoreLibrary/System/NotSupportedException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/NullReferenceException.cs b/nanoFramework.CoreLibrary/System/NullReferenceException.cs index 8afd8eea..05ed8cef 100644 --- a/nanoFramework.CoreLibrary/System/NullReferenceException.cs +++ b/nanoFramework.CoreLibrary/System/NullReferenceException.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/Number.cs b/nanoFramework.CoreLibrary/System/Number.cs index cefe5e39..f70125e0 100644 --- a/nanoFramework.CoreLibrary/System/Number.cs +++ b/nanoFramework.CoreLibrary/System/Number.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Object.cs b/nanoFramework.CoreLibrary/System/Object.cs index d9bc3916..8c121ce4 100644 --- a/nanoFramework.CoreLibrary/System/Object.cs +++ b/nanoFramework.CoreLibrary/System/Object.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/ObjectDisposedException.cs b/nanoFramework.CoreLibrary/System/ObjectDisposedException.cs index 21ca6574..a9d8602c 100644 --- a/nanoFramework.CoreLibrary/System/ObjectDisposedException.cs +++ b/nanoFramework.CoreLibrary/System/ObjectDisposedException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs index bcc03f15..769c3bdd 100644 --- a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; @@ -11,7 +8,7 @@ namespace System /// /// Marks the program elements that are no longer in use. This class cannot be inherited. /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event |AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false)] [ExcludeFromStubs] [Serializable] public sealed class ObsoleteAttribute : Attribute diff --git a/nanoFramework.CoreLibrary/System/OutOfMemoryException.cs b/nanoFramework.CoreLibrary/System/OutOfMemoryException.cs index dfe902bd..8dc9d6fc 100644 --- a/nanoFramework.CoreLibrary/System/OutOfMemoryException.cs +++ b/nanoFramework.CoreLibrary/System/OutOfMemoryException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs index 8d9d667a..b79a3567 100644 --- a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/PlatformNotSupportedException.cs b/nanoFramework.CoreLibrary/System/PlatformNotSupportedException.cs index 8720d226..940fd327 100644 --- a/nanoFramework.CoreLibrary/System/PlatformNotSupportedException.cs +++ b/nanoFramework.CoreLibrary/System/PlatformNotSupportedException.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/Random.cs b/nanoFramework.CoreLibrary/System/Random.cs index 88f6303a..6d9987b8 100644 --- a/nanoFramework.CoreLibrary/System/Random.cs +++ b/nanoFramework.CoreLibrary/System/Random.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs b/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs index 480fc926..ff7eabcf 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/Assembly.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION namespace System.Reflection { using System; - using CultureInfo = Globalization.CultureInfo; using Runtime.CompilerServices; + using CultureInfo = Globalization.CultureInfo; /// /// Describes an assembly's unique identity in full. @@ -131,7 +128,7 @@ public virtual Type GetType(String name, bool throwOnError) var type = GetType(name); #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if ( (type == null) && (throwOnError) ) throw new ArgumentException(); + if ((type == null) && (throwOnError)) throw new ArgumentException(); #pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one return type; diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs index 93f21f8f..419231b0 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs index 406f5de6..0dfc4668 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs index a7a87d07..d1e374c4 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/Binder.cs b/nanoFramework.CoreLibrary/System/Reflection/Binder.cs index d2352dce..ae2e6a89 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/Binder.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/Binder.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs index d2780308..6b7f5c0b 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs index 44f482e8..42a15177 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/ConstructorInfo.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION namespace System.Reflection { - using Runtime.CompilerServices; using System; + using Runtime.CompilerServices; /// /// Discovers the attributes of a class constructor and provides access to constructor metadata. diff --git a/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs b/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs index 174bca35..8f25bb40 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/CustomAttributesHelpers.cs @@ -1,7 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Collections; using System.Diagnostics; diff --git a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs index ccb817ae..99623997 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs index cf9b33c1..63ab1ef8 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/FieldInfo.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION namespace System.Reflection { - using Runtime.CompilerServices; using System; + using Runtime.CompilerServices; /// /// Discovers the attributes of a field and provides access to field metadata. diff --git a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs index 51ff343c..5ad9301a 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/IReflect.cs b/nanoFramework.CoreLibrary/System/Reflection/IReflect.cs index 34d7f26b..c04545ce 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/IReflect.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/IReflect.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/MemberInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/MemberInfo.cs index 66726e85..50328910 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MemberInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MemberInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs index 385001db..744d1e13 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs b/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs index 82d8ac31..6762c600 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION namespace System.Reflection { - using Runtime.CompilerServices; using System; + using Runtime.CompilerServices; /// /// Provides information about methods and constructors. diff --git a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs index 8b8ca92c..0f28049d 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Reflection/MethodInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/MethodInfo.cs index c6ae90cd..edb44e77 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MethodInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MethodInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/ParameterInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/ParameterInfo.cs index 984d59a7..c029d8fa 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/ParameterInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/ParameterInfo.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION namespace System.Reflection { - using Runtime.CompilerServices; using System; /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs index 38e030a8..607841aa 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/PropertyInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/RuntimeConstructorInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/RuntimeConstructorInfo.cs index b16d646f..79bf4b36 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/RuntimeConstructorInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/RuntimeConstructorInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/RuntimeFieldInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/RuntimeFieldInfo.cs index b3a0b5d7..f756e44e 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/RuntimeFieldInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/RuntimeFieldInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Reflection/RuntimeMethodInfo.cs b/nanoFramework.CoreLibrary/System/Reflection/RuntimeMethodInfo.cs index 5dee51eb..79616bb7 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/RuntimeMethodInfo.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/RuntimeMethodInfo.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs index eb7aa3e1..507b6d49 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs index cf9fcb2b..cd6fa582 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs @@ -1,4 +1,5 @@ -using System; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { @@ -6,7 +7,7 @@ namespace System.Runtime.CompilerServices /// When a class, enum, or struct is marked with it will be excluded from the native stubs generated by .NET nanoFramework metadata processor. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] - public class ExcludeFromStubsAttribute: Attribute + public class ExcludeFromStubsAttribute : Attribute { } } diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs index bd75afd3..64aaa96e 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs index c01beb1f..0bf8314b 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs index 1990a8ed..41f3394c 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IsExternalInit.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IsExternalInit.cs index f44255df..14170b65 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IsExternalInit.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IsExternalInit.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs index eb122e5a..251d7460 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeFeature.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeFeature.cs index b4677f1b..a5f408a5 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeFeature.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeFeature.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs index a8005c43..e306876e 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.CompilerServices { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs index 7beb9512..507f6e35 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs index 01b3d8d9..890b759f 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs index fbeb0a2d..5c59d515 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs b/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs index 6395bfb3..a884b7e3 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/Remoting/RemotingServices.cs @@ -1,3 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + using System.Runtime.CompilerServices; namespace System.Runtime.Remoting diff --git a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs index c6d92f9f..87eb7f9d 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/RuntimeArgumentHandle.cs b/nanoFramework.CoreLibrary/System/RuntimeArgumentHandle.cs index 152a2bc2..9e567021 100644 --- a/nanoFramework.CoreLibrary/System/RuntimeArgumentHandle.cs +++ b/nanoFramework.CoreLibrary/System/RuntimeArgumentHandle.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/RuntimeFieldHandle.cs b/nanoFramework.CoreLibrary/System/RuntimeFieldHandle.cs index c2a06a8a..9d18a583 100644 --- a/nanoFramework.CoreLibrary/System/RuntimeFieldHandle.cs +++ b/nanoFramework.CoreLibrary/System/RuntimeFieldHandle.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/RuntimeMethodHandle.cs b/nanoFramework.CoreLibrary/System/RuntimeMethodHandle.cs index 7fbba385..05bc05cb 100644 --- a/nanoFramework.CoreLibrary/System/RuntimeMethodHandle.cs +++ b/nanoFramework.CoreLibrary/System/RuntimeMethodHandle.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/RuntimeType.cs b/nanoFramework.CoreLibrary/System/RuntimeType.cs index 66397510..544d1fe9 100644 --- a/nanoFramework.CoreLibrary/System/RuntimeType.cs +++ b/nanoFramework.CoreLibrary/System/RuntimeType.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION diff --git a/nanoFramework.CoreLibrary/System/RuntimeTypeHandle.cs b/nanoFramework.CoreLibrary/System/RuntimeTypeHandle.cs index eff20bea..89fcffd2 100644 --- a/nanoFramework.CoreLibrary/System/RuntimeTypeHandle.cs +++ b/nanoFramework.CoreLibrary/System/RuntimeTypeHandle.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/SByte.cs b/nanoFramework.CoreLibrary/System/SByte.cs index 082e53e5..85b6d905 100644 --- a/nanoFramework.CoreLibrary/System/SByte.cs +++ b/nanoFramework.CoreLibrary/System/SByte.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs index 8fde1875..f5fae2b8 100644 --- a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Single.cs b/nanoFramework.CoreLibrary/System/Single.cs index 62c5a921..6b141c88 100644 --- a/nanoFramework.CoreLibrary/System/Single.cs +++ b/nanoFramework.CoreLibrary/System/Single.cs @@ -1,13 +1,9 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { using Globalization; - using System.Runtime.CompilerServices; /// /// Represents a single-precision floating-point number. @@ -155,7 +151,7 @@ public string ToString(string format) { return double._negativeInfinitySymbol; } - else if(IsNaN(this)) + else if (IsNaN(this)) { return double._naNSymbol; } diff --git a/nanoFramework.CoreLibrary/System/SpanByte.cs b/nanoFramework.CoreLibrary/System/SpanByte.cs index 419440c2..57d4128b 100644 --- a/nanoFramework.CoreLibrary/System/SpanByte.cs +++ b/nanoFramework.CoreLibrary/System/SpanByte.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/String.cs b/nanoFramework.CoreLibrary/System/String.cs index 52261739..d29b84cf 100644 --- a/nanoFramework.CoreLibrary/System/String.cs +++ b/nanoFramework.CoreLibrary/System/String.cs @@ -1,15 +1,23 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics.CodeAnalysis; namespace System { - using Runtime.CompilerServices; + + /* Unmerged change from project 'CoreLibrary' + Before: + using Runtime.CompilerServices; + using System.Collections; + /// + After: + using System.Collections; + using Runtime.CompilerServices; + /// + */ using System.Collections; + using Runtime.CompilerServices; /// /// Represents text as a sequence of UTF-16 code units. /// @@ -36,14 +44,14 @@ public IEnumerator GetEnumerator() // Throw a NotSupportedException in compliance of .net practices // (no message to preserve assembly size/memory consumption) // See https://docs.microsoft.com/en-us/dotnet/api/system.notsupportedexception - throw new NotSupportedException(); + throw new NotSupportedException(); } /// /// Represents the empty string. This field is read-only. /// public static readonly String Empty = ""; - + /// /// Determines whether this instance and a specified object, which must also be a String object, have the same value. /// @@ -711,10 +719,10 @@ public static string Format(string format, params object[] args) if (fmt.Length > 0) { #if NANOCLR_REFLECTION - + if (args[index] is null) { - token = ""; + token = ""; } else { diff --git a/nanoFramework.CoreLibrary/System/SystemException.cs b/nanoFramework.CoreLibrary/System/SystemException.cs index 27eff0fa..d18f2f9a 100644 --- a/nanoFramework.CoreLibrary/System/SystemException.cs +++ b/nanoFramework.CoreLibrary/System/SystemException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs b/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs index 0c1ec15e..72730173 100644 --- a/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs +++ b/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.Versioning { diff --git a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs index 85eb49bb..c2c9028d 100644 --- a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs +++ b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs b/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs index 3c921b38..c31651f7 100644 --- a/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs +++ b/nanoFramework.CoreLibrary/System/Threading/AutoResetEvent.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs b/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs index 0e66ebfd..62ffb0f3 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Interlocked.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs b/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs index 9088fd7d..67556f47 100644 --- a/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs +++ b/nanoFramework.CoreLibrary/System/Threading/ManualResetEvent.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/Monitor.cs b/nanoFramework.CoreLibrary/System/Threading/Monitor.cs index cf584462..a37918ec 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Monitor.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Monitor.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs b/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs index 86bcb463..8d62bd88 100644 --- a/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs +++ b/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/Thread.cs b/nanoFramework.CoreLibrary/System/Threading/Thread.cs index adeb76fa..0daaf3e7 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Thread.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Thread.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/ThreadAbortException.cs b/nanoFramework.CoreLibrary/System/Threading/ThreadAbortException.cs index fd4d5662..a51fe7d6 100644 --- a/nanoFramework.CoreLibrary/System/Threading/ThreadAbortException.cs +++ b/nanoFramework.CoreLibrary/System/Threading/ThreadAbortException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs b/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs index bd2af725..451e77bf 100644 --- a/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs +++ b/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/ThreadStart.cs b/nanoFramework.CoreLibrary/System/Threading/ThreadStart.cs index 93274ff2..17efc193 100644 --- a/nanoFramework.CoreLibrary/System/Threading/ThreadStart.cs +++ b/nanoFramework.CoreLibrary/System/Threading/ThreadStart.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/ThreadState.cs b/nanoFramework.CoreLibrary/System/Threading/ThreadState.cs index 2d1c9f0d..d0b59322 100644 --- a/nanoFramework.CoreLibrary/System/Threading/ThreadState.cs +++ b/nanoFramework.CoreLibrary/System/Threading/ThreadState.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/Timeout.cs b/nanoFramework.CoreLibrary/System/Threading/Timeout.cs index 830dcb94..af9572e0 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Timeout.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Timeout.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/Timer.cs b/nanoFramework.CoreLibrary/System/Threading/Timer.cs index 0050610a..fd963dbd 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Timer.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Timer.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { diff --git a/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs b/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs index e84d6577..de1587a0 100644 --- a/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs +++ b/nanoFramework.CoreLibrary/System/Threading/WaitHandle.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System.Threading { - using Runtime.CompilerServices; using System; + using Runtime.CompilerServices; /// /// Encapsulates operating system specific objects that wait for exclusive access to shared resources. diff --git a/nanoFramework.CoreLibrary/System/TimeSpan.cs b/nanoFramework.CoreLibrary/System/TimeSpan.cs index 49718f8f..10ad4475 100644 --- a/nanoFramework.CoreLibrary/System/TimeSpan.cs +++ b/nanoFramework.CoreLibrary/System/TimeSpan.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { using Runtime.CompilerServices; @@ -258,13 +256,13 @@ public double TotalMilliseconds /// A number of ticks that represent a time. /// An object that represents value. public static TimeSpan FromTicks(long value) => new TimeSpan(value); - + /// /// Returns a that represents a specified time, where the specification is in units of milliseconds. /// /// A number of milliseconds that represent a time. /// An object that represents value. - public static TimeSpan FromMilliseconds(long value) => new TimeSpan(TimeSpan.TicksPerMillisecond * value); + public static TimeSpan FromMilliseconds(long value) => new TimeSpan(TimeSpan.TicksPerMillisecond * value); /// /// Returns a that represents a specified time, where the specification is in units of seconds. @@ -293,7 +291,7 @@ public double TotalMilliseconds /// A number of days that represent a time. /// An object that represents value. public static TimeSpan FromDays(long value) => new TimeSpan(TimeSpan.TicksPerDay * value); - + /// /// Converts the value of the current object to its equivalent string representation. /// diff --git a/nanoFramework.CoreLibrary/System/TimeoutException.cs b/nanoFramework.CoreLibrary/System/TimeoutException.cs index 338cecc9..4764abe8 100644 --- a/nanoFramework.CoreLibrary/System/TimeoutException.cs +++ b/nanoFramework.CoreLibrary/System/TimeoutException.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Type.cs b/nanoFramework.CoreLibrary/System/Type.cs index a162798f..f47444c7 100644 --- a/nanoFramework.CoreLibrary/System/Type.cs +++ b/nanoFramework.CoreLibrary/System/Type.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION namespace System { - + using Reflection; using Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/TypeCode.cs b/nanoFramework.CoreLibrary/System/TypeCode.cs index f288443f..db388686 100644 --- a/nanoFramework.CoreLibrary/System/TypeCode.cs +++ b/nanoFramework.CoreLibrary/System/TypeCode.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + namespace System { /// diff --git a/nanoFramework.CoreLibrary/System/TypedReference.cs b/nanoFramework.CoreLibrary/System/TypedReference.cs index 28e8f30c..888a564e 100644 --- a/nanoFramework.CoreLibrary/System/TypedReference.cs +++ b/nanoFramework.CoreLibrary/System/TypedReference.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/UInt16.cs b/nanoFramework.CoreLibrary/System/UInt16.cs index 2d523beb..71c0e439 100644 --- a/nanoFramework.CoreLibrary/System/UInt16.cs +++ b/nanoFramework.CoreLibrary/System/UInt16.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/UInt32.cs b/nanoFramework.CoreLibrary/System/UInt32.cs index 3564feb3..419ae0b8 100644 --- a/nanoFramework.CoreLibrary/System/UInt32.cs +++ b/nanoFramework.CoreLibrary/System/UInt32.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/UInt64.cs b/nanoFramework.CoreLibrary/System/UInt64.cs index 75099a40..5103f202 100644 --- a/nanoFramework.CoreLibrary/System/UInt64.cs +++ b/nanoFramework.CoreLibrary/System/UInt64.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/UIntPtr.cs b/nanoFramework.CoreLibrary/System/UIntPtr.cs index 1d20096a..64f7d7ec 100644 --- a/nanoFramework.CoreLibrary/System/UIntPtr.cs +++ b/nanoFramework.CoreLibrary/System/UIntPtr.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; using System.Runtime.CompilerServices; diff --git a/nanoFramework.CoreLibrary/System/ValueType.cs b/nanoFramework.CoreLibrary/System/ValueType.cs index 429499f4..2de9e1a8 100644 --- a/nanoFramework.CoreLibrary/System/ValueType.cs +++ b/nanoFramework.CoreLibrary/System/ValueType.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Version.cs b/nanoFramework.CoreLibrary/System/Version.cs index 1ff8c1e5..465dddd3 100644 --- a/nanoFramework.CoreLibrary/System/Version.cs +++ b/nanoFramework.CoreLibrary/System/Version.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/Void.cs b/nanoFramework.CoreLibrary/System/Void.cs index ca36ba93..22b36025 100644 --- a/nanoFramework.CoreLibrary/System/Void.cs +++ b/nanoFramework.CoreLibrary/System/Void.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/nanoFramework.CoreLibrary/System/WeakReference.cs b/nanoFramework.CoreLibrary/System/WeakReference.cs index 66a6498e..8106e408 100644 --- a/nanoFramework.CoreLibrary/System/WeakReference.cs +++ b/nanoFramework.CoreLibrary/System/WeakReference.cs @@ -1,8 +1,5 @@ -// -// Copyright (c) .NET Foundation and Contributors -// Portions Copyright (c) Microsoft Corporation. All rights reserved. -// See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. namespace System { diff --git a/spelling_exclusion.dic b/spelling_exclusion.dic new file mode 100644 index 00000000..8c0e1f8c --- /dev/null +++ b/spelling_exclusion.dic @@ -0,0 +1 @@ +nano From 60fbb7c342c9a89f61a87116785bc9e34967e687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 3 Feb 2025 11:28:42 +0000 Subject: [PATCH 40/70] Rename attribute to exclude types (#226) ***NO_CI*** (cherry picked from commit 380fe6a6167637fe46cb311113ee77c77c119d70) --- .../UnitTestExpressionTests.cs | 4 +- .../UnitTestOtherArithmeticTests.cs | 9 +- Tests/NFUnitTestArray/UnitTestOtherTests.cs | 10 +-- Tests/NFUnitTestArray/UnitTestSimpleTests.cs | 10 +-- .../UnitTestAttributesTest1.cs | 2 +- .../UnitTestBasicConceptsTests.cs | 2 +- .../UnitTestDeclarationTests.cs | 4 +- Tests/NFUnitTestClasses/UnitTestFieldTests.cs | 3 +- .../NFUnitTestClasses/UnitTestMethodsTests.cs | 11 +-- .../UnitTestPropertiesTests.cs | 9 +- .../NFUnitTestClasses/UnitTestStaticTests.cs | 2 +- .../UnitTestBoxingTests.cs | 7 +- .../UnitTestDelegatesTests.cs | 40 ++++----- Tests/NFUnitTestEnum/UnitTestEnumTests.cs | 2 +- .../UnitTestInterfaceTests.cs | 20 ++--- .../UnitTestNamespaceTests.cs | 2 +- .../UnitTestStatementTests.cs | 50 +++++------ Tests/NFUnitTestStruct/UnitTestStructs.cs | 4 +- Tests/NFUnitTestSystemLib/UnitTestDateTime.cs | 2 +- .../CoreLibrary.NoReflection.nfproj | 2 +- nanoFramework.CoreLibrary/CoreLibrary.nfproj | 82 +++++++++---------- nanoFramework.CoreLibrary/Friends.cs | 22 ++--- nanoFramework.CoreLibrary/System/Array.cs | 2 +- nanoFramework.CoreLibrary/System/Attribute.cs | 2 +- .../System/AttributeTargets.cs | 2 +- .../System/AttributeUsageAttribute.cs | 2 +- .../System/CLSCompliantAttribute.cs | 2 +- .../EditorBrowsableAttribute.cs | 2 +- nanoFramework.CoreLibrary/System/DBNull.cs | 2 +- nanoFramework.CoreLibrary/System/DateTime.cs | 6 +- .../CodeAnalysis/NullableAttributes.cs | 23 +++--- .../Diagnostics/ConditionalAttribute.cs | 2 +- .../System/Diagnostics/DebuggerAttributes.cs | 16 ++-- .../System/FlagsAttribute.cs | 2 +- .../System/Globalization/NumberFormatInfo.cs | 2 +- .../System/NonSerializedAttribute.cs | 2 +- .../System/ObsoleteAttribute.cs | 2 +- .../System/ParamArrayAttribute.cs | 2 +- .../System/Reflection/AssemblyAttributes.cs | 16 ++-- .../System/Reflection/AssemblyNameFlags.cs | 2 +- .../AssemblyReflectionAttributes.cs | 18 ++-- .../System/Reflection/BindingFlags.cs | 2 +- .../Reflection/DefaultMemberAttribute.cs | 2 +- .../Reflection/FieldReflectionAttributes.cs | 2 +- .../System/Reflection/MethodImplAttributes.cs | 2 +- .../CallerArgumentExpressionAttribute.cs | 2 +- .../CallerMemberNameAttribute.cs | 2 +- .../ExcludeFromStubsAttribute.cs | 13 --- .../CompilerServices/ExcludeTypeAttribute.cs | 21 +++++ .../CompilerServices/IndexerNameAttribute.cs | 2 +- .../InternalsVisibleToAttribute.cs | 2 +- .../CompilerServices/MethodImplAttribute.cs | 4 +- .../Runtime/InteropServices/Attributes.cs | 8 +- .../System/Runtime/InteropServices/CharSet.cs | 2 +- .../Runtime/InteropServices/LayoutKind.cs | 2 +- .../Runtime/Remoting/__TransparentProxy.cs | 2 +- .../System/SerializableAttribute.cs | 2 +- nanoFramework.CoreLibrary/System/SpanByte.cs | 10 +-- .../System/TargetFrameworkAttribute.cs | 4 +- .../System/ThreadAttributes.cs | 4 +- .../System/Threading/SpinWait.cs | 2 +- .../System/Threading/Thread.cs | 4 +- .../System/Threading/Timeout.cs | 2 +- nanoFramework.CoreLibrary/System/TimeSpan.cs | 2 +- .../System/TypedReference.cs | 2 +- nanoFramework.CoreLibrary/System/UIntPtr.cs | 2 +- 66 files changed, 262 insertions(+), 246 deletions(-) delete mode 100644 nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs create mode 100644 nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeTypeAttribute.cs diff --git a/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs b/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs index 7f6f1f5e..d1b2569b 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestExpressionTests.cs @@ -2488,7 +2488,7 @@ public static int Main_old() { int MyInt = TC.IntI; } - catch (System.Exception) + catch (Exception) { RetInt = 0; } @@ -2520,7 +2520,7 @@ public static int Main_old() { int TempInt = getTC.IntI; } - catch (System.Exception) + catch (Exception) { RetInt = 0; } diff --git a/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs b/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs index c3bf688c..b9f9b13b 100644 --- a/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs +++ b/Tests/NFUnitTestArithmetic/UnitTestOtherArithmeticTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using nanoFramework.TestFramework; namespace NFUnitTestArithmetic @@ -7086,7 +7087,7 @@ public static int Main_old() { string s = "hello"; object o = s; - if ((o as System.Array) == null) + if ((o as Array) == null) { return 0; } @@ -7106,7 +7107,7 @@ public static int Main_old() { string[] s = new string[] { "hello" }; object o = s; - if ((o as System.Array) != null) + if ((o as Array) != null) { return 0; } @@ -7126,7 +7127,7 @@ public static int Main_old() { string[] s = new string[] { "hello" }; object o = s; - if ((o as System.Array) as System.Array != null) + if ((o as Array) as Array != null) { return 0; } @@ -7146,7 +7147,7 @@ public static int Main_old() { string[] s = new string[] { "hello" }; object o = s; - if ((o as System.Array) as object != null) + if ((o as Array) as object != null) { return 0; } diff --git a/Tests/NFUnitTestArray/UnitTestOtherTests.cs b/Tests/NFUnitTestArray/UnitTestOtherTests.cs index a10c6346..e876afa1 100644 --- a/Tests/NFUnitTestArray/UnitTestOtherTests.cs +++ b/Tests/NFUnitTestArray/UnitTestOtherTests.cs @@ -167,7 +167,7 @@ public static int Main_old() MyClass[] a = new MyClass[] { new MyClass(5), new MyClass(6), new MyClass(7) }; - System.Array SystemArray; + Array SystemArray; int[] StaticArray = new int[] { 10, 20, 30, 40 }; // There exists an implicit reference conversion for this SystemArray = StaticArray; @@ -187,7 +187,7 @@ class Other_TestClass_systemarrays_conversion_02 { public static int Main_old() { - System.Array SystemArray; + Array SystemArray; int[] StaticArray = new int[] { 10, 20, 30, 40 }; int[] StaticArray2 = new int[] { 1, 2, 3, 4 }; SystemArray = StaticArray; @@ -211,7 +211,7 @@ class Other_TestClass_systemarrays_nullvalue_01 { public static int Main_old() { - System.Array SystemArray; + Array SystemArray; SystemArray = null; return 0; } @@ -237,7 +237,7 @@ public static int Main_old() { Fill(strings, 90, 10, 0); } - catch (System.Exception) + catch (Exception) { return 0; } @@ -265,7 +265,7 @@ public static int Main_old() { objectArr[1] = new Queue(); } - catch (System.Exception) + catch (Exception) { return 0; } diff --git a/Tests/NFUnitTestArray/UnitTestSimpleTests.cs b/Tests/NFUnitTestArray/UnitTestSimpleTests.cs index ff7bd6ea..adce7205 100644 --- a/Tests/NFUnitTestArray/UnitTestSimpleTests.cs +++ b/Tests/NFUnitTestArray/UnitTestSimpleTests.cs @@ -1186,7 +1186,7 @@ public static int Main_old() {//bug 16823 //int[] arr = new int[2147483647]; } - catch (System.Exception) + catch (Exception) { // Out Of Memory System.Exception } @@ -1205,7 +1205,7 @@ public static int Main_old() {//bug 16823 //int[] arr = new int[2147483648]; } - catch (System.Exception) + catch (Exception) { return 0; } @@ -2764,7 +2764,7 @@ public static int Main_old() { arr[-1] = 5; } - catch (System.Exception) + catch (Exception) { return 0; } @@ -2784,7 +2784,7 @@ public static int Main_old() { arr[10] = 5; } - catch (System.Exception) + catch (Exception) { return 0; } @@ -3269,7 +3269,7 @@ public static int Main_old() if (arr[2] == 3) return 1; } - catch (System.Exception) + catch (Exception) { return 0; } diff --git a/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs b/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs index 5f68bcf4..0e246be3 100644 --- a/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs +++ b/Tests/NFUnitTestAttributes/UnitTestAttributesTest1.cs @@ -372,7 +372,7 @@ public static bool testMethod() } } - [GuidAttribute("00020810-0000-0000-C000-000000000046")] + [Guid("00020810-0000-0000-C000-000000000046")] struct Attrib_TestClass_attrib021_4_C1 { } public class Attrib_TestClass_attrib021_4 { diff --git a/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs b/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs index 3333bce5..65b6e2e0 100644 --- a/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs +++ b/Tests/NFUnitTestBasicConcepts/UnitTestBasicConceptsTests.cs @@ -4585,7 +4585,7 @@ public class Basic_TestClass_memac025 : Basic_TestClass_memac025_O { public static int Main_old() { - Basic_TestClass_memac025_O.Basic_TestClass_memac025_C1 tc = new Basic_TestClass_memac025_O.Basic_TestClass_memac025_C1(); + Basic_TestClass_memac025_C1 tc = new Basic_TestClass_memac025_C1(); if (tc.intI == 2) { return 0; diff --git a/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs b/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs index 14968faf..d742a528 100644 --- a/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestDeclarationTests.cs @@ -412,10 +412,10 @@ class BaseClassTestClass25 : BaseClassTestClass25_Base1.BaseClassTestClass25_Sub public static bool testMethod() { BaseClassTestClass25 m = new BaseClassTestClass25(); - if ((BaseClassTestClass25_Base1.BaseClassTestClass25_Sub2)m == null) + if ((BaseClassTestClass25_Sub2)m == null) return false; - if ((BaseClassTestClass25_Base1.BaseClassTestClass25_Interface1)m == null) + if ((BaseClassTestClass25_Interface1)m == null) return false; return true; } diff --git a/Tests/NFUnitTestClasses/UnitTestFieldTests.cs b/Tests/NFUnitTestClasses/UnitTestFieldTests.cs index 28dd2a3b..65f49b27 100644 --- a/Tests/NFUnitTestClasses/UnitTestFieldTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestFieldTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using nanoFramework.TestFramework; namespace NFUnitTestClasses @@ -682,7 +683,7 @@ public static bool testMethod() { int intJ = test.tc.intI; //MyTest hasn't been instantiated } - catch (System.Exception e) + catch (Exception e) { RetVal = true; } diff --git a/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs b/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs index f0c9fc80..b25ad068 100644 --- a/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestMethodsTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using nanoFramework.TestFramework; namespace NFUnitTestClasses @@ -3156,7 +3157,7 @@ public class MethodsTestClass159 { public long RetVal() { - throw new System.Exception(); + throw new Exception(); } public static bool testMethod() { @@ -3187,7 +3188,7 @@ public long RetVal(bool b) } else { - throw new System.Exception(); + throw new Exception(); } } public static bool testMethod() @@ -3202,7 +3203,7 @@ public static bool testMethod() { test.RetVal(false); } - catch (System.Exception e) + catch (Exception e) { val = true; } @@ -3219,7 +3220,7 @@ public long RetVal(bool b) if (b == true) { - throw new System.Exception(); + throw new Exception(); } else { @@ -3238,7 +3239,7 @@ public static bool testMethod() { test.RetVal(true); } - catch (System.Exception e) + catch (Exception e) { val = true; } diff --git a/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs b/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs index 93a885ec..14526221 100644 --- a/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestPropertiesTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using nanoFramework.TestFramework; namespace NFUnitTestClasses @@ -1160,7 +1161,7 @@ public int MyProp { get { - throw new System.Exception(); + throw new Exception(); } } public static bool testMethod() @@ -1170,7 +1171,7 @@ public static bool testMethod() { int intJ = test.MyProp; } - catch (System.Exception e) + catch (Exception e) { return true; } @@ -1190,7 +1191,7 @@ public int MyProp } else { - throw new System.Exception(); + throw new Exception(); } } } @@ -1210,7 +1211,7 @@ public static bool testMethod() { int intJ = MC2.MyProp; } - catch (System.Exception e) + catch (Exception e) { return true; } diff --git a/Tests/NFUnitTestClasses/UnitTestStaticTests.cs b/Tests/NFUnitTestClasses/UnitTestStaticTests.cs index 0e4b0392..4565cdcc 100644 --- a/Tests/NFUnitTestClasses/UnitTestStaticTests.cs +++ b/Tests/NFUnitTestClasses/UnitTestStaticTests.cs @@ -133,7 +133,7 @@ public static bool testMethod() if (Static_InstTestClass01.intJ() != 2) return false; if (Static_InstTestClass01.intK != 3) return false; if (Static_InstTestClass01.intL != 4) return false; - if (new Static_InstTestClass01.MyInner().intM != 5) return false; + if (new MyInner().intM != 5) return false; return true; } } diff --git a/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs b/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs index bcc60b16..ed2ab702 100644 --- a/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs +++ b/Tests/NFUnitTestConversions/UnitTestBoxingTests.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using nanoFramework.TestFramework; namespace NFUnitTestConversions @@ -290,7 +291,7 @@ class BoxingTestClassStruct_to_ValType public static bool testMethod() { BoxingTestClassStruct_to_ValTypeTest_struct src = new BoxingTestClassStruct_to_ValTypeTest_struct(); - System.ValueType dst = src; + ValueType dst = src; return true; } } @@ -300,7 +301,7 @@ class BoxingTestClassValType_to_struct { public static bool testMethod() { - System.ValueType src = new BoxingTestClassValType_to_struct_struct(); + ValueType src = new BoxingTestClassValType_to_struct_struct(); BoxingTestClassValType_to_struct_struct dst = (BoxingTestClassValType_to_struct_struct)src; return true; } diff --git a/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs b/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs index 11714ac6..58a1fad1 100644 --- a/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs +++ b/Tests/NFUnitTestDelegates/UnitTestDelegatesTests.cs @@ -481,7 +481,7 @@ static public int Main_old() { foo(); } - catch (System.Exception) + catch (Exception) { Delegate_TestClass_delegate03_2.retval -= 0x03; } @@ -579,7 +579,7 @@ static public int Main_old() foo = loo() ? null : new Delegate_TestClass_delegate06_1(Delegate_TestClass_delegate06_2.far); retval -= foo(); } - catch (System.Exception n) + catch (Exception n) { retval -= 0x01; } @@ -588,7 +588,7 @@ static public int Main_old() foo = !loo() ? new Delegate_TestClass_delegate06_1(p.bar) : null; retval -= foo(); } - catch (System.Exception n) + catch (Exception n) { retval -= 0x02; } @@ -626,7 +626,7 @@ static public int Main_old() foo = !loo() ? new Delegate_TestClass_delegate07_1(p.bar) : null; retval -= foo(); } - catch (System.Exception n) + catch (Exception n) { retval -= 0x02; } @@ -864,7 +864,7 @@ static public int Main_old() { foo(); } - catch (System.Exception) + catch (Exception) { Delegate_TestClass_delegate14_2.retval -= 0x03; } @@ -1072,7 +1072,7 @@ static public int Main_old() foo = loo() ? null : new Delegate_TestClass_delegate17_1(Delegate_TestClass_delegate17_2.far); foo(); } - catch (System.Exception n) + catch (Exception n) { Delegate_TestClass_delegate17_2.retval -= 0x01; } @@ -1081,7 +1081,7 @@ static public int Main_old() foo = !loo() ? new Delegate_TestClass_delegate17_1(p.bar) : null; foo(); } - catch (System.Exception n) + catch (Exception n) { Delegate_TestClass_delegate17_2.retval -= 0x02; } @@ -1091,7 +1091,7 @@ static public int Main_old() foo += (Delegate_TestClass_delegate17_1)null; foo(); } - catch (System.Exception n) + catch (Exception n) { Delegate_TestClass_delegate17_2.retval -= 10; } @@ -1412,7 +1412,7 @@ public static int Main_old(String[] args) return i; } - catch (System.Exception) + catch (Exception) { return 1; } @@ -1616,14 +1616,14 @@ public static int Main_old(String[] args) Delegate_TestClass_delegate60 c = new Delegate_TestClass_delegate60(); Delegate_TestClass_delegate60_Del nsd = new Delegate_TestClass_delegate60_Del(c.DelegatedMethod); - if (nsd is System.Delegate) + if (nsd is Delegate) retval -= 0x01; - if (nsd is System.MulticastDelegate) + if (nsd is MulticastDelegate) retval -= 0x02; ClassDelegate cd = new ClassDelegate(c.DelegatedMethod); - if (cd is System.Delegate) + if (cd is Delegate) retval -= 0x04; - if (cd is System.MulticastDelegate) + if (cd is MulticastDelegate) retval -= 0x08; return retval; @@ -1797,7 +1797,7 @@ public class Delegate_TestClass_delegate71 public double DelegatedMethod1(int intPart, float frac) { if (5 == intPart) - throw new System.Exception("My System.Exception"); + throw new Exception("My System.Exception"); return intPart + frac + 5; } public double DelegatedMethod2(int intPart, float frac) @@ -1816,7 +1816,7 @@ public static int Main_old(String[] args) double d = md1(5, .5f); retval ^= 0x02; } - catch (System.Exception) + catch (Exception) { retval -= 0x01; } @@ -2166,7 +2166,7 @@ public static int Main_old(String[] args) Delegate_TestClass_delegate77_Del md4 = new Delegate_TestClass_delegate77_Del(md1) + md3; md4(5, .25f); } - catch (System.Exception) + catch (Exception) { retval -= 0x01; } @@ -2239,7 +2239,7 @@ public static int Main_old(String[] args) if (9 == i) retval ^= 0x10; } - catch (System.Exception) + catch (Exception) { retval -= 0x01; } @@ -2316,7 +2316,7 @@ public static int Main_old(String[] args) if (8 == i) retval ^= 0x10; } - catch (System.Exception) + catch (Exception) { retval -= 0x01; } @@ -2353,7 +2353,7 @@ public bool DelegatedMethod2(out int intPart, float frac) if ((32 == synchro++) && (.25 == frac)) { retval ^= 0x02; - throw new System.Exception(); + throw new Exception(); return true; } return false; @@ -2394,7 +2394,7 @@ public static int Main_old(String[] args) if (8 == i) retval ^= 0x10; } - catch (System.Exception) + catch (Exception) { retval ^= 0x20; } diff --git a/Tests/NFUnitTestEnum/UnitTestEnumTests.cs b/Tests/NFUnitTestEnum/UnitTestEnumTests.cs index 4eaef607..9779c97c 100644 --- a/Tests/NFUnitTestEnum/UnitTestEnumTests.cs +++ b/Tests/NFUnitTestEnum/UnitTestEnumTests.cs @@ -2258,7 +2258,7 @@ public static int Main_old(String[] s) f = (Enum_TestClass_enum78_Enum)v[0]; } - catch (System.Exception e) + catch (Exception e) { // Caught System.Exception: Failed OutputHelper.WriteLine(e.ToString()); diff --git a/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs b/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs index e1790974..ca891be9 100644 --- a/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs +++ b/Tests/NFUnitTestInterface/UnitTestInterfaceTests.cs @@ -1715,7 +1715,7 @@ public static bool testMethod() { Main_old(); } - catch (System.Exception) + catch (Exception) { return false; @@ -1759,7 +1759,7 @@ public static int Main_old() else return 1; } - catch (System.Exception) + catch (Exception) { return 1; @@ -1812,7 +1812,7 @@ public static int Main_old() else return 1; } - catch (System.Exception) + catch (Exception) { return 1; } @@ -1859,7 +1859,7 @@ public static bool testMethod() { Main_old(); } - catch (System.Exception) + catch (Exception) { return false; @@ -1957,7 +1957,7 @@ static int Main_old() return 1; return 0; } - catch (System.Exception) + catch (Exception) { return 1; @@ -2133,7 +2133,7 @@ public static bool testMethod() { Main_old(); } - catch (System.Exception) + catch (Exception) { return false; } @@ -3003,7 +3003,7 @@ public static bool testMethod() { Main_old(); } - catch (System.Exception) + catch (Exception) { return false; } @@ -3052,7 +3052,7 @@ public static int Main_old() OutputHelper.WriteLine((((Interface_TestClass_struct_explicit_11_I1)le).Value).ToString()); return 0; } - catch (System.Exception) + catch (Exception) { return 1; } @@ -3104,7 +3104,7 @@ public static int Main_old() else return 1; } - catch (System.Exception) + catch (Exception) { return 1; } @@ -3150,7 +3150,7 @@ public static bool testMethod() { Main_old(); } - catch (System.Exception) + catch (Exception) { return false; } diff --git a/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs b/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs index c36a507b..bacfa204 100644 --- a/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs +++ b/Tests/NFUnitTestNamespace/UnitTestNamespaceTests.cs @@ -1595,7 +1595,7 @@ class Test /// public static void M1() { - throw new System.Exception(); + throw new Exception(); } static int Main_old() diff --git a/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs b/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs index 207bf0cf..6c2cc81c 100644 --- a/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs +++ b/Tests/NFUnitTestStatementsTests/UnitTestStatementTests.cs @@ -1202,7 +1202,7 @@ public void Func() } public void Throw() { - throw (new System.Exception("Res1")); + throw (new Exception("Res1")); } } @@ -1218,7 +1218,7 @@ public void Func() } public void Throw() { - throw (new System.Exception("Res2")); + throw (new Exception("Res2")); } } @@ -1235,7 +1235,7 @@ public void Func() } public void Throw() { - throw (new System.Exception("ResExplicit")); + throw (new Exception("ResExplicit")); } } @@ -1252,7 +1252,7 @@ public void Func() } public void Throw() { - throw (new System.Exception("NonRes1")); + throw (new Exception("NonRes1")); } } @@ -1269,7 +1269,7 @@ public void Func() } public void Throw() { - throw (new System.Exception("NonRes2")); + throw (new Exception("NonRes2")); } } @@ -1370,7 +1370,7 @@ public class Statements_TestClass_Decl_004 { public static int Main_old(string[] args) { - System.Exception r; + Exception r; return (0); } public static bool testMethod() @@ -3206,7 +3206,7 @@ public static int Main_old() // Fail } } - catch (System.Exception) + catch (Exception) { return 0; } @@ -4068,7 +4068,7 @@ private static int sMethod(int i) { if (i > 0) return (1); - throw new System.Exception(); + throw new Exception(); } private int Method(int i) { @@ -4093,7 +4093,7 @@ private int Method(int i) { return (1); } - throw new System.Exception(); + throw new Exception(); default: return (0); } @@ -4128,9 +4128,9 @@ private static int sMethod() { try { - throw new System.Exception(); + throw new Exception(); } - catch (System.Exception e) + catch (Exception e) { return (0); } @@ -4140,9 +4140,9 @@ private int Method() { try { - throw new System.Exception(); + throw new Exception(); } - catch (System.Exception e) + catch (Exception e) { return (0); } @@ -4167,10 +4167,10 @@ private static int sMethod() int i = 1; try { - System.Exception e = new System.Exception(); + Exception e = new Exception(); throw (e); } - catch (System.Exception e) + catch (Exception e) { OutputHelper.WriteLine(e.ToString()); return (0); @@ -4196,9 +4196,9 @@ private int Method() { try { - throw new System.Exception(); + throw new Exception(); } - catch (System.Exception e) + catch (Exception e) { return (0); } @@ -4226,7 +4226,7 @@ private int Method(int i) int x = 1 / i; OutputHelper.WriteLine(x.ToString()); // prevent it being optimized away } - catch (System.Exception e) + catch (Exception e) { return (0); } @@ -4258,13 +4258,13 @@ private int Method() Thrower(); //throw new System.Exception(); } - catch (System.Exception e) + catch (Exception e) { // Rethrow throw; } } - catch (System.Exception e) + catch (Exception e) { // Recatch return (0); @@ -4273,7 +4273,7 @@ private int Method() } private void Thrower() { - throw new System.Exception(); + throw new Exception(); } public static bool testMethod() { @@ -4324,7 +4324,7 @@ private int Method(int i) { try { - throw new System.Exception(); + throw new Exception(); } finally { @@ -4358,7 +4358,7 @@ private int Method(int i) { try { - throw new System.Exception(); + throw new Exception(); } catch { @@ -4421,7 +4421,7 @@ private int Method(int i) { try { - throw new System.Exception(); + throw new Exception(); } finally { @@ -4462,7 +4462,7 @@ private int Method(int i) } private int DeepMethod(int i) { - throw new System.Exception(); + throw new Exception(); } public static bool testMethod() { diff --git a/Tests/NFUnitTestStruct/UnitTestStructs.cs b/Tests/NFUnitTestStruct/UnitTestStructs.cs index 4d0b1f9d..7c79b015 100644 --- a/Tests/NFUnitTestStruct/UnitTestStructs.cs +++ b/Tests/NFUnitTestStruct/UnitTestStructs.cs @@ -538,8 +538,8 @@ public static void Call(Interface1 iface) { if (iface.GetInt() != 42) { - throw new System.Exception(); - throw new System.Exception("expected i == 42"); + throw new Exception(); + throw new Exception("expected i == 42"); } iface.SetInt(99); } diff --git a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs index 0ae888af..18671717 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs @@ -2245,7 +2245,7 @@ public void DateTime_TicksTest52() /// 1. Verifies the Ticks property /// // Creating a DateTime, getting the Ticks and Verifying - DateTime testDateTime = new System.DateTime(504911232000000000); + DateTime testDateTime = new DateTime(504911232000000000); long _ticks = testDateTime.Ticks; Assert.AreEqual(_ticks, 504911232000000000); } diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 15fb4472..d530f3b3 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -171,7 +171,7 @@ - + diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index c9cd189f..c714aff4 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -170,7 +170,7 @@ - + @@ -238,39 +238,39 @@ false - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + false @@ -373,13 +373,13 @@ false - - false - - - false - - + + false + + + false + + false diff --git a/nanoFramework.CoreLibrary/Friends.cs b/nanoFramework.CoreLibrary/Friends.cs index 97c62887..b17a6b4d 100644 --- a/nanoFramework.CoreLibrary/Friends.cs +++ b/nanoFramework.CoreLibrary/Friends.cs @@ -1,13 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Math, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.ResourceManager, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.System.Collections, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.System.Text, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.UnitTestLauncher, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.TestFramework, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.Logging, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("UnitTestLauncher, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.Graphics, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("nanoFramework.Graphics.Core, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] \ No newline at end of file +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("System.Math, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.ResourceManager, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.System.Collections, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.System.Text, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.UnitTestLauncher, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.TestFramework, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.Logging, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("UnitTestLauncher, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.Graphics, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] +[assembly: InternalsVisibleTo("nanoFramework.Graphics.Core, PublicKey=00240000048000009400000006020000002400005253413100040000010001001120aa3e809b3da4f65e1b1f65c0a3a1bf6335c39860ca41acb3c48de278c6b63c5df38239ec1f2e32d58cb897c8c174a5f8e78a9c0b6087d3aef373d7d0f3d9be67700fc2a5a38de1fb71b5b6f6046d841ff35abee2e0b0840a6291a312be184eb311baff5fef0ff6895b9a5f2253aed32fb06b819134f6bb9d531488a87ea2")] diff --git a/nanoFramework.CoreLibrary/System/Array.cs b/nanoFramework.CoreLibrary/System/Array.cs index 49f36498..1256a436 100644 --- a/nanoFramework.CoreLibrary/System/Array.cs +++ b/nanoFramework.CoreLibrary/System/Array.cs @@ -230,7 +230,7 @@ public static int BinarySearch(Array array, Object value, IComparer comparer) /// -or- /// nullNothingnullptrunit a null reference(Nothing in Visual Basic) to use the IComparable implementation of each element. /// The index of the specified value in the specified array, if value is found. If value is not found and value is less than one or more elements in array, a negative number which is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than any of the elements in array, a negative number which is the bitwise complement of (the index of the last element plus 1). - /// comparer is null reference (Nothing in Visual Basic), value does not implement the IComparable interface, and the search encounters an element that does not implement the IComparable interface. + /// comparer is null reference (Nothing in Visual Basic), value does not implement the IComparable interface, and the search encounters an element that does not implement the IComparable interface. public static int BinarySearch(Array array, int index, int length, Object value, IComparer comparer) { var lo = index; diff --git a/nanoFramework.CoreLibrary/System/Attribute.cs b/nanoFramework.CoreLibrary/System/Attribute.cs index 5542f468..0b63213e 100644 --- a/nanoFramework.CoreLibrary/System/Attribute.cs +++ b/nanoFramework.CoreLibrary/System/Attribute.cs @@ -6,7 +6,7 @@ namespace System /// /// Represents the base class for custom attributes. /// - [Serializable, AttributeUsageAttribute(AttributeTargets.All)] // Base class for all attributes + [Serializable, AttributeUsage(AttributeTargets.All)] // Base class for all attributes public abstract class Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/AttributeTargets.cs b/nanoFramework.CoreLibrary/System/AttributeTargets.cs index b3ac3344..fa30e1ef 100644 --- a/nanoFramework.CoreLibrary/System/AttributeTargets.cs +++ b/nanoFramework.CoreLibrary/System/AttributeTargets.cs @@ -8,7 +8,7 @@ namespace System /// /// Specifies the application elements on which it is valid to apply an attribute. /// - [ExcludeFromStubs] + [ExcludeType] [Flags] [Serializable] public enum AttributeTargets diff --git a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs index 9e5bd8d9..829741a3 100644 --- a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs +++ b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs @@ -9,7 +9,7 @@ namespace System /// Specifies the usage of another attribute class. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class AttributeUsageAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs index 8a1837ce..6ae5ca45 100644 --- a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs +++ b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs @@ -9,7 +9,7 @@ namespace System /// Indicates whether a program element is compliant with the Common Language Specification (CLS). This class cannot be inherited. /// [AttributeUsage(AttributeTargets.All)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class CLSCompliantAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs index e8852f64..3e92cea4 100644 --- a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs @@ -30,7 +30,7 @@ public enum EditorBrowsableState /// Specifies that a property or method is viewable in an editor. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate)] - [ExcludeFromStubs] + [ExcludeType] #pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode() /////////////////////////////////////////////////////////////////////////////////////////////////////// // GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode // diff --git a/nanoFramework.CoreLibrary/System/DBNull.cs b/nanoFramework.CoreLibrary/System/DBNull.cs index 9b496d71..95785c55 100644 --- a/nanoFramework.CoreLibrary/System/DBNull.cs +++ b/nanoFramework.CoreLibrary/System/DBNull.cs @@ -10,7 +10,7 @@ namespace System /// Represents a nonexistent value. This class cannot be inherited. /// [EditorBrowsable(EditorBrowsableState.Never)] - [ExcludeFromStubs] + [ExcludeType] public sealed class DBNull { diff --git a/nanoFramework.CoreLibrary/System/DateTime.cs b/nanoFramework.CoreLibrary/System/DateTime.cs index dd479247..cb9f3cd6 100644 --- a/nanoFramework.CoreLibrary/System/DateTime.cs +++ b/nanoFramework.CoreLibrary/System/DateTime.cs @@ -14,7 +14,7 @@ namespace System /// Specifies whether a object represents a local time, a Coordinated Universal Time (UTC), or is not specified as either local time or UTC. /// /// - /// nanoFramework doesn't support local time, only UTC, so it's not possible to specify . + /// nanoFramework doesn't support local time, only UTC, so it's not possible to specify . /// [Serializable] public enum DateTimeKind @@ -28,7 +28,7 @@ public enum DateTimeKind /// The time represented is local time. /// /// - /// nanoFramework doesn't support local time, so is provided to allow code reuse and keep consistency with full .NET framework. + /// nanoFramework doesn't support local time, so is provided to allow code reuse and keep consistency with full .NET framework. /// [Obsolete("nanoFramework doesn't support local time, so DateTimeKind.Local is provided to allow code reuse and keep consistency with full .NET framework", true)] Local = 2, @@ -169,7 +169,7 @@ private enum DateTimePart /// Initializes a new instance of the structure to a specified number of ticks. /// /// A date and time expressed in the number of 100-nanosecond intervals. - /// - Ticks must be between and . + /// - Ticks must be between and . public DateTime(long ticks) { #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs index e5f971e7..6d14c549 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/CodeAnalysis/NullableAttributes.cs @@ -12,7 +12,7 @@ namespace System.Diagnostics.CodeAnalysis /// To override a method that has a parameter annotated with this attribute, use the ? operator. For more information, see Nullable static analysis in the C# guide. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AllowNullAttribute : Attribute { } @@ -20,7 +20,7 @@ public sealed class AllowNullAttribute : Attribute /// Specifies that null is disallowed as an input even if the corresponding type allows it. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class DisallowNullAttribute : Attribute { } @@ -28,7 +28,7 @@ public sealed class DisallowNullAttribute : Attribute /// Specifies that an output may be null even if the corresponding type disallows it. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class MaybeNullAttribute : Attribute { } @@ -36,7 +36,7 @@ public sealed class MaybeNullAttribute : Attribute /// Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class NotNullAttribute : Attribute { } @@ -44,7 +44,7 @@ public sealed class NotNullAttribute : Attribute /// Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class MaybeNullWhenAttribute : Attribute { /// @@ -64,7 +64,7 @@ public sealed class MaybeNullWhenAttribute : Attribute /// /// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. /// - [ExcludeFromStubs] + [ExcludeType] public sealed class NotNullWhenAttribute : Attribute { /// Initializes the attribute with the specified return value condition. @@ -81,7 +81,7 @@ public sealed class NotNullWhenAttribute : Attribute /// Specifies that the output will be non-null if the named parameter is non-null. /// [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class NotNullIfNotNullAttribute : Attribute { /// Initializes the attribute with the associated parameter name. @@ -98,7 +98,8 @@ public sealed class NotNullIfNotNullAttribute : Attribute /// Applied to a method that will never return under any circumstance. /// [AttributeUsage(AttributeTargets.Method, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] + [DebuggerNonUserCode] public sealed class DoesNotReturnAttribute : Attribute { } @@ -106,7 +107,7 @@ public sealed class DoesNotReturnAttribute : Attribute /// Specifies that the method will not return if the associated Boolean parameter is passed the specified value. /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class DoesNotReturnIfAttribute : Attribute { /// Initializes the attribute with the specified parameter value. @@ -126,7 +127,7 @@ public sealed class DoesNotReturnIfAttribute : Attribute /// Specifies that the method or property will ensure that the listed field and property members have not-null values. /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] - [ExcludeFromStubs] + [ExcludeType] public sealed class MemberNotNullAttribute : Attribute { /// Initializes the attribute with a field or property member. @@ -151,7 +152,7 @@ public sealed class MemberNotNullAttribute : Attribute /// Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition. /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] - [ExcludeFromStubs] + [ExcludeType] public sealed class MemberNotNullWhenAttribute : Attribute { /// Initializes the attribute with the specified return value condition and a field or property member. diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs index 9bc9735a..67325721 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs @@ -9,7 +9,7 @@ namespace System.Diagnostics /// Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class ConditionalAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs index 73fb989e..9a325b4b 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs @@ -15,7 +15,7 @@ namespace System.Diagnostics /// The debugger behaviour when the is present is similar to using a combination of the attribute, which hides the code from the debugger, and the attribute, which tells the debugger to step through, rather than into, the code it is applied to. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class DebuggerStepThroughAttribute : Attribute { @@ -32,7 +32,7 @@ public DebuggerStepThroughAttribute() { } /// The attribute is used as an escape from the effect of a . When executing within the boundaries of the , designer-provided code is executed as a step-through until the next user supplied code is encountered. When context switches are made on a thread, the next user-supplied code module stepped into may not relate to the code that was in the process of being debugged. To avoid this debugging experience, use the to escape from stepping through code to running code. For example, in Visual Studio 2005, encountering a while stepping through code using the F10 key (or Step Over command) has the same effect as pressing the F5 key or using the Start Debugging command. /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class DebuggerStepperBoundaryAttribute : Attribute { @@ -49,7 +49,7 @@ public DebuggerStepperBoundaryAttribute() { } /// The common language runtime attaches no semantics to this attribute. It is provided for use by source code debuggers. For example, the Visual Studio 2005 debugger does not stop in a method marked with this attribute and does not allow a breakpoint to be set in the method. Other debugger attributes recognized by the Visual Studio 2005 debugger are the and the . /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class DebuggerHiddenAttribute : Attribute { @@ -67,7 +67,7 @@ public DebuggerHiddenAttribute() { } /// The debugger behaviour when the is present is similar to using a combination of the attribute, which hides the code from the debugger, and the attribute, which tells the debugger to step through, rather than into, the code it is applied to. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class DebuggerNonUserCodeAttribute : Attribute { @@ -240,7 +240,7 @@ public DebuggerBrowsableState State /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] - [ExcludeFromStubs] + [ExcludeType] public sealed class DebuggerTypeProxyAttribute : Attribute { private readonly string _typeName; @@ -281,7 +281,7 @@ public string ProxyTypeName /// Gets or sets the target type for the attribute. /// /// The target type for the attribute. - /// Target is set to null. + /// Target is set to null. public Type Target { set @@ -326,7 +326,7 @@ public string TargetTypeName /// Determines how a class or field is displayed in the debugger variable windows. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Assembly, AllowMultiple = true)] - [ExcludeFromStubs] + [ExcludeType] public sealed class DebuggerDisplayAttribute : Attribute { private string _name; @@ -385,7 +385,7 @@ public string Type /// Gets or sets the type of the attribute's target. /// /// The attribute's target type. - /// value + /// value public Type Target { set diff --git a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs index 2c0fbd50..94be2894 100644 --- a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs +++ b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs @@ -9,7 +9,7 @@ namespace System /// Indicates that an enumeration can be treated as a bit field; that is, a set of flags. /// [AttributeUsage(AttributeTargets.Enum)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public class FlagsAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs b/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs index 01040c9a..7e6076d6 100644 --- a/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs +++ b/nanoFramework.CoreLibrary/System/Globalization/NumberFormatInfo.cs @@ -58,7 +58,7 @@ internal NumberFormatInfo(CultureInfo cultureInfo) /// Gets the number of digits in each group to the left of the decimal in numeric values. /// /// The number of digits in each group to the left of the decimal in numeric values. The default for InvariantInfo is a one-dimensional array with only one element, which is set to 3. - /// + /// public int[] NumberGroupSizes { get diff --git a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs index ee673ab8..ff8e4fdb 100644 --- a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs +++ b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs @@ -10,7 +10,7 @@ namespace System /// Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Field)] - [ExcludeFromStubs] + [ExcludeType] public sealed class NonSerializedAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs index 769c3bdd..8fb20d73 100644 --- a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs @@ -9,7 +9,7 @@ namespace System /// Marks the program elements that are no longer in use. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class ObsoleteAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs index b79a3567..1a224722 100644 --- a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs @@ -9,7 +9,7 @@ namespace System /// Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Parameter)] - [ExcludeFromStubs] + [ExcludeType] public sealed class ParamArrayAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs index 419231b0..607a4b68 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs @@ -11,7 +11,7 @@ namespace System.Reflection /// Specifies which culture the assembly supports. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyCultureAttribute : Attribute { private readonly String _culture; @@ -41,7 +41,7 @@ public String Culture /// Specifies the version of the assembly being attributed. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyVersionAttribute : Attribute { private readonly String _version; @@ -71,7 +71,7 @@ public String Version /// Specifies the name of a file containing the key pair used to generate a strong name. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyKeyFileAttribute : Attribute { private readonly String _keyFile; @@ -101,7 +101,7 @@ public String KeyFile /// Specifies the name of a key container within the CSP containing the key pair used to generate a strong name. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyKeyNameAttribute : Attribute { private readonly String _keyName; @@ -131,7 +131,7 @@ public String KeyName /// Specifies that the assembly is not fully signed when created. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyDelaySignAttribute : Attribute { private readonly bool _delaySign; @@ -164,7 +164,7 @@ public bool DelaySign /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyFlagsAttribute : Attribute { private readonly AssemblyNameFlags _flags; @@ -208,7 +208,7 @@ public AssemblyFlagsAttribute(AssemblyNameFlags assemblyFlags) /// Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyFileVersionAttribute : Attribute { private readonly String _version; @@ -244,7 +244,7 @@ public String Version /// This attribute is specific of nanoFramework. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyNativeVersionAttribute : Attribute { private readonly String _nativeVersion; diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs index 0dfc4668..265284d5 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs @@ -10,7 +10,7 @@ namespace System.Reflection /// Provides information about an Assembly reference. /// /// Available only in mscorlib build with support for System.Reflection. - [Serializable, FlagsAttribute] + [Serializable, Flags] public enum AssemblyNameFlags { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs index d1e374c4..2ff2f285 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs @@ -11,7 +11,7 @@ namespace System.Reflection /// Defines a copyright custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyCopyrightAttribute : Attribute { private readonly String _copyright; @@ -41,7 +41,7 @@ public String Copyright /// Defines a trademark custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyTrademarkAttribute : Attribute { private readonly String _trademark; @@ -71,7 +71,7 @@ public String Trademark /// Defines a product name custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyProductAttribute : Attribute { private readonly String _product; @@ -101,7 +101,7 @@ public String Product /// Defines a company name custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyCompanyAttribute : Attribute { private readonly String _company; @@ -131,7 +131,7 @@ public String Company /// Provides a text description for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyDescriptionAttribute : Attribute { private readonly String _description; @@ -161,7 +161,7 @@ public String Description /// Specifies a description for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyTitleAttribute : Attribute { private readonly String _title; @@ -191,7 +191,7 @@ public String Title /// Specifies the build configuration, such as retail or debug, for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyConfigurationAttribute : Attribute { private readonly String _configuration; @@ -221,7 +221,7 @@ public String Configuration /// Defines a friendly default alias for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyDefaultAliasAttribute : Attribute { private readonly String _defaultAlias; @@ -251,7 +251,7 @@ public String DefaultAlias /// Defines additional version information for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] - [ExcludeFromStubs] + [ExcludeType] public sealed class AssemblyInformationalVersionAttribute : Attribute { private readonly String _informationalVersion; diff --git a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs index 6b7f5c0b..935793ad 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs @@ -13,7 +13,7 @@ namespace System.Reflection /// /// Available only in mscorlib build with support for System.Reflection. [Flags] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public enum BindingFlags { diff --git a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs index 99623997..5505040c 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs @@ -14,7 +14,7 @@ namespace System.Reflection /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class DefaultMemberAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs index 5ad9301a..b8a1eb60 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs @@ -6,7 +6,7 @@ namespace System.Reflection { [AttributeUsage(AttributeTargets.Field)] - [ExcludeFromStubs] + [ExcludeType] internal sealed class FieldNoReflectionAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs index 0f28049d..48f43e6e 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs @@ -10,7 +10,7 @@ namespace System.Reflection /// /// Specifies flags for the attributes of a method implementation. /// - [ExcludeFromStubs] + [ExcludeType] [Serializable] public enum MethodImplAttributes { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs index b911e9f9..e82dfd3c 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs @@ -8,7 +8,7 @@ namespace System.Runtime.CompilerServices /// Indicates that a parameter captures the expression passed for another parameter as a string. /// [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class CallerArgumentExpressionAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs index 7b25ce51..abb47873 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs @@ -8,7 +8,7 @@ namespace System.Runtime.CompilerServices /// Allows you to obtain the method or property name of the caller to the method. /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class CallerMemberNameAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs deleted file mode 100644 index cd6fa582..00000000 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.CompilerServices -{ - /// - /// When a class, enum, or struct is marked with it will be excluded from the native stubs generated by .NET nanoFramework metadata processor. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] - public class ExcludeFromStubsAttribute : Attribute - { - } -} diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeTypeAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeTypeAttribute.cs new file mode 100644 index 00000000..af573518 --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeTypeAttribute.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Runtime.CompilerServices +{ + /// + /// When a class, enum, or struct is marked with it will be excluded from the PE files and stubbs generated by .NET nanoFramework metadata processor. + /// + /// + /// + /// This attribute is exclusive to .NET nanoFramework and is not part of the .NET Standard. + /// + /// + /// [!Important] Placing this attribute on a class will cause the type from being excluded from the assembly metadata and therefore it will not be available at all in assemblies using or referencing them. + /// + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] + public class ExcludeTypeAttribute : Attribute + { + } +} diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs index 0bf8314b..3fba5492 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs @@ -7,7 +7,7 @@ namespace System.Runtime.CompilerServices /// Indicates the name by which an indexer is known in programming languages that do not support indexers directly. /// [AttributeUsage(AttributeTargets.Property)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public sealed class IndexerNameAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs index 41f3394c..532682bf 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs @@ -7,7 +7,7 @@ namespace System.Runtime.CompilerServices /// Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly. /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - [ExcludeFromStubs] + [ExcludeType] public sealed class InternalsVisibleToAttribute : Attribute { private readonly string _assemblyName; diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs index 251d7460..4122f9d8 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs @@ -6,7 +6,7 @@ namespace System.Runtime.CompilerServices /// /// Defines the details of how a method is implemented. /// - [ExcludeFromStubs] + [ExcludeType] [Serializable] public enum MethodImplOptions { @@ -40,7 +40,7 @@ public enum MethodImplOptions /// /// Defines how a method is implemented. /// - [ExcludeFromStubs] + [ExcludeType] [Serializable] public enum MethodCodeType { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs index 507f6e35..9a30b433 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs @@ -9,7 +9,7 @@ namespace System.Runtime.InteropServices /// Controls accessibility of an individual managed type or member, or of all types within an assembly, to COM. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class ComVisibleAttribute : Attribute { internal bool _val; @@ -36,7 +36,7 @@ public ComVisibleAttribute(bool visibility) /// Supplies an explicit System.Guid when an automatic GUID is undesirable. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Delegate, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class GuidAttribute : Attribute { internal String Val; @@ -63,7 +63,7 @@ public GuidAttribute(String guid) /// Indicates that data should be marshaled from callee back to caller. /// [AttributeUsage(AttributeTargets.Parameter)] - [ExcludeFromStubs] + [ExcludeType] public sealed class OutAttribute : Attribute { } @@ -72,7 +72,7 @@ public sealed class OutAttribute : Attribute /// Lets you control the physical layout of the data fields of a class or structure in memory. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class StructLayoutAttribute : Attribute { internal LayoutKind Val; diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs index 890b759f..ce4f3752 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs @@ -8,7 +8,7 @@ namespace System.Runtime.InteropServices /// /// Dictates which character set marshaled strings should use. /// - [ExcludeFromStubs] + [ExcludeType] [Serializable] public enum CharSet { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs index 5c59d515..3dc424fd 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs @@ -8,7 +8,7 @@ namespace System.Runtime.InteropServices /// /// Controls the layout of an object when exported to unmanaged code. /// - [ExcludeFromStubs] + [ExcludeType] [Serializable] public enum LayoutKind { diff --git a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs index 87eb7f9d..ad71d391 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Remoting.Proxies { [EditorBrowsable(EditorBrowsableState.Never)] - [ExcludeFromStubs] + [ExcludeType] internal sealed class __TransparentProxy { } diff --git a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs index f5fae2b8..c12d288f 100644 --- a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs @@ -9,7 +9,7 @@ namespace System /// Indicates that a class can be serialized. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] - [ExcludeFromStubs] + [ExcludeType] public sealed class SerializableAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/SpanByte.cs b/nanoFramework.CoreLibrary/System/SpanByte.cs index 57d4128b..a8792aaf 100644 --- a/nanoFramework.CoreLibrary/System/SpanByte.cs +++ b/nanoFramework.CoreLibrary/System/SpanByte.cs @@ -31,7 +31,7 @@ public SpanByte(byte[] array) /// The source array. /// The index of the first element to include in the new System.Span /// The number of elements to include in the new System.Span - /// + /// /// /// array is null, but start or length is non-zero /// @@ -83,7 +83,7 @@ public SpanByte(byte[] array, int start, int length) /// /// The zero-based index of the element. /// The element at the specified index. - /// + /// /// is out of range. /// public byte this[int index] @@ -133,7 +133,7 @@ public byte this[int index] /// Copies the contents of this System.Span into a destination System.Span. /// /// The destination System.Span object. - /// + /// /// destination is shorter than the source . /// public void CopyTo(SpanByte destination) @@ -156,7 +156,7 @@ public void CopyTo(SpanByte destination) /// /// The index at which to begin the slice. /// A span that consists of all elements of the current span from start to the end of the span. - /// is < zero or > . + /// is < zero or > . public SpanByte Slice(int start) { return Slice(start, _length - start); @@ -168,7 +168,7 @@ public SpanByte Slice(int start) /// The index at which to begin this slice. /// The desired length for the slice. /// A that consists of number of elements from the current starting at . - /// or + is < zero or > . + /// or + is < zero or > . public SpanByte Slice(int start, int length) { if ((start < 0) || (length < 0) || (start + length > _length)) diff --git a/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs b/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs index 72730173..b29e5d6a 100644 --- a/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs +++ b/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs @@ -6,7 +6,7 @@ namespace System.Runtime.Versioning /// /// Identifies the version of the .NET Framework that a particular assembly was compiled against. /// - [AttributeUsageAttribute(AttributeTargets.Assembly)] + [AttributeUsage(AttributeTargets.Assembly)] public sealed class TargetFrameworkAttribute : Attribute { private String _frameworkName; @@ -16,7 +16,7 @@ public sealed class TargetFrameworkAttribute : Attribute /// Initializes an instance of the TargetFrameworkAttribute class by specifying the .NET Framework version against which an assembly was built. /// /// The version of the .NET Framework against which the assembly was built. - /// + /// public TargetFrameworkAttribute(String frameworkName) { #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one diff --git a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs index c2c9028d..c428eaef 100644 --- a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs +++ b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs @@ -9,7 +9,7 @@ namespace System /// Indicates that the COM threading model for an application is single-threaded apartment (STA). /// [AttributeUsage(AttributeTargets.Method)] - [ExcludeFromStubs] + [ExcludeType] public sealed class STAThreadAttribute : Attribute { /// @@ -24,7 +24,7 @@ public STAThreadAttribute() /// Indicates that the COM threading model for an application is multithreaded apartment (MTA). /// [AttributeUsage(AttributeTargets.Method)] - [ExcludeFromStubs] + [ExcludeType] public sealed class MTAThreadAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs b/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs index 8d62bd88..ee58e5d9 100644 --- a/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs +++ b/nanoFramework.CoreLibrary/System/Threading/SpinWait.cs @@ -20,7 +20,7 @@ namespace System.Threading /// is a value type, which means that low-level code can utilize SpinWait without /// fear of unnecessary allocation overheads. SpinWait is not generally useful for ordinary applications. /// In most cases, you should use the synchronization classes provided by the .NET Framework, such as - /// . For most purposes where spin waiting is required, however, + /// . For most purposes where spin waiting is required, however, /// the type should be preferred over the method. /// diff --git a/nanoFramework.CoreLibrary/System/Threading/Thread.cs b/nanoFramework.CoreLibrary/System/Threading/Thread.cs index 0daaf3e7..2f032713 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Thread.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Thread.cs @@ -117,7 +117,7 @@ public extern bool IsAlive /// of equal priority that are ready to run, execution of the current thread is not suspended. /// /// The thread will not be scheduled for execution by the operating system for the amount of time specified. - /// You can specify Timeout.Infinite for the parameter to suspend the thread indefinitely. However, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. + /// You can specify Timeout.Infinite for the parameter to suspend the thread indefinitely. However, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. /// The system clock ticks at a specific rate called the clock resolution. The actual timeout might not be exactly the specified timeout, because the specified timeout will be adjusted to coincide with clock ticks. /// [MethodImpl(MethodImplOptions.InternalCall)] @@ -132,7 +132,7 @@ public extern bool IsAlive /// of equal priority that are ready to run, execution of the current thread is not suspended. /// /// The thread will not be scheduled for execution by the operating system for the amount of time specified. - /// You can specify for the parameter to suspend the thread indefinitely. However, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. + /// You can specify for the parameter to suspend the thread indefinitely. However, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. /// The system clock ticks at a specific rate called the clock resolution. The actual timeout might not be exactly the specified timeout, because the specified timeout will be adjusted to coincide with clock ticks. /// public static void Sleep(TimeSpan timeout) diff --git a/nanoFramework.CoreLibrary/System/Threading/Timeout.cs b/nanoFramework.CoreLibrary/System/Threading/Timeout.cs index af9572e0..ff827b3b 100644 --- a/nanoFramework.CoreLibrary/System/Threading/Timeout.cs +++ b/nanoFramework.CoreLibrary/System/Threading/Timeout.cs @@ -18,7 +18,7 @@ public static class Timeout /// A constant used to specify an infinite waiting period, for methods that accept a parameter. /// /// - /// For threading methods that accept a timeout parameter of type , such as and , this value is used to suspend the thread indefinitely. However, in most cases, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. + /// For threading methods that accept a timeout parameter of type , such as and , this value is used to suspend the thread indefinitely. However, in most cases, we recommend that you use other classes such as , , or instead to synchronize threads or manage resources. /// The value of this field is -00:00:00.0010000, or -1 millisecond. /// public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Infinite); diff --git a/nanoFramework.CoreLibrary/System/TimeSpan.cs b/nanoFramework.CoreLibrary/System/TimeSpan.cs index 10ad4475..12b84926 100644 --- a/nanoFramework.CoreLibrary/System/TimeSpan.cs +++ b/nanoFramework.CoreLibrary/System/TimeSpan.cs @@ -10,7 +10,7 @@ namespace System /// /// /// A object represents a time interval (duration of time or elapsed time) that is measured as a positive or negative number of days, hours, minutes, seconds, and fractions of a second. The structure can also be used to represent the time of day, but only if the time is unrelated to a particular date. Otherwise, the structure should be used instead. - /// The value of a object is the number of ticks that equal the represented time interval. A tick is equal to 100 nanoseconds, or one ten-millionth of a second. The value of a object can range from to . + /// The value of a object is the number of ticks that equal the represented time interval. A tick is equal to 100 nanoseconds, or one ten-millionth of a second. The value of a object can range from to . /// [Serializable] public struct TimeSpan diff --git a/nanoFramework.CoreLibrary/System/TypedReference.cs b/nanoFramework.CoreLibrary/System/TypedReference.cs index 888a564e..b51989f9 100644 --- a/nanoFramework.CoreLibrary/System/TypedReference.cs +++ b/nanoFramework.CoreLibrary/System/TypedReference.cs @@ -11,7 +11,7 @@ namespace System /// Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location. /// [EditorBrowsable(EditorBrowsableState.Never)] - [ExcludeFromStubs] + [ExcludeType] public struct TypedReference { } } diff --git a/nanoFramework.CoreLibrary/System/UIntPtr.cs b/nanoFramework.CoreLibrary/System/UIntPtr.cs index 64f7d7ec..157e7ee8 100644 --- a/nanoFramework.CoreLibrary/System/UIntPtr.cs +++ b/nanoFramework.CoreLibrary/System/UIntPtr.cs @@ -10,7 +10,7 @@ namespace System /// A platform-specific type that is used to represent a pointer or a handle. /// [EditorBrowsable(EditorBrowsableState.Never)] - [ExcludeFromStubs] + [ExcludeType] [Serializable] public struct UIntPtr { From 5bc6ee804c16a92b2369704c3331621b0f952223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 3 Feb 2025 16:22:18 +0000 Subject: [PATCH 41/70] Add NativeProfiled attribute (#227) ***NO_CI*** (cherry picked from commit f47b4d3807416fe493a4004d64efbee0de2c85ab) --- .../CoreLibrary.NoReflection.nfproj | 3 +++ nanoFramework.CoreLibrary/CoreLibrary.nfproj | 6 +++++- .../Diagnostics/NativeProfiledAttribute.cs | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 nanoFramework.CoreLibrary/System/Diagnostics/NativeProfiledAttribute.cs diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index d530f3b3..61ec73e2 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -303,6 +303,9 @@ false + + false + false diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index c714aff4..ab132cce 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -66,6 +66,7 @@ + @@ -246,7 +247,7 @@ false - + false @@ -295,6 +296,9 @@ false + + false + false diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/NativeProfiledAttribute.cs b/nanoFramework.CoreLibrary/System/Diagnostics/NativeProfiledAttribute.cs new file mode 100644 index 00000000..1d8bbd57 --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Diagnostics/NativeProfiledAttribute.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace System.Diagnostics +{ + /// + /// Indicates that a method will profiled by the runtime, providing it has profiling capabilities enabled. + /// + /// + /// This attribute is exclusive to the .NET nanoFramework runtime and has no effect on other runtimes. + /// + [ExcludeType] + [DebuggerNonUserCode] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + public sealed class NativeProfiledAttribute : Attribute + { } +} From 76cc31b914fe3666433c53053ae66b489b6cc8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 3 Feb 2025 16:49:19 +0000 Subject: [PATCH 42/70] Fix message for `ArgumentException` (#228) ***NO_CI*** (cherry picked from commit ed838444d722db2ab69145b953f63547211a47e1) --- nanoFramework.CoreLibrary/System/ArgumentException.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/ArgumentException.cs b/nanoFramework.CoreLibrary/System/ArgumentException.cs index 0710e6b2..39c70686 100644 --- a/nanoFramework.CoreLibrary/System/ArgumentException.cs +++ b/nanoFramework.CoreLibrary/System/ArgumentException.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #nullable enable @@ -15,7 +15,7 @@ public class ArgumentException : SystemException { // ReSharper disable InconsistentNaming private static readonly string Arg_ArgumentException = "Value does not fall within the expected range."; - private static readonly string Arg_ParamName_Name = "(Parameter '%s')"; + private static readonly string Arg_ParamName_Name = "(Parameter '{0}')"; private static readonly string Argument_EmptyString = "The value cannot be an empty string."; // ReSharper restore InconsistentNaming From b4fd96082f1ff80bdbd724262f9b5405db99b1f0 Mon Sep 17 00:00:00 2001 From: Cory Charlton Date: Mon, 3 Feb 2025 15:02:57 -0800 Subject: [PATCH 43/70] Add unit tests for new nullable attributes (#225) (cherry picked from commit 475ca13e4bc84c94ff235596735ecc083926a63a) --- .../CodeAnalysis/NullableAttributesTests.cs | 282 ++++++++++++++++++ .../NFUnitTestAttributes.nfproj | 7 +- .../CallerArgumentExpressionAttributeTests.cs | 3 +- .../CallerMemberNameAttributeTests.cs | 2 +- .../ArgumentExceptionTests.cs | 56 ++++ .../ArgumentNullExceptionTests.cs | 48 +++ .../NFUnitTestException.nfproj | 7 +- nanoFramework.CoreLibrary.sln | 4 +- 8 files changed, 400 insertions(+), 9 deletions(-) create mode 100644 Tests/NFUnitTestAttributes/Diagnostics/CodeAnalysis/NullableAttributesTests.cs rename Tests/NFUnitTestAttributes/{ => Runtime/CompilerServices}/CallerArgumentExpressionAttributeTests.cs (97%) rename Tests/NFUnitTestAttributes/{ => Runtime/CompilerServices}/CallerMemberNameAttributeTests.cs (93%) create mode 100644 Tests/NFUnitTestException/ArgumentExceptionTests.cs create mode 100644 Tests/NFUnitTestException/ArgumentNullExceptionTests.cs diff --git a/Tests/NFUnitTestAttributes/Diagnostics/CodeAnalysis/NullableAttributesTests.cs b/Tests/NFUnitTestAttributes/Diagnostics/CodeAnalysis/NullableAttributesTests.cs new file mode 100644 index 00000000..f5edf56e --- /dev/null +++ b/Tests/NFUnitTestAttributes/Diagnostics/CodeAnalysis/NullableAttributesTests.cs @@ -0,0 +1,282 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics.CodeAnalysis; +using nanoFramework.TestFramework; + +#nullable enable +// ReSharper disable RedundantNullableFlowAttribute +namespace NFUnitTestAttributes.Diagnostics.CodeAnalysis +{ + [TestClass] + public class NullableAttributesTests + { + private static void AssertDoesNotThrow(Action unitTest) + { + Exception? exception = null; + + try + { + unitTest(); + } + catch (Exception ex) + { + exception = ex; + } + + Assert.IsNull(exception, $"Expected no exception but got: {exception}"); + } + + [TestMethod] + public void Validate_AllowNullAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new AllowNullAttributeTestClass(); + sut.Method(null); + }); + } + + [TestMethod] + public void Validate_DisallowNullAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new DisallowNullAttributeTestClass(); + sut.Method(null!); + }); + } + + [TestMethod] + public void Validate_DoesNotReturnAttribute() + { + var sut = new DoesNotReturnAttributeTestClass(); + + Assert.ThrowsException(typeof(NotImplementedException), () => sut.Method()); + } + + [TestMethod] + public void Validate_DoesNotReturnIfAttribute() + { + var sut = new DoesNotReturnIfAttributeTestClass(); + + Assert.ThrowsException(typeof(NotImplementedException), () => sut.Method(true)); + } + + [TestMethod] + public void Validate_MaybeNullAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new MaybeNullAttributeTestClass(); + sut.Method(null!); + }); + } + + [TestMethod] + public void Validate_MaybeNullWhenAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new MaybeNullWhenAttributeTestClass(); + sut.Method(null!); + }); + } + + [TestMethod] + public void Validate_MemberNotNullAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new MemberNotNullAttributeTestClass(); + sut.Method(null!); + }); + } + + [TestMethod] + public void Validate_MemberNotNullWhenAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new MemberNotNullWhenAttributeTestClass(); + sut.Method(); + }); + } + + [TestMethod] + public void Validate_NotNullAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new NotNullAttributeTestClass(); + sut.Method(null!); + }); + } + + [TestMethod] + public void Validate_NotNullIfNotNullAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new NotNullIfNotNullAttributeTestClass(); + sut.Method(null!); + }); + } + + [TestMethod] + public void Validate_NotNullWhenAttribute() + { + AssertDoesNotThrow(() => + { + var sut = new NotNullWhenAttributeTestClass(); + sut.Method(null!); + }); + } + } + + #region Test classes + public class AllowNullAttributeTestClass + { + [AllowNull] + public string? Field; + + [AllowNull] + public string Property { get; set; } + + public void Method([AllowNull] string? value) + { + // Do nothing + } + } + + public class DisallowNullAttributeTestClass + { + [DisallowNull] + public string? Field = null!; + + [DisallowNull] + public string? Property { get; set; } = null!; + + public void Method([DisallowNull] string value) + { + // Do nothing + } + } + + public class DoesNotReturnAttributeTestClass + { + [DoesNotReturn] + public void Method() + { + throw new NotImplementedException(); + } + } + + public class DoesNotReturnIfAttributeTestClass + { + public void Method([DoesNotReturnIf(true)] bool value) + { + if (value) + { + throw new NotImplementedException(); + } + } + } + + public class MaybeNullAttributeTestClass + { + [MaybeNull] + public string? Field = null!; + + [MaybeNull] + public string? Property { get; set; } = null!; + + [MaybeNull] + public string? this[string? value] => Field; + + public string Method([MaybeNull] string value) + { + return null!; + } + } + + public class MaybeNullWhenAttributeTestClass + { + public bool Method([MaybeNullWhen(true)] string value) + { + return true; + } + } + + public class MemberNotNullAttributeTestClass + { + public string? Field = null!; + + [MemberNotNull(nameof(Field))] + public string Property { get; set; } = null!; + + [MemberNotNull(nameof(Field))] + public void Method(string value) + { + Field = value; + } + } + + public class MemberNotNullWhenAttributeTestClass + { + public string? Field = null!; + + [MemberNotNullWhen(true, nameof(Field))] + public bool Property { get; set; } = true; + + [MemberNotNullWhen(true, nameof(Field))] + public bool Method() + { + Field = string.Empty; + return true; + } + } + + public class NotNullAttributeTestClass + { + [NotNull] + public string? Field = null!; + + [NotNull] + public string? Property { get; set; } = null!; + + [NotNull] + public string this[string? value] => value!; + + public string Method([NotNull] string value) + { + return null!; + } + } + + public class NotNullIfNotNullAttributeTestClass + { + public string? Field = null!; + + [NotNullIfNotNull(nameof(Field))] + public string? Property { get; set; } = null!; + + [NotNullIfNotNull(nameof(Field))] + public string this[string? value] => value!; + + public string Method([NotNullIfNotNull(nameof(Field))] string value) + { + return null!; + } + } + + public class NotNullWhenAttributeTestClass + { + public bool Method([NotNullWhen(true)] string value) + { + return true; + } + } + #endregion +} diff --git a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj index b310b5e6..0f533f70 100644 --- a/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj +++ b/Tests/NFUnitTestAttributes/NFUnitTestAttributes.nfproj @@ -21,13 +21,14 @@ true UnitTest v1.0 - default + default - - + + + diff --git a/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs b/Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerArgumentExpressionAttributeTests.cs similarity index 97% rename from Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs rename to Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerArgumentExpressionAttributeTests.cs index 07cd6fa6..1359e507 100644 --- a/Tests/NFUnitTestAttributes/CallerArgumentExpressionAttributeTests.cs +++ b/Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerArgumentExpressionAttributeTests.cs @@ -4,7 +4,8 @@ using System.Runtime.CompilerServices; using nanoFramework.TestFramework; -namespace NFUnitTestAttributes +#nullable enable +namespace NFUnitTestAttributes.Runtime.CompilerServices { [TestClass] public class CallerArgumentExpressionAttributeTests diff --git a/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs b/Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerMemberNameAttributeTests.cs similarity index 93% rename from Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs rename to Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerMemberNameAttributeTests.cs index fb114d72..660d6a49 100644 --- a/Tests/NFUnitTestAttributes/CallerMemberNameAttributeTests.cs +++ b/Tests/NFUnitTestAttributes/Runtime/CompilerServices/CallerMemberNameAttributeTests.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; using nanoFramework.TestFramework; -namespace NFUnitTestAttributes +namespace NFUnitTestAttributes.Runtime.CompilerServices { [TestClass] public class CallerMemberNameAttributeTests diff --git a/Tests/NFUnitTestException/ArgumentExceptionTests.cs b/Tests/NFUnitTestException/ArgumentExceptionTests.cs new file mode 100644 index 00000000..de0d2469 --- /dev/null +++ b/Tests/NFUnitTestException/ArgumentExceptionTests.cs @@ -0,0 +1,56 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using nanoFramework.TestFramework; + +#nullable enable +namespace NFUnitTestException +{ + [TestClass] + public class ArgumentExceptionTests + { + [TestMethod] + public void ctor_sets_correct_message_with_parameter() + { + const string parameter = nameof(ctor_sets_correct_message_with_parameter); + const string expected = $"Value does not fall within the expected range. (Parameter '{parameter}')"; + + var ex1 = new ArgumentException(null, parameter); + var ex2 = new ArgumentException(null, parameter, (Exception?)null); + + Assert.AreEqual(expected, ex1.Message); + Assert.AreEqual(expected, ex2.Message); + } + + [TestMethod] + public void ctor_sets_correct_message_without_parameter() + { + const string expected = "Value does not fall within the expected range."; + + var ex1 = new ArgumentException(); + var ex2 = new ArgumentException(null); + var ex3 = new ArgumentException(null, (Exception?)null); + var ex4 = new ArgumentException(null, (string?)null); + var ex5 = new ArgumentException(null, (string?)null, (Exception?)null); + + Assert.AreEqual(expected, ex1.Message); + Assert.AreEqual(expected, ex2.Message); + Assert.AreEqual(expected, ex3.Message); + Assert.AreEqual(expected, ex4.Message); + Assert.AreEqual(expected, ex5.Message); + } + + [TestMethod] + public void ThrowIfNullOrEmpty_throws_ArgumentException_if_empty_string() + { + Assert.ThrowsException(typeof(ArgumentException), () => ArgumentException.ThrowIfNullOrEmpty(string.Empty)); + } + + [TestMethod] + public void ThrowIfNullOrEmpty_throws_ArgumentNullException_if_null() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => ArgumentException.ThrowIfNullOrEmpty(null)); + } + } +} diff --git a/Tests/NFUnitTestException/ArgumentNullExceptionTests.cs b/Tests/NFUnitTestException/ArgumentNullExceptionTests.cs new file mode 100644 index 00000000..823697df --- /dev/null +++ b/Tests/NFUnitTestException/ArgumentNullExceptionTests.cs @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using nanoFramework.TestFramework; + +#nullable enable +namespace NFUnitTestException +{ + [TestClass] + public class ArgumentNullExceptionTests + { + [TestMethod] + public void ctor_sets_correct_message_with_parameter() + { + const string parameter = nameof(ctor_sets_correct_message_with_parameter); + const string expected = $"Value cannot be null. (Parameter '{parameter}')"; + + var ex1 = new ArgumentNullException(parameter); + var ex2 = new ArgumentNullException(parameter, (string?)null); + + Assert.AreEqual(expected, ex1.Message); + Assert.AreEqual(expected, ex2.Message); + } + + [TestMethod] + public void ctor_sets_correct_message_without_parameter() + { + const string expected = "Value cannot be null."; + + var ex1 = new ArgumentNullException(); + var ex2 = new ArgumentNullException(null); + var ex3 = new ArgumentNullException(null, (Exception?)null); + var ex4 = new ArgumentNullException((string?)null, (string?)null); + + Assert.AreEqual(expected, ex1.Message); + Assert.AreEqual(expected, ex2.Message); + Assert.AreEqual(expected, ex3.Message); + Assert.AreEqual(expected, ex4.Message); + } + + [TestMethod] + public void ThrowIfNullOrEmpty_throws_ArgumentNullException_if_null() + { + Assert.ThrowsException(typeof(ArgumentNullException), () => ArgumentNullException.ThrowIfNull(null)); + } + } +} diff --git a/Tests/NFUnitTestException/NFUnitTestException.nfproj b/Tests/NFUnitTestException/NFUnitTestException.nfproj index 053e0477..34ada761 100644 --- a/Tests/NFUnitTestException/NFUnitTestException.nfproj +++ b/Tests/NFUnitTestException/NFUnitTestException.nfproj @@ -1,4 +1,4 @@ - + @@ -21,9 +21,12 @@ true UnitTest v1.0 + default + + @@ -38,4 +41,4 @@ - \ No newline at end of file + diff --git a/nanoFramework.CoreLibrary.sln b/nanoFramework.CoreLibrary.sln index 9e41b209..4c17c591 100644 --- a/nanoFramework.CoreLibrary.sln +++ b/nanoFramework.CoreLibrary.sln @@ -254,8 +254,8 @@ Global {0D4EF4F8-F616-4DF6-83E3-AB7E4F0EEE4B} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {F388C3CC-8875-4FA0-B6C7-C5C8D8B92437} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {48C77E72-02D2-4D6F-B68B-B0972388781F} = {0BAE286A-5434-4F56-A9F1-41B72056170E} - {44A0C6A8-4F31-405B-95CA-6F0D65BC11B8} = {0BAE286A-5434-4F56-A9F1-41B72056170E} - {55F048B5-6739-43C5-A93D-DB61DB8E912F} = {0BAE286A-5434-4F56-A9F1-41B72056170E} + {44A0C6A8-4F31-405B-95CA-6F0D65BC11B8} = {0BAE286A-5434-4F56-A9F1-41B72056170E} + {55F048B5-6739-43C5-A93D-DB61DB8E912F} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {0BE498D1-CB3E-4D1E-BA4C-2C49AE30432D} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {6D740F0A-D435-4ACF-AD27-D702A599F229} = {0BAE286A-5434-4F56-A9F1-41B72056170E} {768BE3B6-41C6-4DFB-8A2D-443B2113F5AD} = {0BAE286A-5434-4F56-A9F1-41B72056170E} From 8b7a24c20031b14f14e8c93490c9c434d855ae8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 6 Feb 2025 19:52:13 +0000 Subject: [PATCH 44/70] Work and improvements in unit tests (#232) ***NO_CI*** (cherry picked from commit e7f7768d90204a931162c9e36cdf93cee9ed0d84) --- .../UnitTestConvertTests.cs | 20 +- Tests/NFUnitTestSystemLib/UnitTestDateTime.cs | 26 +- Tests/NFUnitTestSystemLib/UnitTestDouble.cs | 95 +- .../UnitTestReflectionMemberTest.cs | 54 +- .../UnitTestReflectionTypeTest.cs | 24 +- Tests/NFUnitTestSystemLib/UnitTestSingle.cs | 111 +- Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs | 11 +- .../NFUnitTestSystemLib/UnitTestTypeTests.cs | 34 +- .../UnitTestObjectTypeTests.cs | 30 + .../UnitTestValueArrayTypess.cs | 27 +- .../UnitTestValueFloatTests.cs | 528 +++---- .../UnitTestValueIntegralTests.cs | 1322 ++++++++--------- .../UnitTestValueSimpleTests.cs | 33 +- 13 files changed, 1247 insertions(+), 1068 deletions(-) diff --git a/Tests/NFUnitTestConversions/UnitTestConvertTests.cs b/Tests/NFUnitTestConversions/UnitTestConvertTests.cs index 709de6ba..5cbdb058 100644 --- a/Tests/NFUnitTestConversions/UnitTestConvertTests.cs +++ b/Tests/NFUnitTestConversions/UnitTestConvertTests.cs @@ -96,17 +96,17 @@ public void Convert_Negative() string number = "-12"; int actualNumber = -12; sbyte value_sb = Convert.ToSByte(number); - Assert.AreEqual(value_sb, (sbyte)actualNumber, "Test1"); - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { byte value_b = Convert.ToByte(number); }, "Test2"); + Assert.AreEqual(value_sb, (sbyte)actualNumber); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { Convert.ToByte(number); }); short value_s16 = Convert.ToInt16(number); - Assert.AreEqual(value_s16, (short)actualNumber, "Test3"); - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { ushort value_u16 = Convert.ToUInt16(number); }, "Test4"); + Assert.AreEqual(value_s16, (short)actualNumber); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { Convert.ToUInt16(number); }); int value_s32 = Convert.ToInt32(number); - Assert.AreEqual(value_s32, actualNumber, "Test5"); - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { uint value_u32 = Convert.ToUInt32(number); }, "Test6"); + Assert.AreEqual(value_s32, actualNumber); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { Convert.ToUInt32(number); }); long value_s64 = Convert.ToInt32(number); - Assert.AreEqual(value_s64, actualNumber, "Test7"); - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { ulong value_u64 = Convert.ToUInt64(number); }, "Test8"); + Assert.AreEqual(value_s64, actualNumber); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { Convert.ToUInt64(number); }); } [TestMethod] @@ -118,8 +118,8 @@ public void Convert_Double() double value_dd = Convert.ToDouble(number); Assert.AreEqual(value_dd, actualNumber); - Assert.AreEqual(-129, Convert.ToDouble("-129"), "The value '-129' did not parse to -129"); // can't handle not having a decimal point! - Assert.AreEqual(-123.456, Convert.ToDouble("-123.456"), "The value -123.456 did not parse to -123.456"); + Assert.AreEqual(-129, Convert.ToDouble("-129")); // can't handle not having a decimal point! + Assert.AreEqual(-123.456, Convert.ToDouble("-123.456")); } [TestMethod] diff --git a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs index 18671717..f9ede952 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDateTime.cs @@ -23,7 +23,7 @@ public void DateTime_ConstructorTest1() OutputHelper.WriteLine(dt.ToString()); Type type = dt.GetType(); // Verifying its type - Assert.IsType(type, Type.GetType("System.DateTime")); + Assert.IsInstanceOfType(type, Type.GetType("System.DateTime")); } [TestMethod] @@ -49,7 +49,7 @@ public void DateTime_ConstructorTest2() dt.Hour + ":" + dt.Minute + ":" + dt.Second + ":" + dt.Millisecond + "'"); } Type t = dt.GetType(); - Assert.IsType(t, Type.GetType("System.DateTime")); + Assert.IsInstanceOfType(t, Type.GetType("System.DateTime")); } } @@ -301,7 +301,6 @@ public void DateTime_ToStringTest10() // expected format is dddd, dd MMMM yyyy HH:mm int minLength = 25; - int actualLength = dtOutput1.Length; // check length Assert.IsTrue(dtOutput1.Length >= minLength, $"Wrong output1 length: {dtOutput1.Length}, should have been at least {minLength}"); @@ -386,7 +385,6 @@ public void DateTime_ToStringTest11() // expected format is dddd, dd MMMM yyyy HH:mm:ss int minLength = 26; - int actualLength = dtOutput1.Length; // check length Assert.IsTrue(dtOutput1.Length >= minLength, $"Wrong output1 length: {dtOutput1.Length}, should have been at least {minLength}"); @@ -1774,10 +1772,10 @@ public void DateTime_AddTicks_PositiveTest20() for (int i = 0; i < dt1Arr.Length; i++) { DateTime dt1 = dt1Arr[i]; - long ticks = (long)random.Next(1000); + long ticksVAlue = random.Next(1000); // Adding '" + ticks + "' ticks to '" + dt1.ToString() + "' - DateTime dt2 = dt1.AddTicks(ticks); - Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ticks)); + DateTime dt2 = dt1.AddTicks(ticksVAlue); + Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ticksVAlue)); } } @@ -1795,10 +1793,10 @@ public void DateTime_AddTicks_NegativeTest21() for (int i = 0; i < 10; i++) { DateTime dt1 = dt1Arr[i]; - long ticks = -(long)random.Next(1000); + long ticksValue = -(long)random.Next(1000); // Adding '" + ticks + "' ticks to '" + dt1.ToString() + "' - DateTime dt2 = dt1.AddTicks(ticks); - Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ticks)); + DateTime dt2 = dt1.AddTicks(ticksValue); + Assert.AreEqual(dt2.Ticks, (dt1.Ticks + ticksValue)); } } @@ -2113,7 +2111,7 @@ public void DateTime_DateTest41() DateTime dt = GetRandomDateTime(); DateTime _date = dt.Date; if ((_date.Year != dt.Year) || (_date.Month != dt.Month) || (_date.Day != dt.Day) || - (_date.Hour != 0) || (_date.Minute != 0) | (_date.Second != 0) || (_date.Millisecond != 0)) + (_date.Hour != 0) || (_date.Minute != 0) || (_date.Second != 0) || (_date.Millisecond != 0)) { throw new Exception("Failure : expected Date(mm/dd/yr/hr/mn/sec/msec) = '" + dt.Month + "/" + dt.Day + "/" + dt.Year + "/0:0:0:0' but got '" + _date.Month + "/" + _date.Day + "/" + @@ -2272,7 +2270,7 @@ public void DateTime_BelowMinDateTime_ArgumentOutOfRangeExceptionTest58() { // Creating a DateTime with -ve Ticks and, // verifying ArgumentOutOfRangeException is thrown - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { DateTime dt = new DateTime(-(new Random().Next(10) + 1)); }); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = new DateTime(-(new Random().Next(10) + 1)); }); } [TestMethod] @@ -2280,8 +2278,8 @@ public void DateTime_AboveMaxDatTime_ArgumentOutOfRangeExceptionTest59() { // Creating a DateTime later than DateTime.MaxValue and, // verifying ArgumentOutOfRangeException is thrown - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { DateTime dt1 = new DateTime(DateTime.MaxValue.Ticks + 1); }); - Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { DateTime dt2 = new DateTime(10000, 1, 1, 0, 0, 0, 0); }); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = new DateTime(DateTime.MaxValue.Ticks + 1); }); + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { _ = new DateTime(10000, 1, 1, 0, 0, 0, 0); }); } [TestMethod] diff --git a/Tests/NFUnitTestSystemLib/UnitTestDouble.cs b/Tests/NFUnitTestSystemLib/UnitTestDouble.cs index de6a49ce..45c0fe24 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestDouble.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestDouble.cs @@ -46,19 +46,26 @@ public void Epsilon() [TestMethod] public void NaN() { + // Identical expressions should not be used on both sides of operators + // on purpose to test the NaN value +#pragma warning disable S1764 Assert.IsTrue(double.NaN.Equals(0.0d / 0.0d)); + Assert.IsTrue(double.IsNaN(0.0d / 0.0d)); +#pragma warning restore S1764 // Identical expressions should not be used on both sides of operators } [TestMethod] public void NegativeInfinity() { Assert.AreEqual(-1.0 / 0.0, double.NegativeInfinity); + Assert.IsTrue(double.IsNegativeInfinity(-1.0 / 0.0)); } [TestMethod] public void PositiveInfinity() { Assert.AreEqual(1.0 / 0.0, double.PositiveInfinity); + Assert.IsTrue(double.IsPositiveInfinity(1.0 / 0.0)); } [TestMethod] @@ -66,33 +73,84 @@ public void Equals() { DoubleTestData[] testData = new DoubleTestData[] { - new DoubleTestData((double)789, (double)789, true), - new DoubleTestData((double)789, (double)-789, false), - new DoubleTestData((double)789, (double)0, false), - new DoubleTestData(double.NaN, double.NaN, true), - new DoubleTestData(double.NaN, -double.NaN, true), - new DoubleTestData((double)789, (float)789, false), - new DoubleTestData((double)789, "789", false) + new DoubleTestData( + (double)789, + (double)789, + true, + "789 should be equal to 789"), + new DoubleTestData( + (double)789, + (double)-789, + false, + "789 should not be equal to -789"), + new DoubleTestData( + (double)789, + (double)0, + false, + "789 should not be equal to 0"), + new DoubleTestData( + double.NaN, + double.NaN, + true, + "NaN should be equal to NaN"), + new DoubleTestData( + double.NaN, + -double.NaN, + true, + "NaN should be equal to -NaN"), + new DoubleTestData( + (double)789, + (float)789, + false, + "789 should not be equal to 789f"), + new DoubleTestData( + (double)789, + "789", + false, + "789(double) should not be equal to '789' (string)"), + new DoubleTestData( + (0.0d), + (-0.0d), + true, + "0.0d should be equal to -0.0d") + }; + // Floating point numbers should not be tested for equality + // intended as this is a unit test +#pragma warning disable S1244 + foreach (var test in testData) { if (test.Value is double d2) { - Assert.AreEqual(test.Expected, test.D1.Equals(d2)); + Assert.AreEqual( + test.Expected, + test.D1.Equals(d2), + test.AssertMessage); if (double.IsNaN((double)test.D1) && double.IsNaN(d2)) { - Assert.AreEqual(!test.Expected, (double)test.D1 == d2); - Assert.AreEqual(test.Expected, (double)test.D1 != d2); + Assert.AreEqual( + !test.Expected, + (double)test.D1 == d2); + Assert.AreEqual( + test.Expected, + (double)test.D1 != d2); } else { - Assert.AreEqual(test.Expected, (double)test.D1 == d2); - Assert.AreEqual(!test.Expected, (double)test.D1 != d2); + Assert.AreEqual( + test.Expected, + (double)test.D1 == d2); + Assert.AreEqual( + !test.Expected, + (double)test.D1 != d2); } - Assert.AreEqual(test.Expected, test.D1.GetHashCode().Equals(d2.GetHashCode())); + Assert.AreEqual( + test.Expected, + test.D1.GetHashCode().Equals(d2.GetHashCode())); } if (test.Expected) @@ -104,6 +162,9 @@ public void Equals() Assert.IsFalse(test.D1.Equals(test.Value)); } } + +#pragma warning restore S1244 + } private sealed class DoubleTestData @@ -111,12 +172,18 @@ private sealed class DoubleTestData public object D1 { get; } public object Value { get; } public bool Expected { get; } + public string AssertMessage { get; } - public DoubleTestData(object d1, object value, bool expected) + public DoubleTestData( + object d1, + object value, + bool expected, + string assertMessage = "") { D1 = d1; Value = value; Expected = expected; + AssertMessage = assertMessage; } } } diff --git a/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs b/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs index 54b56ec2..5ca1b402 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestReflectionMemberTest.cs @@ -24,9 +24,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsFalse(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsFalse(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(object)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(object)); Assert.IsTrue(mi.Invoke(tst, new object[] { 3 }) == null); - Assert.IsType(mi.DeclaringType, typeof(AbsTestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(AbsTestClass)); mi = typeof(AbsTestClass).GetMethod("AbstractPublicMethod", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Assert.IsTrue(mi.IsAbstract); @@ -34,9 +34,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsTrue(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsTrue(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(float)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(float)); Assert.IsTrue((float)mi.Invoke(tst, new object[] { 3 }) == 38.4f); - Assert.IsType(mi.DeclaringType, typeof(AbsTestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(AbsTestClass)); mi = typeof(TestClass).GetMethod("VirtualInternalMethod", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Assert.IsFalse(mi.IsAbstract); @@ -44,9 +44,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsFalse(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsTrue(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(int)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(int)); Assert.IsTrue((int)mi.Invoke(tst, new object[] { true }) == 34); - Assert.IsType(mi.DeclaringType, typeof(TestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(TestClass)); mi = typeof(TestClass).GetMethod("SealedPublicMethod", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Assert.IsFalse(mi.IsAbstract); @@ -54,9 +54,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsTrue(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsTrue(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(bool)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(bool)); Assert.IsTrue((bool)mi.Invoke(tst, new object[] { })); - Assert.IsType(mi.DeclaringType, typeof(TestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(TestClass)); mi = typeof(TestClass).GetMethod("StaticPrivateAbsMethod", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); Assert.IsFalse(mi.IsAbstract); @@ -64,11 +64,11 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsFalse(mi.IsPublic); Assert.IsTrue(mi.IsStatic); Assert.IsFalse(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(void)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(void)); TestClass.s_WasStaticMethodCalled = false; mi.Invoke(tst, new object[] { }); Assert.IsTrue(TestClass.s_WasStaticMethodCalled); - Assert.IsType(mi.DeclaringType, typeof(AbsTestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(AbsTestClass)); mi = typeof(TestClass).GetMethod("PublicMethod", BindingFlags.Instance | BindingFlags.Public); Assert.IsFalse(mi.IsAbstract); @@ -76,9 +76,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsTrue(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsTrue(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(void)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(void)); mi.Invoke(tst, new object[] { }); - Assert.IsType(mi.DeclaringType, typeof(TestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(TestClass)); mi = typeof(TestClass).GetMethod("InternalMethod", BindingFlags.Instance | BindingFlags.NonPublic); Assert.IsFalse(mi.IsAbstract); @@ -86,9 +86,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsFalse(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsFalse(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(int)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(int)); Assert.IsTrue(1 == (int)mi.Invoke(tst, new object[] { 90.3f })); - Assert.IsType(mi.DeclaringType, typeof(TestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(TestClass)); mi = typeof(TestClass).GetMethod("PrivateMethod", BindingFlags.Instance | BindingFlags.NonPublic); Assert.IsFalse(mi.IsAbstract); @@ -96,9 +96,9 @@ public void SystemReflectionMemberTests_Properties_Test0() Assert.IsFalse(mi.IsPublic); Assert.IsFalse(mi.IsStatic); Assert.IsFalse(mi.IsVirtual); - Assert.IsType(mi.ReturnType, typeof(float)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(float)); Assert.IsTrue(3.3f == (float)mi.Invoke(tst, new object[] { 92 })); - Assert.IsType(mi.DeclaringType, typeof(TestClass)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(TestClass)); } [TestMethod] @@ -117,9 +117,9 @@ public void SystemReflectionMemberTests_DelegateMethod_Test1() Assert.IsFalse(mi.IsAbstract); Assert.IsFalse(mi.IsFinal); Assert.AreEqual(mi.Name, "MyDelegateImpl"); - Assert.IsType(mi.ReturnType, typeof(bool)); + Assert.IsInstanceOfType(mi.ReturnType, typeof(bool)); Assert.IsTrue((bool)mi.Invoke(null, new object[] { 1, 3.3f })); - Assert.IsType(mi.DeclaringType, typeof(UnitTestReflectionMemberTest)); + Assert.IsInstanceOfType(mi.DeclaringType, typeof(UnitTestReflectionMemberTest)); } [TestMethod] @@ -138,7 +138,7 @@ public void SystemReflectionMemberTests_ConstructorInfo_Test2() ci = typeof(AbsTestClass).GetConstructor(new Type[] { typeof(float) }); Assert.IsFalse(ci.IsPublic); Assert.IsFalse(ci.IsStatic); - Assert.IsType(ci.DeclaringType, typeof(AbsTestClass)); + Assert.IsInstanceOfType(ci.DeclaringType, typeof(AbsTestClass)); AbsTestClass tst = ci.Invoke(new object[] { 1.2f }) as AbsTestClass; Assert.IsNotNull(tst); @@ -162,20 +162,20 @@ public void SystemReflectionMemberTests_FieldInfo_Test3() Type t = typeof(TestClass); FieldInfo fi = t.GetField("AbsPrivateField", BindingFlags.Instance | BindingFlags.NonPublic); - Assert.IsType(fi.FieldType, typeof(int)); - Assert.IsType(fi.DeclaringType, typeof(AbsTestClass)); + Assert.IsInstanceOfType(fi.FieldType, typeof(int)); + Assert.IsInstanceOfType(fi.DeclaringType, typeof(AbsTestClass)); fi = t.GetField("PublicField"); - Assert.IsType(fi.FieldType, typeof(int)); - Assert.IsType(fi.DeclaringType, typeof(TestClass)); + Assert.IsInstanceOfType(fi.FieldType, typeof(int)); + Assert.IsInstanceOfType(fi.DeclaringType, typeof(TestClass)); fi = t.GetField("IntProtectedField", BindingFlags.Instance | BindingFlags.NonPublic); - Assert.IsType(fi.FieldType, typeof(float)); - Assert.IsType(fi.DeclaringType, t); + Assert.IsInstanceOfType(fi.FieldType, typeof(float)); + Assert.IsInstanceOfType(fi.DeclaringType, t); fi = t.GetField("BoolPrivateField", BindingFlags.Static | BindingFlags.NonPublic); - Assert.IsType(fi.FieldType, typeof(bool)); - Assert.IsType(fi.DeclaringType, t); + Assert.IsInstanceOfType(fi.FieldType, typeof(bool)); + Assert.IsInstanceOfType(fi.DeclaringType, t); } diff --git a/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs b/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs index ad60549c..709f2122 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs @@ -17,27 +17,27 @@ class UnitTestReflectionTypeTest public void SystemReflectionType_ObjectGetType_Test0() { object o = (object)1; - Assert.IsType(o.GetType(), typeof(int)); + Assert.IsInstanceOfType(o.GetType(), typeof(int)); o = (object)typeof(Type); - Assert.IsType(o.GetType(), typeof(Type).GetType()); + Assert.IsInstanceOfType(o.GetType(), typeof(Type).GetType()); //o = AppDomain.CurrentDomain.GetAssemblies(); //fRes &= o.GetType() == typeof(Assembly[]); o = new TestClass(); - Assert.IsType(o.GetType(), typeof(TestClass)); + Assert.IsInstanceOfType(o.GetType(), typeof(TestClass)); o = new TestStruct(); - Assert.IsType(o.GetType(), typeof(TestStruct)); + Assert.IsInstanceOfType(o.GetType(), typeof(TestStruct)); o = new MyDelegate(MyDelegateImpl); - Assert.IsType(o.GetType(), typeof(MyDelegate)); + Assert.IsInstanceOfType(o.GetType(), typeof(MyDelegate)); o = (new MyDelegate(MyDelegateImpl)).Method; MethodInfo mi = typeof(UnitTestReflectionTypeTest).GetMethod("MyDelegateImpl", BindingFlags.Static | BindingFlags.NonPublic); - Assert.IsType(o.GetType(), mi.GetType()); + Assert.IsInstanceOfType(o.GetType(), mi.GetType()); } @@ -60,7 +60,7 @@ public void SystemReflectionType_RuntimeType_Test1() Assert.AreEqual(asm.GetName().Name, "NFUnitTest"); Assert.AreEqual(t.Name, "TestClass"); Assert.AreEqual(t.FullName, "NFUnitTestSystemLib.UnitTestReflectionTypeTest+TestClass"); - Assert.IsType(t.BaseType, typeof(object)); + Assert.IsInstanceOfType(t.BaseType, typeof(object)); Assert.IsNull(t.GetElementType()); MethodInfo[] mis = t.GetMethods(); @@ -94,7 +94,7 @@ public void SystemReflectionType_RuntimeType_Test1() Assert.AreEqual(asm.GetName().Name, "NFUnitTest"); Assert.AreEqual(t.Name, "TestStruct"); Assert.AreEqual(t.FullName, "NFUnitTestSystemLib.UnitTestReflectionTypeTest+TestStruct"); - Assert.IsType(t.BaseType, typeof(ValueType)); + Assert.IsInstanceOfType(t.BaseType, typeof(ValueType)); Assert.AreEqual(t.GetInterfaces().Length, 0); Assert.IsNull(t.GetElementType()); i++; @@ -108,7 +108,7 @@ public void SystemReflectionType_RuntimeType_Test1() //Assert.AreEqual(asm.GetName().Name, "mscorlib"); //Assert.AreEqual(t.Name, "Assembly"); //Assert.AreEqual(t.FullName, "System.Reflection.Assembly"); - //Assert.IsType(t.BaseType, typeof(Object)); + //Assert.IsInstanceOfType(t.BaseType, typeof(Object)); //Assert.AreEqual(t.GetInterfaces().Length, 0); //Assert.IsNull(t.GetElementType()); @@ -116,7 +116,7 @@ public void SystemReflectionType_RuntimeType_Test1() t = mis.GetType(); Assert.AreEqual(t.Name, "RuntimeMethodInfo[]"); Assert.AreEqual(t.FullName, "System.Reflection.RuntimeMethodInfo[]"); - Assert.IsType(t.BaseType, typeof(Array)); + Assert.IsInstanceOfType(t.BaseType, typeof(Array)); Assert.IsTrue(t.GetInterfaces().Length > 0); Assert.AreEqual(t.GetElementType().Name, "RuntimeMethodInfo"); @@ -125,12 +125,12 @@ public void SystemReflectionType_RuntimeType_Test1() t = del.GetType(); Assert.IsNotNull(t.DeclaringType); Assert.AreEqual(t.Name, "MyDelegate"); - Assert.IsType(t.BaseType, typeof(MulticastDelegate)); + Assert.IsInstanceOfType(t.BaseType, typeof(MulticastDelegate)); // test Type members for an enum TestEnum en = TestEnum.Item1; t = en.GetType(); - Assert.IsType(t.DeclaringType, typeof(UnitTestReflectionTypeTest)); + Assert.IsInstanceOfType(t.DeclaringType, typeof(UnitTestReflectionTypeTest)); Assert.IsTrue(t.IsEnum); Assert.IsFalse(t.IsAbstract); Assert.IsFalse(t.IsClass); diff --git a/Tests/NFUnitTestSystemLib/UnitTestSingle.cs b/Tests/NFUnitTestSystemLib/UnitTestSingle.cs index 6d9eea6f..5b090093 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestSingle.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestSingle.cs @@ -43,35 +43,111 @@ public void Epsilon() Assert.AreEqual((float)1.4e-45, float.Epsilon); } + [TestMethod] + public void NaN() + { + // Identical expressions should not be used on both sides of operators + // on purpose to test the NaN value +#pragma warning disable S1764 + Assert.IsTrue(float.NaN.Equals(0.0f / 0.0f)); + Assert.IsTrue(float.IsNaN(0.0f / 0.0f)); +#pragma warning restore S1764 // Identical expressions should not be used on both sides of operators + } + + [TestMethod] + public void NegativeInfinity() + { + Assert.AreEqual(-1.0f / 0.0f, float.NegativeInfinity); + Assert.IsTrue(float.IsNegativeInfinity(-1.0f / 0.0f)); + } + + [TestMethod] + public void PositiveInfinity() + { + Assert.AreEqual(1.0f / 0.0f, float.PositiveInfinity); + Assert.IsTrue(float.IsPositiveInfinity(1.0f / 0.0f)); + } + [TestMethod] public void Equals() { SingleTestData[] testData = new SingleTestData[] { - new SingleTestData((float)789, (float)789, true), - new SingleTestData((float)789, (float)-789, false), - new SingleTestData((float)789, (float)0, false), - new SingleTestData((float)float.NaN, float.NaN, true), - new SingleTestData((float)float.NaN, -float.NaN, true), - new SingleTestData((float)789, (double)789, false), - new SingleTestData((float)789, "789", false), + new SingleTestData( + (float)789, + (float)789, + true, + "789 should be equal to 789"), + new SingleTestData( + (float)789, + (float)-789, + false, + "789 should not be equal to -789"), + new SingleTestData( + (float)789, + (float)0, + false, + "789 should not be equal to 0"), + new SingleTestData( + float.NaN, + float.NaN, + true, + "NaN should be equal to NaN"), + new SingleTestData( + float.NaN, + -float.NaN, + true, + "NaN should be equal to -NaN"), + new SingleTestData( + (float)789, + (double)789, + false, + "789(float) should not be equal to 789(double)"), + new SingleTestData( + (float)789, + "789", + false, + "789(float) should not be equal to '789' (string)"), + new SingleTestData( + (0.0F), + (-0.0F), + true, + "0.0F should be equal to -0.0F") }; + // Floating point numbers should not be tested for equality + // intended as this is a unit test +#pragma warning disable S1244 + + foreach (var test in testData) { if (test.Value is float f2) { - Assert.AreEqual(test.Expected, test.F1.Equals(f2)); + Assert.AreEqual( + test.Expected, + test.F1.Equals(f2), + test.AssertMessage); if (float.IsNaN((float)test.F1) && float.IsNaN(f2)) { - Assert.AreEqual(!test.Expected, (float)test.F1 == f2); - Assert.AreEqual(test.Expected, (float)test.F1 != f2); + Assert.AreEqual( + !test.Expected, + (float)test.F1 == f2); + + Assert.AreEqual( + test.Expected, + (float)test.F1 != f2); } else { - Assert.AreEqual(test.Expected, (float)test.F1 == f2); - Assert.AreEqual(!test.Expected, (float)test.F1 != f2); + Assert.AreEqual( + test.Expected, + (float)test.F1 == f2); + + Assert.AreEqual( + !test.Expected, + (float)test.F1 != f2); } Assert.AreEqual(test.Expected, test.F1.GetHashCode().Equals(f2.GetHashCode())); @@ -79,6 +155,9 @@ public void Equals() Assert.AreEqual(test.Expected, test.F1.Equals(test.Value)); } + +#pragma warning restore S1244 + } private sealed class SingleTestData @@ -86,12 +165,18 @@ private sealed class SingleTestData public object F1 { get; } public object Value { get; } public bool Expected { get; } + public string AssertMessage { get; } - public SingleTestData(object f1, object value, bool expected) + public SingleTestData( + object f1, + object value, + bool expected, + string assertMessage = "") { F1 = f1; Value = value; Expected = expected; + AssertMessage = assertMessage; } } } diff --git a/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs b/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs index 99472af7..25282ebe 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestTimeSpan.cs @@ -145,12 +145,22 @@ public void CtorHelper(int[] vals) Int64 i64 = 0; string str = ""; + if (vals.Length == 3) + { str = "0 : "; + } + for (int i = 0; i < vals.Length; i++) + { str += vals[i].ToString() + " : "; + } + for (int i = vals.Length; i < 5; i++) + { str += "0 : "; + } + OutputHelper.WriteLine(str); switch (vals.Length) @@ -380,7 +390,6 @@ public void ToString_Test7() Random random = new Random(); for (int i = 0; i < 5; i++) { - bool b = true; int hours = random.Next(23); int minutes = random.Next(59); int seconds = random.Next(59); diff --git a/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs b/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs index 90f09b2f..cfefc29b 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs @@ -190,30 +190,30 @@ public void SystemType1_GetTypeNew_Test() // This tests the Assembly.GetType(String) by passing \"Namespace.Class\" Type myType0 = Int32Assm.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType0.FullName); - Assert.IsType(myType0, testInt32.GetType()); + Assert.IsInstanceOfType(myType0, testInt32.GetType()); // This tests the Type.GetType(String) by passing \"Namespace.Class\" Type myType1 = Type.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType1.FullName); - Assert.IsType(myType1, testInt32.GetType()); + Assert.IsInstanceOfType(myType1, testInt32.GetType()); // This tests the Type.GetType(String) by passing \"Namespace.Class, assembly\" Type myType2 = Type.GetType("System.Int32, mscorlib"); OutputHelper.WriteLine("The full name is " + myType2.FullName); - Assert.IsType(myType2, testInt32.GetType()); + Assert.IsInstanceOfType(myType2, testInt32.GetType()); // This tests the Type.GetType(String) by passing \"Namespace.Class, assembly, Version=\"a.b.c.d\"\" string typeName3 = "System.Int32, mscorlib, Version=" + Int32Assm.GetName().Version.ToString(); Type myType3 = Type.GetType(typeName3); OutputHelper.WriteLine("The full name is " + myType3.FullName); - Assert.IsType(myType3, testInt32.GetType()); + Assert.IsInstanceOfType(myType3, testInt32.GetType()); // This tests the Type.GetType() method for nested classes TestObject1 testTestObject1 = new TestObject1(); Type myType4 = testTestObject1.GetType(); OutputHelper.WriteLine("The full name is " + myType4.FullName); - Assert.IsType(myType4, Type.GetType("NFUnitTestSystemLib.UnitTestTypeTests+TestObject1")); + Assert.IsInstanceOfType(myType4, Type.GetType("NFUnitTestSystemLib.UnitTestTypeTests+TestObject1")); // Since NoneSuch does not exist in this assembly, @@ -234,7 +234,7 @@ public void SystemType1_Type_Names_Test() Type myType0 = Int32Assm.GetType("System.Int32"); Type myType1 = Type.GetType("System.Int32"); - Assert.IsType(myType0, myType1); + Assert.IsInstanceOfType(myType0, myType1); // names must be compatible and composable Assert.AreEqual(myType0.Name, myType1.Name); @@ -283,12 +283,12 @@ public void SystemType3_BaseType_Test() testInt32++; Type myType1 = Type.GetType("System.Int32"); OutputHelper.WriteLine("The full name is " + myType1.FullName); - Assert.IsType(myType1.BaseType, Type.GetType("System.ValueType")); + Assert.IsInstanceOfType(myType1.BaseType, Type.GetType("System.ValueType")); TestObject1 testTestObject1 = new TestObject1(); Type myType2 = testTestObject1.GetType(); OutputHelper.WriteLine("The full name is " + myType2.FullName); - Assert.IsType(myType2.BaseType, Type.GetType("System.Object")); + Assert.IsInstanceOfType(myType2.BaseType, Type.GetType("System.Object")); } [TestMethod] @@ -309,7 +309,7 @@ public void SystemType4_DeclaringType_Test() //Type myType2 = testTestObject1.GetType(); //OutputHelper.WriteLine("The full name is " + myType2.FullName); //Type myType3 = this.GetType(); - //Assert.IsType(myType2.DeclaringType , myType3); + //Assert.IsInstanceOfType(myType2.DeclaringType , myType3); } [TestMethod] @@ -339,7 +339,7 @@ public void SystemType6_GetElementType_Test() OutputHelper.WriteLine("The full name is " + myType1.FullName); int[] int32Arr = new int[] { }; Type int32ArrType = int32Arr.GetType(); - Assert.IsType(myType1, int32ArrType.GetElementType()); + Assert.IsInstanceOfType(myType1, int32ArrType.GetElementType()); Assert.IsTrue(myType1.GetElementType() == null); } @@ -361,7 +361,7 @@ public void SystemType7_GetField_Test() OutputHelper.WriteLine("The full name is " + myType2.FullName); // Check that type of m_data is Int32 - Assert.IsType(myType2.GetField("m_data", BindingFlags.GetField | + Assert.IsInstanceOfType(myType2.GetField("m_data", BindingFlags.GetField | BindingFlags.Public | BindingFlags.Instance).FieldType, myType1); // Check that value in m_data is 5 ( becuase we called new TestObject2(5)) @@ -408,7 +408,7 @@ public void SystemType8_GetFields_Test() TestObject2 testTestObject2 = new TestObject2(5); Type myType2 = testTestObject2.GetType(); OutputHelper.WriteLine("The full name is " + myType2.FullName); - Assert.IsType(myType2.GetField("m_data").FieldType, myType1); + Assert.IsInstanceOfType(myType2.GetField("m_data").FieldType, myType1); Assert.AreEqual((int)myType2.GetField("m_data").GetValue(testTestObject2), 5); Assert.IsTrue(myType2.GetField("m_data").MemberType == MemberTypes.Field); Assert.AreEqual(myType2.GetField("m_data").Name, "m_data"); @@ -431,7 +431,7 @@ public void SystemType9_GetInterfaces_Test() OutputHelper.WriteLine("The full name is " + myType2.FullName); Type myType3 = Type.GetType("NFUnitTestSystemLib.UnitTestTypeTests+iEmpty"); - Assert.IsType(myType2.GetInterfaces()[0], myType3); + Assert.IsInstanceOfType(myType2.GetInterfaces()[0], myType3); } [TestMethod] @@ -454,8 +454,8 @@ public void SystemType10_GetMethod_Test() Assert.AreEqual(methodInfo1.IsVirtual, false); Assert.IsTrue(methodInfo1.MemberType == MemberTypes.Method); Assert.AreEqual(methodInfo1.Name, "Method2"); - Assert.IsType(methodInfo1.ReturnType, I.GetType()); - Assert.IsType(methodInfo1.DeclaringType, myType2); + Assert.IsInstanceOfType(methodInfo1.ReturnType, I.GetType()); + Assert.IsInstanceOfType(methodInfo1.DeclaringType, myType2); Assert.AreEqual((int)(methodInfo1.Invoke(testTestObject2, new object[] { 1 })), 1); } @@ -492,8 +492,8 @@ public void SystemType11_GetMethods_Test() Assert.AreEqual(methodInfo1.IsVirtual, false); Assert.IsTrue(methodInfo1.MemberType == MemberTypes.Method); Assert.AreEqual(methodInfo1.Name, "Method2"); - Assert.IsType(methodInfo1.ReturnType, I.GetType()); - Assert.IsType(methodInfo1.DeclaringType, myType2); + Assert.IsInstanceOfType(methodInfo1.ReturnType, I.GetType()); + Assert.IsInstanceOfType(methodInfo1.DeclaringType, myType2); Assert.AreEqual((int)(methodInfo1.Invoke(testTestObject2, new object[] { 1 })), 1); } diff --git a/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs b/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs index b4e464f1..a8dfcdd5 100644 --- a/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestObjectTypeTests.cs @@ -14,7 +14,9 @@ public void TestCtor() // Test of Object constructor object o = new(); +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Assert.IsNotNull(o, "failed to create an Object"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } [TestMethod] @@ -25,6 +27,11 @@ public void TestEquals_01() object objectX = new(); object objectY = new(); + // Caller information arguments should not be provided explicitly + // Identical expressions should not be used on both sides of operators + // on purpose to test the Equals overload +#pragma warning disable S3236 +#pragma warning disable S1764 Assert.IsTrue(objectX.Equals(objectX), "Object should equal itself"); Assert.IsTrue(!objectX.Equals(null), "object should not equal null"); Assert.IsTrue(!objectX.Equals(objectY), "Different objects should not equal 1"); @@ -33,6 +40,8 @@ public void TestEquals_01() double doubleX = double.NaN; double doubleY = double.NaN; Assert.IsTrue(((object)doubleX).Equals(doubleY), "NaNs should always equal each other"); +#pragma warning restore S1764 // Identical expressions should not be used on both sides of operators +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } [TestMethod] @@ -43,17 +52,26 @@ public void TestEquals_02() object objectX = new(); object objectY = new(); + // Caller information arguments should not be provided explicitly + // Identical expressions should not be used on both sides of operators + // on purpose to test the Equals overload +#pragma warning disable S3236 +#pragma warning disable S1764 Assert.IsTrue(Equals(objectX, objectX), "Object should equal itself"); Assert.IsTrue(!Equals(objectX, null), "object should not equal null"); Assert.IsTrue(!Equals(null, objectX), "null should not equal object"); Assert.IsTrue(!Equals(objectX, objectY), "Different objects should not equal 1"); Assert.IsTrue(!Equals(objectY, objectX), "Different objects should not equal 2"); Assert.IsTrue(Equals(null, null), "null should equal null"); +#pragma warning restore S1764 // Identical expressions should not be used on both sides of operators +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly double doubleX = double.NaN; double doubleY = double.NaN; +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Assert.IsTrue(Equals(doubleX, doubleY), "NaNs should always equal each other"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } [TestMethod] @@ -62,7 +80,9 @@ public void TestGetHashCode() // Test Object HashCode object objectX = new(); +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Assert.AreEqual(objectX.GetHashCode(), objectX.GetHashCode(), "Object's hash code should not change"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } [TestMethod] @@ -72,8 +92,12 @@ public void TestGetType() object objectX = new(); +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Assert.IsNotNull(objectX.GetType(), "Should get a type for Object"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Assert.AreEqual(objectX.GetType().ToString(), "System.Object", "Wrong ToString from Object type"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } [TestMethod] @@ -84,12 +108,16 @@ public void TestReferenceEquals() object objectX = new(); object objectY = new(); + // Caller information arguments should not be provided explicitly + // on purpose to test the ReferenceEquals overload +#pragma warning disable S3236 Assert.IsTrue(ReferenceEquals(objectX, objectX), "Object should equal itself"); Assert.IsTrue(!ReferenceEquals(objectX, null), "object should not equal null"); Assert.IsTrue(!ReferenceEquals(null, objectX), "null should not equal object"); Assert.IsTrue(!ReferenceEquals(objectX, objectY), "Different objects should not equal 1"); Assert.IsTrue(!ReferenceEquals(objectY, objectX), "Different objects should not equal 2"); Assert.IsTrue(ReferenceEquals(null, null), "null should not equal null"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } [TestMethod] @@ -100,7 +128,9 @@ public void TestToString() object objectX = new(); object objectY = new(); +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Assert.AreEqual(objectX.ToString(), objectY.ToString(), "All Objects should have same string representation"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly } } } diff --git a/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs b/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs index f1d16d23..39ee4993 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -112,7 +112,7 @@ public static void testMethod() { byte[] b = { 0 }; Type compareType = Type.GetType("System.Byte[]"); - Assert.IsType(compareType, b, $"The type {compareType.Name} is not equal to {b.GetType().Name}"); + Assert.IsInstanceOfType(b, compareType, $"The type {compareType.Name} is not equal to {b.GetType().Name}"); } } public class ValueArrayTestClass02 @@ -120,7 +120,7 @@ public class ValueArrayTestClass02 public static void testMethod() { char[] c = { 'a' }; - Assert.IsType(Type.GetType("System.Char[]"), c); + Assert.IsInstanceOfType(c, Type.GetType("System.Char[]")); } } public class ValueArrayTestClass03 @@ -128,7 +128,7 @@ public class ValueArrayTestClass03 public static void testMethod() { short[] s = { 0 }; - Assert.IsType(Type.GetType("System.Int16[]"), s); + Assert.IsInstanceOfType(s, Type.GetType("System.Int16[]")); } } public class ValueArrayTestClass04 @@ -136,7 +136,7 @@ public class ValueArrayTestClass04 public static void testMethod() { int[] i = { 0 }; - Assert.IsType(Type.GetType("System.Int32[]"), i); + Assert.IsInstanceOfType(i, Type.GetType("System.Int32[]")); } } public class ValueArrayTestClass05 @@ -144,7 +144,7 @@ public class ValueArrayTestClass05 public static void testMethod() { long[] l = { 0L }; - Assert.IsType(Type.GetType("System.Int64[]"), l); + Assert.IsInstanceOfType(l, Type.GetType("System.Int64[]")); } } public class ValueArrayTestClass06 @@ -152,7 +152,7 @@ public class ValueArrayTestClass06 public static void testMethod() { float[] f = { 0.0f }; - Assert.IsType(Type.GetType("System.Single[]"), f); + Assert.IsInstanceOfType(f, Type.GetType("System.Single[]")); } } public class ValueArrayTestClass07 @@ -160,7 +160,7 @@ public class ValueArrayTestClass07 public static void testMethod() { double[] d = { 0.0d }; - Assert.IsType(Type.GetType("System.Double[]"), d); + Assert.IsInstanceOfType(d, Type.GetType("System.Double[]")); } } public class ValueArrayTestClass09 @@ -168,7 +168,7 @@ public class ValueArrayTestClass09 public static void testMethod() { bool[] b = { true }; - Assert.IsType(Type.GetType("System.Boolean[]"), b); + Assert.IsInstanceOfType(b, Type.GetType("System.Boolean[]")); } } @@ -177,7 +177,7 @@ public class ValueArrayTestClass12 public static void testMethod() { string[] strArray = { "string" }; - Assert.IsType(Type.GetType("System.String[]"), strArray); + Assert.IsInstanceOfType(strArray, Type.GetType("System.String[]")); } } public class ValueArrayTestClass13 @@ -185,7 +185,7 @@ public class ValueArrayTestClass13 public static void testMethod() { sbyte[] sb = { 0 }; - Assert.IsType(Type.GetType("System.SByte[]"), sb); + Assert.IsInstanceOfType(sb, Type.GetType("System.SByte[]")); } } public class ValueArrayTestClass14 @@ -193,7 +193,7 @@ public class ValueArrayTestClass14 public static void testMethod() { ushort[] us = { 0 }; - Assert.IsType(Type.GetType("System.UInt16[]"), us); + Assert.IsInstanceOfType(us, Type.GetType("System.UInt16[]")); } } public class ValueArrayTestClass15 @@ -201,8 +201,9 @@ public class ValueArrayTestClass15 public static void testMethod() { uint[] ui = { 0 }; - Assert.IsType(Type.GetType("System.UInt32[]"), ui); + Assert.IsInstanceOfType(ui, Type.GetType("System.UInt32[]")); } } + } } diff --git a/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs b/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs index 5c9cdd91..4e5e721c 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueFloatTests.cs @@ -211,16 +211,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 + s1).GetType(), f1.GetType()); - Assert.IsType((s1 + f1).GetType(), f1.GetType()); - Assert.IsType((f1 + b1).GetType(), f1.GetType()); - Assert.IsType((b1 + f1).GetType(), f1.GetType()); - Assert.IsType((f1 + i1).GetType(), f1.GetType()); - Assert.IsType((i1 + f1).GetType(), f1.GetType()); - Assert.IsType((f1 + l1).GetType(), f1.GetType()); - Assert.IsType((l1 + f1).GetType(), f1.GetType()); - Assert.IsType((f1 + c1).GetType(), f1.GetType()); - Assert.IsType((c1 + f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 + s1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((s1 + f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 + b1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((b1 + f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 + i1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((i1 + f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 + l1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((l1 + f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 + c1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((c1 + f1).GetType(), f1.GetType()); } } public class ValueFloatTestClass05 @@ -234,16 +234,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 + s1).GetType(), d1.GetType()); - Assert.IsType((s1 + d1).GetType(), d1.GetType()); - Assert.IsType((d1 + b1).GetType(), d1.GetType()); - Assert.IsType((b1 + d1).GetType(), d1.GetType()); - Assert.IsType((d1 + i1).GetType(), d1.GetType()); - Assert.IsType((i1 + d1).GetType(), d1.GetType()); - Assert.IsType((d1 + l1).GetType(), d1.GetType()); - Assert.IsType((l1 + d1).GetType(), d1.GetType()); - Assert.IsType((d1 + c1).GetType(), d1.GetType()); - Assert.IsType((c1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + s1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((s1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + b1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((b1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + i1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((i1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + l1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((l1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + c1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((c1 + d1).GetType(), d1.GetType()); } } public class ValueFloatTestClass06 @@ -257,16 +257,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 - s1).GetType(), f1.GetType()); - Assert.IsType((s1 - f1).GetType(), f1.GetType()); - Assert.IsType((f1 - b1).GetType(), f1.GetType()); - Assert.IsType((b1 - f1).GetType(), f1.GetType()); - Assert.IsType((f1 - i1).GetType(), f1.GetType()); - Assert.IsType((i1 - f1).GetType(), f1.GetType()); - Assert.IsType((f1 - l1).GetType(), f1.GetType()); - Assert.IsType((l1 - f1).GetType(), f1.GetType()); - Assert.IsType((f1 - c1).GetType(), f1.GetType()); - Assert.IsType((c1 - f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 - s1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((s1 - f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 - b1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((b1 - f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 - i1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((i1 - f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 - l1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((l1 - f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 - c1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((c1 - f1).GetType(), f1.GetType()); } } public class ValueFloatTestClass07 @@ -280,16 +280,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 - s1).GetType(), d1.GetType()); - Assert.IsType((s1 - d1).GetType(), d1.GetType()); - Assert.IsType((d1 - b1).GetType(), d1.GetType()); - Assert.IsType((b1 - d1).GetType(), d1.GetType()); - Assert.IsType((d1 - i1).GetType(), d1.GetType()); - Assert.IsType((i1 - d1).GetType(), d1.GetType()); - Assert.IsType((d1 - l1).GetType(), d1.GetType()); - Assert.IsType((l1 - d1).GetType(), d1.GetType()); - Assert.IsType((d1 - c1).GetType(), d1.GetType()); - Assert.IsType((c1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - s1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((s1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - b1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((b1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - i1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((i1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - l1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((l1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - c1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((c1 - d1).GetType(), d1.GetType()); } } public class ValueFloatTestClass08 @@ -303,16 +303,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 * s1).GetType(), f1.GetType()); - Assert.IsType((s1 * f1).GetType(), f1.GetType()); - Assert.IsType((f1 * b1).GetType(), f1.GetType()); - Assert.IsType((b1 * f1).GetType(), f1.GetType()); - Assert.IsType((f1 * i1).GetType(), f1.GetType()); - Assert.IsType((i1 * f1).GetType(), f1.GetType()); - Assert.IsType((f1 * l1).GetType(), f1.GetType()); - Assert.IsType((l1 * f1).GetType(), f1.GetType()); - Assert.IsType((f1 * c1).GetType(), f1.GetType()); - Assert.IsType((c1 * f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 * s1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((s1 * f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 * b1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((b1 * f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 * i1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((i1 * f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 * l1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((l1 * f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 * c1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((c1 * f1).GetType(), f1.GetType()); } } public class ValueFloatTestClass09 @@ -326,16 +326,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 * s1).GetType(), d1.GetType()); - Assert.IsType((s1 * d1).GetType(), d1.GetType()); - Assert.IsType((d1 * b1).GetType(), d1.GetType()); - Assert.IsType((b1 * d1).GetType(), d1.GetType()); - Assert.IsType((d1 * i1).GetType(), d1.GetType()); - Assert.IsType((i1 * d1).GetType(), d1.GetType()); - Assert.IsType((d1 * l1).GetType(), d1.GetType()); - Assert.IsType((l1 * d1).GetType(), d1.GetType()); - Assert.IsType((d1 * c1).GetType(), d1.GetType()); - Assert.IsType((c1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * s1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((s1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * b1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((b1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * i1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((i1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * l1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((l1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * c1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((c1 * d1).GetType(), d1.GetType()); } } public class ValueFloatTestClass10 @@ -349,16 +349,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 / s1).GetType(), f1.GetType()); - Assert.IsType((s1 / f1).GetType(), f1.GetType()); - Assert.IsType((f1 / b1).GetType(), f1.GetType()); - Assert.IsType((b1 / f1).GetType(), f1.GetType()); - Assert.IsType((f1 / i1).GetType(), f1.GetType()); - Assert.IsType((i1 / f1).GetType(), f1.GetType()); - Assert.IsType((f1 / l1).GetType(), f1.GetType()); - Assert.IsType((l1 / f1).GetType(), f1.GetType()); - Assert.IsType((f1 / c1).GetType(), f1.GetType()); - Assert.IsType((c1 / f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 / s1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((s1 / f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 / b1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((b1 / f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 / i1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((i1 / f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 / l1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((l1 / f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 / c1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((c1 / f1).GetType(), f1.GetType()); } } public class ValueFloatTestClass11 @@ -372,16 +372,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 / s1).GetType(), d1.GetType()); - Assert.IsType((s1 / d1).GetType(), d1.GetType()); - Assert.IsType((d1 / b1).GetType(), d1.GetType()); - Assert.IsType((b1 / d1).GetType(), d1.GetType()); - Assert.IsType((d1 / i1).GetType(), d1.GetType()); - Assert.IsType((i1 / d1).GetType(), d1.GetType()); - Assert.IsType((d1 / l1).GetType(), d1.GetType()); - Assert.IsType((l1 / d1).GetType(), d1.GetType()); - Assert.IsType((d1 / c1).GetType(), d1.GetType()); - Assert.IsType((c1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / s1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((s1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / b1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((b1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / i1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((i1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / l1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((l1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / c1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((c1 / d1).GetType(), d1.GetType()); } } public class ValueFloatTestClass12 @@ -395,16 +395,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 % s1).GetType(), f1.GetType()); - Assert.IsType((s1 % f1).GetType(), f1.GetType()); - Assert.IsType((f1 % b1).GetType(), f1.GetType()); - Assert.IsType((b1 % f1).GetType(), f1.GetType()); - Assert.IsType((f1 % i1).GetType(), f1.GetType()); - Assert.IsType((i1 % f1).GetType(), f1.GetType()); - Assert.IsType((f1 % l1).GetType(), f1.GetType()); - Assert.IsType((l1 % f1).GetType(), f1.GetType()); - Assert.IsType((f1 % c1).GetType(), f1.GetType()); - Assert.IsType((c1 % f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 % s1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((s1 % f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 % b1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((b1 % f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 % i1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((i1 % f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 % l1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((l1 % f1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 % c1).GetType(), f1.GetType()); + Assert.IsInstanceOfType((c1 % f1).GetType(), f1.GetType()); } } public class ValueFloatTestClass13 @@ -418,16 +418,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 % s1).GetType(), d1.GetType()); - Assert.IsType((s1 % d1).GetType(), d1.GetType()); - Assert.IsType((d1 % b1).GetType(), d1.GetType()); - Assert.IsType((b1 % d1).GetType(), d1.GetType()); - Assert.IsType((d1 % i1).GetType(), d1.GetType()); - Assert.IsType((i1 % d1).GetType(), d1.GetType()); - Assert.IsType((d1 % l1).GetType(), d1.GetType()); - Assert.IsType((l1 % d1).GetType(), d1.GetType()); - Assert.IsType((d1 % c1).GetType(), d1.GetType()); - Assert.IsType((c1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % s1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((s1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % b1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((b1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % i1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((i1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % l1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((l1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % c1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((c1 % d1).GetType(), d1.GetType()); } } public class ValueFloatTestClass14 @@ -442,16 +442,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 == s1).GetType(), b.GetType()); - Assert.IsType((s1 == f1).GetType(), b.GetType()); - Assert.IsType((f1 == b1).GetType(), b.GetType()); - Assert.IsType((b1 == f1).GetType(), b.GetType()); - Assert.IsType((f1 == i1).GetType(), b.GetType()); - Assert.IsType((i1 == f1).GetType(), b.GetType()); - Assert.IsType((f1 == l1).GetType(), b.GetType()); - Assert.IsType((l1 == f1).GetType(), b.GetType()); - Assert.IsType((f1 == c1).GetType(), b.GetType()); - Assert.IsType((c1 == f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 == f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 == f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 == f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 == f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 == f1).GetType(), b.GetType()); } } public class ValueFloatTestClass15 @@ -466,16 +466,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 == s1).GetType(), b.GetType()); - Assert.IsType((s1 == d1).GetType(), b.GetType()); - Assert.IsType((d1 == b1).GetType(), b.GetType()); - Assert.IsType((b1 == d1).GetType(), b.GetType()); - Assert.IsType((d1 == i1).GetType(), b.GetType()); - Assert.IsType((i1 == d1).GetType(), b.GetType()); - Assert.IsType((d1 == l1).GetType(), b.GetType()); - Assert.IsType((l1 == d1).GetType(), b.GetType()); - Assert.IsType((d1 == c1).GetType(), b.GetType()); - Assert.IsType((c1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 == d1).GetType(), b.GetType()); } } public class ValueFloatTestClass16 @@ -490,16 +490,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 != s1).GetType(), b.GetType()); - Assert.IsType((s1 != f1).GetType(), b.GetType()); - Assert.IsType((f1 != b1).GetType(), b.GetType()); - Assert.IsType((b1 != f1).GetType(), b.GetType()); - Assert.IsType((f1 != i1).GetType(), b.GetType()); - Assert.IsType((i1 != f1).GetType(), b.GetType()); - Assert.IsType((f1 != l1).GetType(), b.GetType()); - Assert.IsType((l1 != f1).GetType(), b.GetType()); - Assert.IsType((f1 != c1).GetType(), b.GetType()); - Assert.IsType((c1 != f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 != f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 != f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 != f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 != f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 != f1).GetType(), b.GetType()); } } public class ValueFloatTestClass17 @@ -514,16 +514,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 != s1).GetType(), b.GetType()); - Assert.IsType((s1 != d1).GetType(), b.GetType()); - Assert.IsType((d1 != b1).GetType(), b.GetType()); - Assert.IsType((b1 != d1).GetType(), b.GetType()); - Assert.IsType((d1 != i1).GetType(), b.GetType()); - Assert.IsType((i1 != d1).GetType(), b.GetType()); - Assert.IsType((d1 != l1).GetType(), b.GetType()); - Assert.IsType((l1 != d1).GetType(), b.GetType()); - Assert.IsType((d1 != c1).GetType(), b.GetType()); - Assert.IsType((c1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 != d1).GetType(), b.GetType()); } } public class ValueFloatTestClass18 @@ -538,16 +538,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 > s1).GetType(), b.GetType()); - Assert.IsType((s1 > f1).GetType(), b.GetType()); - Assert.IsType((f1 > b1).GetType(), b.GetType()); - Assert.IsType((b1 > f1).GetType(), b.GetType()); - Assert.IsType((f1 > i1).GetType(), b.GetType()); - Assert.IsType((i1 > f1).GetType(), b.GetType()); - Assert.IsType((f1 > l1).GetType(), b.GetType()); - Assert.IsType((l1 > f1).GetType(), b.GetType()); - Assert.IsType((f1 > c1).GetType(), b.GetType()); - Assert.IsType((c1 > f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 > f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 > f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 > f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 > f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 > f1).GetType(), b.GetType()); } } public class ValueFloatTestClass19 @@ -562,16 +562,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 > s1).GetType(), b.GetType()); - Assert.IsType((s1 > d1).GetType(), b.GetType()); - Assert.IsType((d1 > b1).GetType(), b.GetType()); - Assert.IsType((b1 > d1).GetType(), b.GetType()); - Assert.IsType((d1 > i1).GetType(), b.GetType()); - Assert.IsType((i1 > d1).GetType(), b.GetType()); - Assert.IsType((d1 > l1).GetType(), b.GetType()); - Assert.IsType((l1 > d1).GetType(), b.GetType()); - Assert.IsType((d1 > c1).GetType(), b.GetType()); - Assert.IsType((c1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 > d1).GetType(), b.GetType()); } } public class ValueFloatTestClass20 @@ -586,16 +586,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 < s1).GetType(), b.GetType()); - Assert.IsType((s1 < f1).GetType(), b.GetType()); - Assert.IsType((f1 < b1).GetType(), b.GetType()); - Assert.IsType((b1 < f1).GetType(), b.GetType()); - Assert.IsType((f1 < i1).GetType(), b.GetType()); - Assert.IsType((i1 < f1).GetType(), b.GetType()); - Assert.IsType((f1 < l1).GetType(), b.GetType()); - Assert.IsType((l1 < f1).GetType(), b.GetType()); - Assert.IsType((f1 < c1).GetType(), b.GetType()); - Assert.IsType((c1 < f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 < f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 < f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 < f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 < f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 < f1).GetType(), b.GetType()); } } public class ValueFloatTestClass21 @@ -610,16 +610,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 < s1).GetType(), b.GetType()); - Assert.IsType((s1 < d1).GetType(), b.GetType()); - Assert.IsType((d1 < b1).GetType(), b.GetType()); - Assert.IsType((b1 < d1).GetType(), b.GetType()); - Assert.IsType((d1 < i1).GetType(), b.GetType()); - Assert.IsType((i1 < d1).GetType(), b.GetType()); - Assert.IsType((d1 < l1).GetType(), b.GetType()); - Assert.IsType((l1 < d1).GetType(), b.GetType()); - Assert.IsType((d1 < c1).GetType(), b.GetType()); - Assert.IsType((c1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 < d1).GetType(), b.GetType()); } } public class ValueFloatTestClass22 @@ -634,16 +634,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 >= s1).GetType(), b.GetType()); - Assert.IsType((s1 >= f1).GetType(), b.GetType()); - Assert.IsType((f1 >= b1).GetType(), b.GetType()); - Assert.IsType((b1 >= f1).GetType(), b.GetType()); - Assert.IsType((f1 >= i1).GetType(), b.GetType()); - Assert.IsType((i1 >= f1).GetType(), b.GetType()); - Assert.IsType((f1 >= l1).GetType(), b.GetType()); - Assert.IsType((l1 >= f1).GetType(), b.GetType()); - Assert.IsType((f1 >= c1).GetType(), b.GetType()); - Assert.IsType((c1 >= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 >= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 >= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 >= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 >= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 >= f1).GetType(), b.GetType()); } } public class ValueFloatTestClass23 @@ -658,16 +658,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 >= s1).GetType(), b.GetType()); - Assert.IsType((s1 >= d1).GetType(), b.GetType()); - Assert.IsType((d1 >= b1).GetType(), b.GetType()); - Assert.IsType((b1 >= d1).GetType(), b.GetType()); - Assert.IsType((d1 >= i1).GetType(), b.GetType()); - Assert.IsType((i1 >= d1).GetType(), b.GetType()); - Assert.IsType((d1 >= l1).GetType(), b.GetType()); - Assert.IsType((l1 >= d1).GetType(), b.GetType()); - Assert.IsType((d1 >= c1).GetType(), b.GetType()); - Assert.IsType((c1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 >= d1).GetType(), b.GetType()); } } public class ValueFloatTestClass24 @@ -682,16 +682,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((f1 <= s1).GetType(), b.GetType()); - Assert.IsType((s1 <= f1).GetType(), b.GetType()); - Assert.IsType((f1 <= b1).GetType(), b.GetType()); - Assert.IsType((b1 <= f1).GetType(), b.GetType()); - Assert.IsType((f1 <= i1).GetType(), b.GetType()); - Assert.IsType((i1 <= f1).GetType(), b.GetType()); - Assert.IsType((f1 <= l1).GetType(), b.GetType()); - Assert.IsType((l1 <= f1).GetType(), b.GetType()); - Assert.IsType((f1 <= c1).GetType(), b.GetType()); - Assert.IsType((c1 <= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 <= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 <= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 <= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 <= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 <= f1).GetType(), b.GetType()); } } public class ValueFloatTestClass25 @@ -706,16 +706,16 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; - Assert.IsType((d1 <= s1).GetType(), b.GetType()); - Assert.IsType((s1 <= d1).GetType(), b.GetType()); - Assert.IsType((d1 <= b1).GetType(), b.GetType()); - Assert.IsType((b1 <= d1).GetType(), b.GetType()); - Assert.IsType((d1 <= i1).GetType(), b.GetType()); - Assert.IsType((i1 <= d1).GetType(), b.GetType()); - Assert.IsType((d1 <= l1).GetType(), b.GetType()); - Assert.IsType((l1 <= d1).GetType(), b.GetType()); - Assert.IsType((d1 <= c1).GetType(), b.GetType()); - Assert.IsType((c1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((c1 <= d1).GetType(), b.GetType()); } } public class ValueFloatTestClass26 @@ -725,21 +725,21 @@ public static void testMethod() double d1 = 11.0d; float f1 = 12.0f; - Assert.IsType((d1 + f1).GetType(), d1.GetType()); - Assert.IsType((f1 + d1).GetType(), d1.GetType()); - Assert.IsType((d1 + d1).GetType(), d1.GetType()); - Assert.IsType((d1 - f1).GetType(), d1.GetType()); - Assert.IsType((f1 - d1).GetType(), d1.GetType()); - Assert.IsType((d1 - d1).GetType(), d1.GetType()); - Assert.IsType((d1 * f1).GetType(), d1.GetType()); - Assert.IsType((f1 * d1).GetType(), d1.GetType()); - Assert.IsType((d1 * d1).GetType(), d1.GetType()); - Assert.IsType((d1 / f1).GetType(), d1.GetType()); - Assert.IsType((f1 / d1).GetType(), d1.GetType()); - Assert.IsType((d1 / d1).GetType(), d1.GetType()); - Assert.IsType((d1 % f1).GetType(), d1.GetType()); - Assert.IsType((f1 % d1).GetType(), d1.GetType()); - Assert.IsType((d1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + f1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((f1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 + d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - f1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((f1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 - d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * f1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((f1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 * d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / f1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((f1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 / d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % f1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((f1 % d1).GetType(), d1.GetType()); + Assert.IsInstanceOfType((d1 % d1).GetType(), d1.GetType()); } } public class ValueFloatTestClass27 @@ -749,24 +749,24 @@ public static void testMethod() double d1 = 11.0d; float f1 = 12.0f; bool b = false; - Assert.IsType((d1 == f1).GetType(), b.GetType()); - Assert.IsType((f1 == d1).GetType(), b.GetType()); - Assert.IsType((d1 == d1).GetType(), b.GetType()); - Assert.IsType((d1 != f1).GetType(), b.GetType()); - Assert.IsType((f1 != d1).GetType(), b.GetType()); - Assert.IsType((d1 != d1).GetType(), b.GetType()); - Assert.IsType((d1 > f1).GetType(), b.GetType()); - Assert.IsType((f1 > d1).GetType(), b.GetType()); - Assert.IsType((d1 > d1).GetType(), b.GetType()); - Assert.IsType((d1 < f1).GetType(), b.GetType()); - Assert.IsType((f1 < d1).GetType(), b.GetType()); - Assert.IsType((d1 < d1).GetType(), b.GetType()); - Assert.IsType((d1 >= f1).GetType(), b.GetType()); - Assert.IsType((f1 >= d1).GetType(), b.GetType()); - Assert.IsType((d1 >= d1).GetType(), b.GetType()); - Assert.IsType((d1 <= f1).GetType(), b.GetType()); - Assert.IsType((f1 <= d1).GetType(), b.GetType()); - Assert.IsType((d1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 == d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 != d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 > d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 < d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 >= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= f1).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= d1).GetType(), b.GetType()); + Assert.IsInstanceOfType((d1 <= d1).GetType(), b.GetType()); } } public class ValueFloatTestClass28 @@ -776,11 +776,11 @@ public static void testMethod() float f1 = 11.0f; float f2 = 12.0f; - Assert.IsType((f1 + f2).GetType(), f1.GetType()); - Assert.IsType((f1 - f2).GetType(), f1.GetType()); - Assert.IsType((f1 * f2).GetType(), f1.GetType()); - Assert.IsType((f1 / f2).GetType(), f1.GetType()); - Assert.IsType((f1 % f2).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 + f2).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 - f2).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 * f2).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 / f2).GetType(), f1.GetType()); + Assert.IsInstanceOfType((f1 % f2).GetType(), f1.GetType()); } } public class ValueFloatTestClass29 @@ -790,12 +790,12 @@ public static void testMethod() double f1 = 11.0d; float f2 = 12.0f; bool b = false; - Assert.IsType((f1 == f2).GetType(), b.GetType()); - Assert.IsType((f1 != f2).GetType(), b.GetType()); - Assert.IsType((f1 > f2).GetType(), b.GetType()); - Assert.IsType((f1 < f2).GetType(), b.GetType()); - Assert.IsType((f1 >= f2).GetType(), b.GetType()); - Assert.IsType((f1 <= f2).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 == f2).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 != f2).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 > f2).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 < f2).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 >= f2).GetType(), b.GetType()); + Assert.IsInstanceOfType((f1 <= f2).GetType(), b.GetType()); } } public class ValueFloatTestClass30 diff --git a/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs b/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs index e35203f5..0ed82aea 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueIntegralTests.cs @@ -517,25 +517,25 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 + s1).GetType(), i1.GetType()); - Assert.IsType((s1 + b1).GetType(), i1.GetType()); - Assert.IsType((s1 + i1).GetType(), i1.GetType()); - Assert.IsType((s1 + l1).GetType(), l1.GetType()); - Assert.IsType((s1 + c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 + s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 + b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 + i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 + c1).GetType(), i1.GetType()); //byte - Assert.IsType((b1 + b1).GetType(), i1.GetType()); - Assert.IsType((b1 + i1).GetType(), i1.GetType()); - Assert.IsType((b1 + l1).GetType(), l1.GetType()); - Assert.IsType((b1 + c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 + b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 + i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 + c1).GetType(), i1.GetType()); //int - Assert.IsType((i1 + i1).GetType(), i1.GetType()); - Assert.IsType((i1 + l1).GetType(), l1.GetType()); - Assert.IsType((i1 + c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 + i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 + c1).GetType(), i1.GetType()); //long - Assert.IsType((l1 + l1).GetType(), l1.GetType()); - Assert.IsType((l1 + c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 + c1).GetType(), l1.GetType()); //char - Assert.IsType((c1 + c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((c1 + c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass14 @@ -548,25 +548,25 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 - s1).GetType(), i1.GetType()); - Assert.IsType((s1 - b1).GetType(), i1.GetType()); - Assert.IsType((s1 - i1).GetType(), i1.GetType()); - Assert.IsType((s1 - l1).GetType(), l1.GetType()); - Assert.IsType((s1 - c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 - s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 - b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 - i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 - c1).GetType(), i1.GetType()); //byte - Assert.IsType((b1 - b1).GetType(), i1.GetType()); - Assert.IsType((b1 - i1).GetType(), i1.GetType()); - Assert.IsType((b1 - l1).GetType(), l1.GetType()); - Assert.IsType((b1 - c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 - b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 - i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 - c1).GetType(), i1.GetType()); //int - Assert.IsType((i1 - i1).GetType(), i1.GetType()); - Assert.IsType((i1 - l1).GetType(), l1.GetType()); - Assert.IsType((i1 - c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 - i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 - c1).GetType(), i1.GetType()); //long - Assert.IsType((l1 - l1).GetType(), l1.GetType()); - Assert.IsType((l1 - c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 - c1).GetType(), l1.GetType()); //char - Assert.IsType((c1 - c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((c1 - c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass15 @@ -579,25 +579,25 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 * s1).GetType(), i1.GetType()); - Assert.IsType((s1 * b1).GetType(), i1.GetType()); - Assert.IsType((s1 * i1).GetType(), i1.GetType()); - Assert.IsType((s1 * l1).GetType(), l1.GetType()); - Assert.IsType((s1 * c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 * s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 * b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 * i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 * c1).GetType(), i1.GetType()); //byte - Assert.IsType((b1 * b1).GetType(), i1.GetType()); - Assert.IsType((b1 * i1).GetType(), i1.GetType()); - Assert.IsType((b1 * l1).GetType(), l1.GetType()); - Assert.IsType((b1 * c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 * b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 * i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 * c1).GetType(), i1.GetType()); //int - Assert.IsType((i1 * i1).GetType(), i1.GetType()); - Assert.IsType((i1 * l1).GetType(), l1.GetType()); - Assert.IsType((i1 * c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 * i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 * c1).GetType(), i1.GetType()); //long - Assert.IsType((l1 * l1).GetType(), l1.GetType()); - Assert.IsType((l1 * c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 * c1).GetType(), l1.GetType()); //char - Assert.IsType((c1 * c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((c1 * c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass16 @@ -609,21 +609,21 @@ public static void testMethod() int i1 = 4; long l1 = 5L; char c1 = (char)6; - Assert.IsType((s1 / s1).GetType(), i1.GetType()); - Assert.IsType((s1 / b1).GetType(), i1.GetType()); - Assert.IsType((s1 / i1).GetType(), i1.GetType()); - Assert.IsType((s1 / l1).GetType(), l1.GetType()); - Assert.IsType((s1 / c1).GetType(), i1.GetType()); - Assert.IsType((b1 / b1).GetType(), i1.GetType()); - Assert.IsType((b1 / i1).GetType(), i1.GetType()); - Assert.IsType((b1 / l1).GetType(), l1.GetType()); - Assert.IsType((b1 / c1).GetType(), i1.GetType()); - Assert.IsType((i1 / i1).GetType(), i1.GetType()); - Assert.IsType((i1 / l1).GetType(), l1.GetType()); - Assert.IsType((i1 / c1).GetType(), i1.GetType()); - Assert.IsType((l1 / l1).GetType(), l1.GetType()); - Assert.IsType((l1 / c1).GetType(), l1.GetType()); - Assert.IsType((c1 / c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 / s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 / b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 / i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 / c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 / b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 / i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 / c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 / i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 / c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 / c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 / c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass17 @@ -636,21 +636,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 % s1).GetType(), i1.GetType()); - Assert.IsType((s1 % b1).GetType(), i1.GetType()); - Assert.IsType((s1 % i1).GetType(), i1.GetType()); - Assert.IsType((s1 % l1).GetType(), l1.GetType()); - Assert.IsType((s1 % c1).GetType(), i1.GetType()); - Assert.IsType((b1 % b1).GetType(), i1.GetType()); - Assert.IsType((b1 % i1).GetType(), i1.GetType()); - Assert.IsType((b1 % l1).GetType(), l1.GetType()); - Assert.IsType((b1 % c1).GetType(), i1.GetType()); - Assert.IsType((i1 % i1).GetType(), i1.GetType()); - Assert.IsType((i1 % l1).GetType(), l1.GetType()); - Assert.IsType((i1 % c1).GetType(), i1.GetType()); - Assert.IsType((l1 % l1).GetType(), l1.GetType()); - Assert.IsType((l1 % c1).GetType(), l1.GetType()); - Assert.IsType((c1 % c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 % s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 % b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 % i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 % c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 % b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 % i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 % c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 % i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 % c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 % c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 % c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass18 @@ -663,21 +663,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 & s1).GetType(), i1.GetType()); - Assert.IsType((s1 & b1).GetType(), i1.GetType()); - Assert.IsType((s1 & i1).GetType(), i1.GetType()); - Assert.IsType((s1 & l1).GetType(), l1.GetType()); - Assert.IsType((s1 & c1).GetType(), i1.GetType()); - Assert.IsType((b1 & b1).GetType(), i1.GetType()); - Assert.IsType((b1 & i1).GetType(), i1.GetType()); - Assert.IsType((b1 & l1).GetType(), l1.GetType()); - Assert.IsType((b1 & c1).GetType(), i1.GetType()); - Assert.IsType((i1 & i1).GetType(), i1.GetType()); - Assert.IsType((i1 & l1).GetType(), l1.GetType()); - Assert.IsType((i1 & c1).GetType(), i1.GetType()); - Assert.IsType((l1 & l1).GetType(), l1.GetType()); - Assert.IsType((l1 & c1).GetType(), l1.GetType()); - Assert.IsType((c1 & c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 & s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 & b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 & i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 & c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 & b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 & i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 & c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 & i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 & c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 & c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 & c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass19 @@ -690,21 +690,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 ^ s1).GetType(), i1.GetType()); - Assert.IsType((s1 ^ b1).GetType(), i1.GetType()); - Assert.IsType((s1 ^ i1).GetType(), i1.GetType()); - Assert.IsType((s1 ^ l1).GetType(), l1.GetType()); - Assert.IsType((s1 ^ c1).GetType(), i1.GetType()); - Assert.IsType((b1 ^ b1).GetType(), i1.GetType()); - Assert.IsType((b1 ^ i1).GetType(), i1.GetType()); - Assert.IsType((b1 ^ l1).GetType(), l1.GetType()); - Assert.IsType((b1 ^ c1).GetType(), i1.GetType()); - Assert.IsType((i1 ^ i1).GetType(), i1.GetType()); - Assert.IsType((i1 ^ l1).GetType(), l1.GetType()); - Assert.IsType((i1 ^ c1).GetType(), i1.GetType()); - Assert.IsType((l1 ^ l1).GetType(), l1.GetType()); - Assert.IsType((l1 ^ c1).GetType(), l1.GetType()); - Assert.IsType((c1 ^ c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 ^ s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 ^ b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 ^ i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 ^ c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 ^ b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 ^ i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 ^ c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 ^ i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 ^ c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 ^ c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 ^ c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass20 @@ -717,21 +717,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 | s1).GetType(), i1.GetType()); - Assert.IsType((s1 | b1).GetType(), i1.GetType()); - Assert.IsType((s1 | i1).GetType(), i1.GetType()); - Assert.IsType((s1 | l1).GetType(), l1.GetType()); - Assert.IsType((s1 | c1).GetType(), i1.GetType()); - Assert.IsType((b1 | b1).GetType(), i1.GetType()); - Assert.IsType((b1 | i1).GetType(), i1.GetType()); - Assert.IsType((b1 | l1).GetType(), l1.GetType()); - Assert.IsType((b1 | c1).GetType(), i1.GetType()); - Assert.IsType((i1 | i1).GetType(), i1.GetType()); - Assert.IsType((i1 | l1).GetType(), l1.GetType()); - Assert.IsType((i1 | c1).GetType(), i1.GetType()); - Assert.IsType((l1 | l1).GetType(), l1.GetType()); - Assert.IsType((l1 | c1).GetType(), l1.GetType()); - Assert.IsType((c1 | c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 | s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 | b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 | i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 | c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 | b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 | i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b1 | c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 | i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i1 | c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((l1 | c1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 | c1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass21 @@ -745,21 +745,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 == s1).GetType(), TestBool.GetType()); - Assert.IsType((s1 == b1).GetType(), TestBool.GetType()); - Assert.IsType((s1 == i1).GetType(), TestBool.GetType()); - Assert.IsType((s1 == l1).GetType(), TestBool.GetType()); - Assert.IsType((s1 == c1).GetType(), TestBool.GetType()); - Assert.IsType((b1 == b1).GetType(), TestBool.GetType()); - Assert.IsType((b1 == i1).GetType(), TestBool.GetType()); - Assert.IsType((b1 == l1).GetType(), TestBool.GetType()); - Assert.IsType((b1 == c1).GetType(), TestBool.GetType()); - Assert.IsType((i1 == i1).GetType(), TestBool.GetType()); - Assert.IsType((i1 == l1).GetType(), TestBool.GetType()); - Assert.IsType((i1 == c1).GetType(), TestBool.GetType()); - Assert.IsType((l1 == l1).GetType(), TestBool.GetType()); - Assert.IsType((l1 == c1).GetType(), TestBool.GetType()); - Assert.IsType((c1 == c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 == s1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 == b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 == i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 == l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 == c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 == b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 == i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 == l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 == c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 == i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 == l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 == c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 == l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 == c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((c1 == c1).GetType(), TestBool.GetType()); } } public class ValueIntegralTestClass22 @@ -773,21 +773,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 != s1).GetType(), TestBool.GetType()); - Assert.IsType((s1 != b1).GetType(), TestBool.GetType()); - Assert.IsType((s1 != i1).GetType(), TestBool.GetType()); - Assert.IsType((s1 != l1).GetType(), TestBool.GetType()); - Assert.IsType((s1 != c1).GetType(), TestBool.GetType()); - Assert.IsType((b1 != b1).GetType(), TestBool.GetType()); - Assert.IsType((b1 != i1).GetType(), TestBool.GetType()); - Assert.IsType((b1 != l1).GetType(), TestBool.GetType()); - Assert.IsType((b1 != c1).GetType(), TestBool.GetType()); - Assert.IsType((i1 != i1).GetType(), TestBool.GetType()); - Assert.IsType((i1 != l1).GetType(), TestBool.GetType()); - Assert.IsType((i1 != c1).GetType(), TestBool.GetType()); - Assert.IsType((l1 != l1).GetType(), TestBool.GetType()); - Assert.IsType((l1 != c1).GetType(), TestBool.GetType()); - Assert.IsType((c1 != c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 != s1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 != b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 != i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 != l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 != c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 != b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 != i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 != l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 != c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 != i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 != l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 != c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 != l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 != c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((c1 != c1).GetType(), TestBool.GetType()); } } public class ValueIntegralTestClass23 @@ -801,21 +801,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 > s1).GetType(), TestBool.GetType()); - Assert.IsType((s1 > b1).GetType(), TestBool.GetType()); - Assert.IsType((s1 > i1).GetType(), TestBool.GetType()); - Assert.IsType((s1 > l1).GetType(), TestBool.GetType()); - Assert.IsType((s1 > c1).GetType(), TestBool.GetType()); - Assert.IsType((b1 > b1).GetType(), TestBool.GetType()); - Assert.IsType((b1 > i1).GetType(), TestBool.GetType()); - Assert.IsType((b1 > l1).GetType(), TestBool.GetType()); - Assert.IsType((b1 > c1).GetType(), TestBool.GetType()); - Assert.IsType((i1 > i1).GetType(), TestBool.GetType()); - Assert.IsType((i1 > l1).GetType(), TestBool.GetType()); - Assert.IsType((i1 > c1).GetType(), TestBool.GetType()); - Assert.IsType((l1 > l1).GetType(), TestBool.GetType()); - Assert.IsType((l1 > c1).GetType(), TestBool.GetType()); - Assert.IsType((c1 > c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 > s1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 > b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 > i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 > l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 > c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 > b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 > i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 > l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 > c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 > i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 > l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 > c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 > l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 > c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((c1 > c1).GetType(), TestBool.GetType()); } } public class ValueIntegralTestClass24 @@ -829,21 +829,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 < s1).GetType(), TestBool.GetType()); - Assert.IsType((s1 < b1).GetType(), TestBool.GetType()); - Assert.IsType((s1 < i1).GetType(), TestBool.GetType()); - Assert.IsType((s1 < l1).GetType(), TestBool.GetType()); - Assert.IsType((s1 < c1).GetType(), TestBool.GetType()); - Assert.IsType((b1 < b1).GetType(), TestBool.GetType()); - Assert.IsType((b1 < i1).GetType(), TestBool.GetType()); - Assert.IsType((b1 < l1).GetType(), TestBool.GetType()); - Assert.IsType((b1 < c1).GetType(), TestBool.GetType()); - Assert.IsType((i1 < i1).GetType(), TestBool.GetType()); - Assert.IsType((i1 < l1).GetType(), TestBool.GetType()); - Assert.IsType((i1 < c1).GetType(), TestBool.GetType()); - Assert.IsType((l1 < l1).GetType(), TestBool.GetType()); - Assert.IsType((l1 < c1).GetType(), TestBool.GetType()); - Assert.IsType((c1 < c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 < s1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 < b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 < i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 < l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 < c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 < b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 < i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 < l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 < c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 < i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 < l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 < c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 < l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 < c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((c1 < c1).GetType(), TestBool.GetType()); } } public class ValueIntegralTestClass25 @@ -857,21 +857,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 >= s1).GetType(), TestBool.GetType()); - Assert.IsType((s1 >= b1).GetType(), TestBool.GetType()); - Assert.IsType((s1 >= i1).GetType(), TestBool.GetType()); - Assert.IsType((s1 >= l1).GetType(), TestBool.GetType()); - Assert.IsType((s1 >= c1).GetType(), TestBool.GetType()); - Assert.IsType((b1 >= b1).GetType(), TestBool.GetType()); - Assert.IsType((b1 >= i1).GetType(), TestBool.GetType()); - Assert.IsType((b1 >= l1).GetType(), TestBool.GetType()); - Assert.IsType((b1 >= c1).GetType(), TestBool.GetType()); - Assert.IsType((i1 >= i1).GetType(), TestBool.GetType()); - Assert.IsType((i1 >= l1).GetType(), TestBool.GetType()); - Assert.IsType((i1 >= c1).GetType(), TestBool.GetType()); - Assert.IsType((l1 >= l1).GetType(), TestBool.GetType()); - Assert.IsType((l1 >= c1).GetType(), TestBool.GetType()); - Assert.IsType((c1 >= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 >= s1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 >= b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 >= i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 >= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 >= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 >= b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 >= i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 >= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 >= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 >= i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 >= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 >= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 >= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 >= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((c1 >= c1).GetType(), TestBool.GetType()); } } public class ValueIntegralTestClass26 @@ -885,21 +885,21 @@ public static void testMethod() long l1 = 5L; char c1 = (char)6; //short - Assert.IsType((s1 <= s1).GetType(), TestBool.GetType()); - Assert.IsType((s1 <= b1).GetType(), TestBool.GetType()); - Assert.IsType((s1 <= i1).GetType(), TestBool.GetType()); - Assert.IsType((s1 <= l1).GetType(), TestBool.GetType()); - Assert.IsType((s1 <= c1).GetType(), TestBool.GetType()); - Assert.IsType((b1 <= b1).GetType(), TestBool.GetType()); - Assert.IsType((b1 <= i1).GetType(), TestBool.GetType()); - Assert.IsType((b1 <= l1).GetType(), TestBool.GetType()); - Assert.IsType((b1 <= c1).GetType(), TestBool.GetType()); - Assert.IsType((i1 <= i1).GetType(), TestBool.GetType()); - Assert.IsType((i1 <= l1).GetType(), TestBool.GetType()); - Assert.IsType((i1 <= c1).GetType(), TestBool.GetType()); - Assert.IsType((l1 <= l1).GetType(), TestBool.GetType()); - Assert.IsType((l1 <= c1).GetType(), TestBool.GetType()); - Assert.IsType((c1 <= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 <= s1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 <= b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 <= i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 <= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((s1 <= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 <= b1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 <= i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 <= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((b1 <= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 <= i1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 <= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((i1 <= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 <= l1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((l1 <= c1).GetType(), TestBool.GetType()); + Assert.IsInstanceOfType((c1 <= c1).GetType(), TestBool.GetType()); } } public class ValueIntegralTestClass27 @@ -911,11 +911,11 @@ public static void testMethod() int i1 = 4; long l1 = 5L; char c1 = (char)6; - Assert.IsType((s1 << 1).GetType(), i1.GetType()); - Assert.IsType((b1 << 1).GetType(), i1.GetType()); - Assert.IsType((i1 << 1).GetType(), i1.GetType()); - Assert.IsType((l1 << 1).GetType(), l1.GetType()); - Assert.IsType((c1 << 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 << 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 << 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 << 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 << 1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 << 1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass28 @@ -927,11 +927,11 @@ public static void testMethod() int i1 = 4; long l1 = 5L; char c1 = (char)6; - Assert.IsType((s1 >> 1).GetType(), i1.GetType()); - Assert.IsType((b1 >> 1).GetType(), i1.GetType()); - Assert.IsType((i1 >> 1).GetType(), i1.GetType()); - Assert.IsType((l1 >> 1).GetType(), l1.GetType()); - Assert.IsType((c1 >> 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s1 >> 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b1 >> 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((i1 >> 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 >> 1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((c1 >> 1).GetType(), i1.GetType()); } } public class ValueIntegralTestClass38 @@ -1013,37 +1013,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 + s1).GetType(), i1.GetType()); - Assert.IsType((s2 + b1).GetType(), i1.GetType()); - Assert.IsType((s2 + i1).GetType(), i1.GetType()); - Assert.IsType((s2 + l1).GetType(), l1.GetType()); - Assert.IsType((s2 + c1).GetType(), i1.GetType()); - Assert.IsType((s2 + s2).GetType(), i1.GetType()); - Assert.IsType((s2 + b2).GetType(), i1.GetType()); - Assert.IsType((s2 + i2).GetType(), i2.GetType()); - Assert.IsType((s2 + l2).GetType(), l2.GetType()); - Assert.IsType((b2 + s1).GetType(), i1.GetType()); - Assert.IsType((b2 + b1).GetType(), i1.GetType()); - Assert.IsType((b2 + i1).GetType(), i1.GetType()); - Assert.IsType((b2 + l1).GetType(), l1.GetType()); - Assert.IsType((b2 + c1).GetType(), i1.GetType()); - Assert.IsType((b2 + s2).GetType(), i1.GetType()); - Assert.IsType((b2 + b2).GetType(), i1.GetType()); - Assert.IsType((b2 + i2).GetType(), l1.GetType()); - Assert.IsType((i2 + s1).GetType(), l1.GetType()); - Assert.IsType((i2 + b1).GetType(), i2.GetType()); - Assert.IsType((i2 + i1).GetType(), l1.GetType()); - Assert.IsType((i2 + l1).GetType(), l1.GetType()); - Assert.IsType((i2 + c1).GetType(), i2.GetType()); - Assert.IsType((i2 + s2).GetType(), i2.GetType()); - Assert.IsType((i2 + b2).GetType(), l1.GetType()); - Assert.IsType((i2 + i2).GetType(), i2.GetType()); - Assert.IsType((i2 + l2).GetType(), l2.GetType()); - Assert.IsType((l2 + b1).GetType(), l2.GetType()); - Assert.IsType((l2 + c1).GetType(), l2.GetType()); - Assert.IsType((l2 + s2).GetType(), l2.GetType()); - Assert.IsType((l2 + i2).GetType(), l2.GetType()); - Assert.IsType((l2 + l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 + s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 + b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 + i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 + c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 + s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 + b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 + i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 + l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 + s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 + b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 + i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 + c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 + s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 + b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 + i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 + s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 + b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 + i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 + l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 + c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 + s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 + b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 + i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 + l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 + b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 + c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 + s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 + i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 + l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass50 @@ -1060,36 +1060,36 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 - s1).GetType(), i1.GetType()); - Assert.IsType((s2 - i1).GetType(), i1.GetType()); - Assert.IsType((s2 - l1).GetType(), l1.GetType()); - Assert.IsType((s2 - c1).GetType(), i1.GetType()); - Assert.IsType((s2 - s2).GetType(), i1.GetType()); - Assert.IsType((s2 - b2).GetType(), i1.GetType()); - Assert.IsType((s2 - i2).GetType(), i2.GetType()); - Assert.IsType((s2 - l2).GetType(), l2.GetType()); - Assert.IsType((b2 - s1).GetType(), i1.GetType()); - Assert.IsType((b2 - b1).GetType(), i1.GetType()); - Assert.IsType((b2 - i1).GetType(), i1.GetType()); - Assert.IsType((b2 - l1).GetType(), l1.GetType()); - Assert.IsType((b2 - c1).GetType(), i1.GetType()); - Assert.IsType((b2 - s2).GetType(), i1.GetType()); - Assert.IsType((b2 - b2).GetType(), i1.GetType()); - Assert.IsType((b2 - i2).GetType(), l1.GetType()); - Assert.IsType((i2 - s1).GetType(), l1.GetType()); - Assert.IsType((i2 - b1).GetType(), i2.GetType()); - Assert.IsType((i2 - i1).GetType(), l1.GetType()); - Assert.IsType((i2 - l1).GetType(), l1.GetType()); - Assert.IsType((i2 - c1).GetType(), i2.GetType()); - Assert.IsType((i2 - s2).GetType(), i2.GetType()); - Assert.IsType((i2 - b2).GetType(), l1.GetType()); - Assert.IsType((i2 - i2).GetType(), i2.GetType()); - Assert.IsType((i2 - l2).GetType(), l2.GetType()); - Assert.IsType((l2 - b1).GetType(), l2.GetType()); - Assert.IsType((l2 - c1).GetType(), l2.GetType()); - Assert.IsType((l2 - s2).GetType(), l2.GetType()); - Assert.IsType((l2 - i2).GetType(), l2.GetType()); - Assert.IsType((l2 - l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 - s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 - i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 - c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 - s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 - b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 - i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 - l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 - s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 - b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 - i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 - c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 - s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 - b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 - i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 - s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 - b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 - i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 - l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 - c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 - s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 - b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 - i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 - l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 - b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 - c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 - s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 - i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 - l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass51 @@ -1106,37 +1106,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 * s1).GetType(), i1.GetType()); - Assert.IsType((s2 * b1).GetType(), i1.GetType()); - Assert.IsType((s2 * i1).GetType(), i1.GetType()); - Assert.IsType((s2 * l1).GetType(), l1.GetType()); - Assert.IsType((s2 * c1).GetType(), i1.GetType()); - Assert.IsType((s2 * s2).GetType(), i1.GetType()); - Assert.IsType((s2 * b2).GetType(), i1.GetType()); - Assert.IsType((s2 * i2).GetType(), i2.GetType()); - Assert.IsType((s2 * l2).GetType(), l2.GetType()); - Assert.IsType((b2 * s1).GetType(), i1.GetType()); - Assert.IsType((b2 * b1).GetType(), i1.GetType()); - Assert.IsType((b2 * i1).GetType(), i1.GetType()); - Assert.IsType((b2 * l1).GetType(), l1.GetType()); - Assert.IsType((b2 * c1).GetType(), i1.GetType()); - Assert.IsType((b2 * s2).GetType(), i1.GetType()); - Assert.IsType((b2 * b2).GetType(), i1.GetType()); - Assert.IsType((b2 * i2).GetType(), l1.GetType()); - Assert.IsType((i2 * s1).GetType(), l1.GetType()); - Assert.IsType((i2 * b1).GetType(), i2.GetType()); - Assert.IsType((i2 * i1).GetType(), l1.GetType()); - Assert.IsType((i2 * l1).GetType(), l1.GetType()); - Assert.IsType((i2 * c1).GetType(), i2.GetType()); - Assert.IsType((i2 * s2).GetType(), i2.GetType()); - Assert.IsType((i2 * b2).GetType(), l1.GetType()); - Assert.IsType((i2 * i2).GetType(), i2.GetType()); - Assert.IsType((i2 * l2).GetType(), l2.GetType()); - Assert.IsType((l2 * b1).GetType(), l2.GetType()); - Assert.IsType((l2 * c1).GetType(), l2.GetType()); - Assert.IsType((l2 * s2).GetType(), l2.GetType()); - Assert.IsType((l2 * i2).GetType(), l2.GetType()); - Assert.IsType((l2 * l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 * s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 * b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 * i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 * c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 * s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 * b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 * i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 * l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 * s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 * b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 * i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 * c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 * s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 * b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 * i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 * s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 * b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 * i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 * l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 * c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 * s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 * b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 * i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 * l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 * b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 * c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 * s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 * i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 * l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass52 @@ -1153,37 +1153,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 / s1).GetType(), i1.GetType()); - Assert.IsType((s2 / b1).GetType(), i1.GetType()); - Assert.IsType((s2 / i1).GetType(), i1.GetType()); - Assert.IsType((s2 / l1).GetType(), l1.GetType()); - Assert.IsType((s2 / c1).GetType(), i1.GetType()); - Assert.IsType((s2 / s2).GetType(), i1.GetType()); - Assert.IsType((s2 / b2).GetType(), i1.GetType()); - Assert.IsType((s2 / i2).GetType(), i2.GetType()); - Assert.IsType((s2 / l2).GetType(), l2.GetType()); - Assert.IsType((b2 / s1).GetType(), i1.GetType()); - Assert.IsType((b2 / b1).GetType(), i1.GetType()); - Assert.IsType((b2 / i1).GetType(), i1.GetType()); - Assert.IsType((b2 / l1).GetType(), l1.GetType()); - Assert.IsType((b2 / c1).GetType(), i1.GetType()); - Assert.IsType((b2 / s2).GetType(), i1.GetType()); - Assert.IsType((b2 / b2).GetType(), i1.GetType()); - Assert.IsType((b2 / i2).GetType(), l1.GetType()); - Assert.IsType((i2 / s1).GetType(), l1.GetType()); - Assert.IsType((i2 / b1).GetType(), i2.GetType()); - Assert.IsType((i2 / i1).GetType(), l1.GetType()); - Assert.IsType((i2 / l1).GetType(), l1.GetType()); - Assert.IsType((i2 / c1).GetType(), i2.GetType()); - Assert.IsType((i2 / s2).GetType(), i2.GetType()); - Assert.IsType((i2 / b2).GetType(), l1.GetType()); - Assert.IsType((i2 / i2).GetType(), i2.GetType()); - Assert.IsType((i2 / l2).GetType(), l2.GetType()); - Assert.IsType((l2 / b1).GetType(), l2.GetType()); - Assert.IsType((l2 / c1).GetType(), l2.GetType()); - Assert.IsType((l2 / s2).GetType(), l2.GetType()); - Assert.IsType((l2 / i2).GetType(), l2.GetType()); - Assert.IsType((l2 / l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 / s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 / b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 / i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 / c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 / s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 / b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 / i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 / l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 / s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 / b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 / i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 / c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 / s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 / b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 / i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 / s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 / b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 / i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 / l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 / c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 / s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 / b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 / i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 / l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 / b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 / c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 / s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 / i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 / l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass53 @@ -1200,37 +1200,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 % s1).GetType(), i1.GetType()); - Assert.IsType((s2 % b1).GetType(), i1.GetType()); - Assert.IsType((s2 % i1).GetType(), i1.GetType()); - Assert.IsType((s2 % l1).GetType(), l1.GetType()); - Assert.IsType((s2 % c1).GetType(), i1.GetType()); - Assert.IsType((s2 % s2).GetType(), i1.GetType()); - Assert.IsType((s2 % b2).GetType(), i1.GetType()); - Assert.IsType((s2 % i2).GetType(), i2.GetType()); - Assert.IsType((s2 % l2).GetType(), l2.GetType()); - Assert.IsType((b2 % s1).GetType(), i1.GetType()); - Assert.IsType((b2 % b1).GetType(), i1.GetType()); - Assert.IsType((b2 % i1).GetType(), i1.GetType()); - Assert.IsType((b2 % l1).GetType(), l1.GetType()); - Assert.IsType((b2 % c1).GetType(), i1.GetType()); - Assert.IsType((b2 % s2).GetType(), i1.GetType()); - Assert.IsType((b2 % b2).GetType(), i1.GetType()); - Assert.IsType((b2 % i2).GetType(), l1.GetType()); - Assert.IsType((i2 % s1).GetType(), l1.GetType()); - Assert.IsType((i2 % b1).GetType(), i2.GetType()); - Assert.IsType((i2 % i1).GetType(), l1.GetType()); - Assert.IsType((i2 % l1).GetType(), l1.GetType()); - Assert.IsType((i2 % c1).GetType(), i2.GetType()); - Assert.IsType((i2 % s2).GetType(), i2.GetType()); - Assert.IsType((i2 % b2).GetType(), l1.GetType()); - Assert.IsType((i2 % i2).GetType(), i2.GetType()); - Assert.IsType((i2 % l2).GetType(), l2.GetType()); - Assert.IsType((l2 % b1).GetType(), l2.GetType()); - Assert.IsType((l2 % c1).GetType(), l2.GetType()); - Assert.IsType((l2 % s2).GetType(), l2.GetType()); - Assert.IsType((l2 % i2).GetType(), l2.GetType()); - Assert.IsType((l2 % l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 % s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 % b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 % i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 % c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 % s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 % b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 % i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 % l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 % s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 % b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 % i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 % c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 % s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 % b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 % i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 % s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 % b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 % i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 % l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 % c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 % s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 % b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 % i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 % l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 % b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 % c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 % s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 % i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 % l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass54 @@ -1247,37 +1247,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 & s1).GetType(), i1.GetType()); - Assert.IsType((s2 & b1).GetType(), i1.GetType()); - Assert.IsType((s2 & i1).GetType(), i1.GetType()); - Assert.IsType((s2 & l1).GetType(), l1.GetType()); - Assert.IsType((s2 & c1).GetType(), i1.GetType()); - Assert.IsType((s2 & s2).GetType(), i1.GetType()); - Assert.IsType((s2 & b2).GetType(), i1.GetType()); - Assert.IsType((s2 & i2).GetType(), i2.GetType()); - Assert.IsType((s2 & l2).GetType(), l2.GetType()); - Assert.IsType((b2 & s1).GetType(), i1.GetType()); - Assert.IsType((b2 & b1).GetType(), i1.GetType()); - Assert.IsType((b2 & i1).GetType(), i1.GetType()); - Assert.IsType((b2 & l1).GetType(), l1.GetType()); - Assert.IsType((b2 & c1).GetType(), i1.GetType()); - Assert.IsType((b2 & s2).GetType(), i1.GetType()); - Assert.IsType((b2 & b2).GetType(), i1.GetType()); - Assert.IsType((b2 & i2).GetType(), l1.GetType()); - Assert.IsType((i2 & s1).GetType(), l1.GetType()); - Assert.IsType((i2 & b1).GetType(), i2.GetType()); - Assert.IsType((i2 & i1).GetType(), l1.GetType()); - Assert.IsType((i2 & l1).GetType(), l1.GetType()); - Assert.IsType((i2 & c1).GetType(), i2.GetType()); - Assert.IsType((i2 & s2).GetType(), i2.GetType()); - Assert.IsType((i2 & b2).GetType(), l1.GetType()); - Assert.IsType((i2 & i2).GetType(), i2.GetType()); - Assert.IsType((i2 & l2).GetType(), l2.GetType()); - Assert.IsType((l2 & b1).GetType(), l2.GetType()); - Assert.IsType((l2 & c1).GetType(), l2.GetType()); - Assert.IsType((l2 & s2).GetType(), l2.GetType()); - Assert.IsType((l2 & i2).GetType(), l2.GetType()); - Assert.IsType((l2 & l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 & s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 & b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 & i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 & c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 & s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 & b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 & i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 & l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 & s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 & b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 & i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 & c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 & s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 & b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 & i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 & s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 & b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 & i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 & l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 & c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 & s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 & b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 & i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 & l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 & b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 & c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 & s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 & i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 & l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass55 @@ -1294,37 +1294,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 ^ s1).GetType(), i1.GetType()); - Assert.IsType((s2 ^ b1).GetType(), i1.GetType()); - Assert.IsType((s2 ^ i1).GetType(), i1.GetType()); - Assert.IsType((s2 ^ l1).GetType(), l1.GetType()); - Assert.IsType((s2 ^ c1).GetType(), i1.GetType()); - Assert.IsType((s2 ^ s2).GetType(), i1.GetType()); - Assert.IsType((s2 ^ b2).GetType(), i1.GetType()); - Assert.IsType((s2 ^ i2).GetType(), i2.GetType()); - Assert.IsType((s2 ^ l2).GetType(), l2.GetType()); - Assert.IsType((b2 ^ s1).GetType(), i1.GetType()); - Assert.IsType((b2 ^ b1).GetType(), i1.GetType()); - Assert.IsType((b2 ^ i1).GetType(), i1.GetType()); - Assert.IsType((b2 ^ l1).GetType(), l1.GetType()); - Assert.IsType((b2 ^ c1).GetType(), i1.GetType()); - Assert.IsType((b2 ^ s2).GetType(), i1.GetType()); - Assert.IsType((b2 ^ b2).GetType(), i1.GetType()); - Assert.IsType((b2 ^ i2).GetType(), l1.GetType()); - Assert.IsType((i2 ^ s1).GetType(), l1.GetType()); - Assert.IsType((i2 ^ b1).GetType(), i2.GetType()); - Assert.IsType((i2 ^ i1).GetType(), l1.GetType()); - Assert.IsType((i2 ^ l1).GetType(), l1.GetType()); - Assert.IsType((i2 ^ c1).GetType(), i2.GetType()); - Assert.IsType((i2 ^ s2).GetType(), i2.GetType()); - Assert.IsType((i2 ^ b2).GetType(), l1.GetType()); - Assert.IsType((i2 ^ i2).GetType(), i2.GetType()); - Assert.IsType((i2 ^ l2).GetType(), l2.GetType()); - Assert.IsType((l2 ^ b1).GetType(), l2.GetType()); - Assert.IsType((l2 ^ c1).GetType(), l2.GetType()); - Assert.IsType((l2 ^ s2).GetType(), l2.GetType()); - Assert.IsType((l2 ^ i2).GetType(), l2.GetType()); - Assert.IsType((l2 ^ l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 ^ s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 ^ b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 ^ i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 ^ c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 ^ s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 ^ b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 ^ i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 ^ l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 ^ s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 ^ b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 ^ i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 ^ c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 ^ s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 ^ b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 ^ i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 ^ s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 ^ b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 ^ i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 ^ l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 ^ c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 ^ s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 ^ b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 ^ i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 ^ l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 ^ b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 ^ c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 ^ s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 ^ i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 ^ l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass56 @@ -1341,37 +1341,37 @@ public static void testMethod() uint i2 = 9; ulong l2 = 10; //ushort - Assert.IsType((s2 | s1).GetType(), i1.GetType()); - Assert.IsType((s2 | b1).GetType(), i1.GetType()); - Assert.IsType((s2 | i1).GetType(), i1.GetType()); - Assert.IsType((s2 | l1).GetType(), l1.GetType()); - Assert.IsType((s2 | c1).GetType(), i1.GetType()); - Assert.IsType((s2 | s2).GetType(), i1.GetType()); - Assert.IsType((s2 | b2).GetType(), i1.GetType()); - Assert.IsType((s2 | i2).GetType(), i2.GetType()); - Assert.IsType((s2 | l2).GetType(), l2.GetType()); - Assert.IsType((b2 | s1).GetType(), i1.GetType()); - Assert.IsType((b2 | b1).GetType(), i1.GetType()); - Assert.IsType((b2 | i1).GetType(), i1.GetType()); - Assert.IsType((b2 | l1).GetType(), l1.GetType()); - Assert.IsType((b2 | c1).GetType(), i1.GetType()); - Assert.IsType((b2 | s2).GetType(), i1.GetType()); - Assert.IsType((b2 | b2).GetType(), i1.GetType()); - Assert.IsType((b2 | i2).GetType(), l1.GetType()); - Assert.IsType((i2 | s1).GetType(), l1.GetType()); - Assert.IsType((i2 | b1).GetType(), i2.GetType()); - Assert.IsType((i2 | i1).GetType(), l1.GetType()); - Assert.IsType((i2 | l1).GetType(), l1.GetType()); - Assert.IsType((i2 | c1).GetType(), i2.GetType()); - Assert.IsType((i2 | s2).GetType(), i2.GetType()); - Assert.IsType((i2 | b2).GetType(), l1.GetType()); - Assert.IsType((i2 | i2).GetType(), i2.GetType()); - Assert.IsType((i2 | l2).GetType(), l2.GetType()); - Assert.IsType((l2 | b1).GetType(), l2.GetType()); - Assert.IsType((l2 | c1).GetType(), l2.GetType()); - Assert.IsType((l2 | s2).GetType(), l2.GetType()); - Assert.IsType((l2 | i2).GetType(), l2.GetType()); - Assert.IsType((l2 | l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((s2 | s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 | b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 | i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s2 | c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 | s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 | b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((s2 | i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((s2 | l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((b2 | s1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 | b1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 | i1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((b2 | c1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 | s2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 | b2).GetType(), i1.GetType()); + Assert.IsInstanceOfType((b2 | i2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 | s1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 | b1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 | i1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 | l1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 | c1).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 | s2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 | b2).GetType(), l1.GetType()); + Assert.IsInstanceOfType((i2 | i2).GetType(), i2.GetType()); + Assert.IsInstanceOfType((i2 | l2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 | b1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 | c1).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 | s2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 | i2).GetType(), l2.GetType()); + Assert.IsInstanceOfType((l2 | l2).GetType(), l2.GetType()); } } public class ValueIntegralTestClass57 @@ -1389,37 +1389,37 @@ public static void testMethod() ulong l2 = 10; bool b = true; //ushort - Assert.IsType((s2 == s1).GetType(), b.GetType()); - Assert.IsType((s2 == b1).GetType(), b.GetType()); - Assert.IsType((s2 == i1).GetType(), b.GetType()); - Assert.IsType((s2 == l1).GetType(), b.GetType()); - Assert.IsType((s2 == c1).GetType(), b.GetType()); - Assert.IsType((s2 == s2).GetType(), b.GetType()); - Assert.IsType((s2 == b2).GetType(), b.GetType()); - Assert.IsType((s2 == i2).GetType(), b.GetType()); - Assert.IsType((s2 == l2).GetType(), b.GetType()); - Assert.IsType((b2 == s1).GetType(), b.GetType()); - Assert.IsType((b2 == b1).GetType(), b.GetType()); - Assert.IsType((b2 == i1).GetType(), b.GetType()); - Assert.IsType((b2 == l1).GetType(), b.GetType()); - Assert.IsType((b2 == c1).GetType(), b.GetType()); - Assert.IsType((b2 == s2).GetType(), b.GetType()); - Assert.IsType((b2 == b2).GetType(), b.GetType()); - Assert.IsType((b2 == i2).GetType(), b.GetType()); - Assert.IsType((i2 == s1).GetType(), b.GetType()); - Assert.IsType((i2 == b1).GetType(), b.GetType()); - Assert.IsType((i2 == i1).GetType(), b.GetType()); - Assert.IsType((i2 == l1).GetType(), b.GetType()); - Assert.IsType((i2 == c1).GetType(), b.GetType()); - Assert.IsType((i2 == s2).GetType(), b.GetType()); - Assert.IsType((i2 == b2).GetType(), b.GetType()); - Assert.IsType((i2 == i2).GetType(), b.GetType()); - Assert.IsType((i2 == l2).GetType(), b.GetType()); - Assert.IsType((l2 == b1).GetType(), b.GetType()); - Assert.IsType((l2 == c1).GetType(), b.GetType()); - Assert.IsType((l2 == s2).GetType(), b.GetType()); - Assert.IsType((l2 == i2).GetType(), b.GetType()); - Assert.IsType((l2 == l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 == l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 == i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 == l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 == b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 == c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 == s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 == i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 == l2).GetType(), b.GetType()); } } public class ValueIntegralTestClass58 @@ -1437,37 +1437,37 @@ public static void testMethod() ulong l2 = 10; bool b = true; //ushort - Assert.IsType((s2 != s1).GetType(), b.GetType()); - Assert.IsType((s2 != b1).GetType(), b.GetType()); - Assert.IsType((s2 != i1).GetType(), b.GetType()); - Assert.IsType((s2 != l1).GetType(), b.GetType()); - Assert.IsType((s2 != c1).GetType(), b.GetType()); - Assert.IsType((s2 != s2).GetType(), b.GetType()); - Assert.IsType((s2 != b2).GetType(), b.GetType()); - Assert.IsType((s2 != i2).GetType(), b.GetType()); - Assert.IsType((s2 != l2).GetType(), b.GetType()); - Assert.IsType((b2 != s1).GetType(), b.GetType()); - Assert.IsType((b2 != b1).GetType(), b.GetType()); - Assert.IsType((b2 != i1).GetType(), b.GetType()); - Assert.IsType((b2 != l1).GetType(), b.GetType()); - Assert.IsType((b2 != c1).GetType(), b.GetType()); - Assert.IsType((b2 != s2).GetType(), b.GetType()); - Assert.IsType((b2 != b2).GetType(), b.GetType()); - Assert.IsType((b2 != i2).GetType(), b.GetType()); - Assert.IsType((i2 != s1).GetType(), b.GetType()); - Assert.IsType((i2 != b1).GetType(), b.GetType()); - Assert.IsType((i2 != i1).GetType(), b.GetType()); - Assert.IsType((i2 != l1).GetType(), b.GetType()); - Assert.IsType((i2 != c1).GetType(), b.GetType()); - Assert.IsType((i2 != s2).GetType(), b.GetType()); - Assert.IsType((i2 != b2).GetType(), b.GetType()); - Assert.IsType((i2 != i2).GetType(), b.GetType()); - Assert.IsType((i2 != l2).GetType(), b.GetType()); - Assert.IsType((l2 != b1).GetType(), b.GetType()); - Assert.IsType((l2 != c1).GetType(), b.GetType()); - Assert.IsType((l2 != s2).GetType(), b.GetType()); - Assert.IsType((l2 != i2).GetType(), b.GetType()); - Assert.IsType((l2 != l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 != l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 != i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 != l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 != b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 != c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 != s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 != i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 != l2).GetType(), b.GetType()); } } public class ValueIntegralTestClass59 @@ -1485,37 +1485,37 @@ public static void testMethod() ulong l2 = 10; bool b = true; //ushort - Assert.IsType((s2 > s1).GetType(), b.GetType()); - Assert.IsType((s2 > b1).GetType(), b.GetType()); - Assert.IsType((s2 > i1).GetType(), b.GetType()); - Assert.IsType((s2 > l1).GetType(), b.GetType()); - Assert.IsType((s2 > c1).GetType(), b.GetType()); - Assert.IsType((s2 > s2).GetType(), b.GetType()); - Assert.IsType((s2 > b2).GetType(), b.GetType()); - Assert.IsType((s2 > i2).GetType(), b.GetType()); - Assert.IsType((s2 > l2).GetType(), b.GetType()); - Assert.IsType((b2 > s1).GetType(), b.GetType()); - Assert.IsType((b2 > b1).GetType(), b.GetType()); - Assert.IsType((b2 > i1).GetType(), b.GetType()); - Assert.IsType((b2 > l1).GetType(), b.GetType()); - Assert.IsType((b2 > c1).GetType(), b.GetType()); - Assert.IsType((b2 > s2).GetType(), b.GetType()); - Assert.IsType((b2 > b2).GetType(), b.GetType()); - Assert.IsType((b2 > i2).GetType(), b.GetType()); - Assert.IsType((i2 > s1).GetType(), b.GetType()); - Assert.IsType((i2 > b1).GetType(), b.GetType()); - Assert.IsType((i2 > i1).GetType(), b.GetType()); - Assert.IsType((i2 > l1).GetType(), b.GetType()); - Assert.IsType((i2 > c1).GetType(), b.GetType()); - Assert.IsType((i2 > s2).GetType(), b.GetType()); - Assert.IsType((i2 > b2).GetType(), b.GetType()); - Assert.IsType((i2 > i2).GetType(), b.GetType()); - Assert.IsType((i2 > l2).GetType(), b.GetType()); - Assert.IsType((l2 > b1).GetType(), b.GetType()); - Assert.IsType((l2 > c1).GetType(), b.GetType()); - Assert.IsType((l2 > s2).GetType(), b.GetType()); - Assert.IsType((l2 > i2).GetType(), b.GetType()); - Assert.IsType((l2 > l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 > l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 > i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 > l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 > b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 > c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 > s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 > i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 > l2).GetType(), b.GetType()); } } public class ValueIntegralTestClass60 @@ -1533,37 +1533,37 @@ public static void testMethod() ulong l2 = 10; bool b = true; //ushort - Assert.IsType((s2 < s1).GetType(), b.GetType()); - Assert.IsType((s2 < b1).GetType(), b.GetType()); - Assert.IsType((s2 < i1).GetType(), b.GetType()); - Assert.IsType((s2 < l1).GetType(), b.GetType()); - Assert.IsType((s2 < c1).GetType(), b.GetType()); - Assert.IsType((s2 < s2).GetType(), b.GetType()); - Assert.IsType((s2 < b2).GetType(), b.GetType()); - Assert.IsType((s2 < i2).GetType(), b.GetType()); - Assert.IsType((s2 < l2).GetType(), b.GetType()); - Assert.IsType((b2 < s1).GetType(), b.GetType()); - Assert.IsType((b2 < b1).GetType(), b.GetType()); - Assert.IsType((b2 < i1).GetType(), b.GetType()); - Assert.IsType((b2 < l1).GetType(), b.GetType()); - Assert.IsType((b2 < c1).GetType(), b.GetType()); - Assert.IsType((b2 < s2).GetType(), b.GetType()); - Assert.IsType((b2 < b2).GetType(), b.GetType()); - Assert.IsType((b2 < i2).GetType(), b.GetType()); - Assert.IsType((i2 < s1).GetType(), b.GetType()); - Assert.IsType((i2 < b1).GetType(), b.GetType()); - Assert.IsType((i2 < i1).GetType(), b.GetType()); - Assert.IsType((i2 < l1).GetType(), b.GetType()); - Assert.IsType((i2 < c1).GetType(), b.GetType()); - Assert.IsType((i2 < s2).GetType(), b.GetType()); - Assert.IsType((i2 < b2).GetType(), b.GetType()); - Assert.IsType((i2 < i2).GetType(), b.GetType()); - Assert.IsType((i2 < l2).GetType(), b.GetType()); - Assert.IsType((l2 < b1).GetType(), b.GetType()); - Assert.IsType((l2 < c1).GetType(), b.GetType()); - Assert.IsType((l2 < s2).GetType(), b.GetType()); - Assert.IsType((l2 < i2).GetType(), b.GetType()); - Assert.IsType((l2 < l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 < l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 < i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 < l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 < b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 < c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 < s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 < i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 < l2).GetType(), b.GetType()); } } public class ValueIntegralTestClass61 @@ -1581,37 +1581,37 @@ public static void testMethod() ulong l2 = 10; bool b = true; //ushort - Assert.IsType((s2 >= s1).GetType(), b.GetType()); - Assert.IsType((s2 >= b1).GetType(), b.GetType()); - Assert.IsType((s2 >= i1).GetType(), b.GetType()); - Assert.IsType((s2 >= l1).GetType(), b.GetType()); - Assert.IsType((s2 >= c1).GetType(), b.GetType()); - Assert.IsType((s2 >= s2).GetType(), b.GetType()); - Assert.IsType((s2 >= b2).GetType(), b.GetType()); - Assert.IsType((s2 >= i2).GetType(), b.GetType()); - Assert.IsType((s2 >= l2).GetType(), b.GetType()); - Assert.IsType((b2 >= s1).GetType(), b.GetType()); - Assert.IsType((b2 >= b1).GetType(), b.GetType()); - Assert.IsType((b2 >= i1).GetType(), b.GetType()); - Assert.IsType((b2 >= l1).GetType(), b.GetType()); - Assert.IsType((b2 >= c1).GetType(), b.GetType()); - Assert.IsType((b2 >= s2).GetType(), b.GetType()); - Assert.IsType((b2 >= b2).GetType(), b.GetType()); - Assert.IsType((b2 >= i2).GetType(), b.GetType()); - Assert.IsType((i2 >= s1).GetType(), b.GetType()); - Assert.IsType((i2 >= b1).GetType(), b.GetType()); - Assert.IsType((i2 >= i1).GetType(), b.GetType()); - Assert.IsType((i2 >= l1).GetType(), b.GetType()); - Assert.IsType((i2 >= c1).GetType(), b.GetType()); - Assert.IsType((i2 >= s2).GetType(), b.GetType()); - Assert.IsType((i2 >= b2).GetType(), b.GetType()); - Assert.IsType((i2 >= i2).GetType(), b.GetType()); - Assert.IsType((i2 >= l2).GetType(), b.GetType()); - Assert.IsType((l2 >= b1).GetType(), b.GetType()); - Assert.IsType((l2 >= c1).GetType(), b.GetType()); - Assert.IsType((l2 >= s2).GetType(), b.GetType()); - Assert.IsType((l2 >= i2).GetType(), b.GetType()); - Assert.IsType((l2 >= l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 >= l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 >= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 >= l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 >= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 >= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 >= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 >= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 >= l2).GetType(), b.GetType()); } } public class ValueIntegralTestClass62 @@ -1629,37 +1629,37 @@ public static void testMethod() ulong l2 = 10; bool b = true; //ushort - Assert.IsType((s2 <= s1).GetType(), b.GetType()); - Assert.IsType((s2 <= b1).GetType(), b.GetType()); - Assert.IsType((s2 <= i1).GetType(), b.GetType()); - Assert.IsType((s2 <= l1).GetType(), b.GetType()); - Assert.IsType((s2 <= c1).GetType(), b.GetType()); - Assert.IsType((s2 <= s2).GetType(), b.GetType()); - Assert.IsType((s2 <= b2).GetType(), b.GetType()); - Assert.IsType((s2 <= i2).GetType(), b.GetType()); - Assert.IsType((s2 <= l2).GetType(), b.GetType()); - Assert.IsType((b2 <= s1).GetType(), b.GetType()); - Assert.IsType((b2 <= b1).GetType(), b.GetType()); - Assert.IsType((b2 <= i1).GetType(), b.GetType()); - Assert.IsType((b2 <= l1).GetType(), b.GetType()); - Assert.IsType((b2 <= c1).GetType(), b.GetType()); - Assert.IsType((b2 <= s2).GetType(), b.GetType()); - Assert.IsType((b2 <= b2).GetType(), b.GetType()); - Assert.IsType((b2 <= i2).GetType(), b.GetType()); - Assert.IsType((i2 <= s1).GetType(), b.GetType()); - Assert.IsType((i2 <= b1).GetType(), b.GetType()); - Assert.IsType((i2 <= i1).GetType(), b.GetType()); - Assert.IsType((i2 <= l1).GetType(), b.GetType()); - Assert.IsType((i2 <= c1).GetType(), b.GetType()); - Assert.IsType((i2 <= s2).GetType(), b.GetType()); - Assert.IsType((i2 <= b2).GetType(), b.GetType()); - Assert.IsType((i2 <= i2).GetType(), b.GetType()); - Assert.IsType((i2 <= l2).GetType(), b.GetType()); - Assert.IsType((l2 <= b1).GetType(), b.GetType()); - Assert.IsType((l2 <= c1).GetType(), b.GetType()); - Assert.IsType((l2 <= s2).GetType(), b.GetType()); - Assert.IsType((l2 <= i2).GetType(), b.GetType()); - Assert.IsType((l2 <= l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((s2 <= l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((b2 <= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= s1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= i1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= l1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= b2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((i2 <= l2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 <= b1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 <= c1).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 <= s2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 <= i2).GetType(), b.GetType()); + Assert.IsInstanceOfType((l2 <= l2).GetType(), b.GetType()); } } public class ValueIntegralTestClass63 @@ -1672,10 +1672,10 @@ public static void testMethod() ulong l1 = 5L; int i = 1; - Assert.IsType((s1 << 1).GetType(), i.GetType()); - Assert.IsType((b1 << 1).GetType(), i.GetType()); - Assert.IsType((i1 << 1).GetType(), i1.GetType()); - Assert.IsType((l1 << 1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 << 1).GetType(), i.GetType()); + Assert.IsInstanceOfType((b1 << 1).GetType(), i.GetType()); + Assert.IsInstanceOfType((i1 << 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 << 1).GetType(), l1.GetType()); } } public class ValueIntegralTestClass64 @@ -1688,10 +1688,10 @@ public static void testMethod() ulong l1 = 5L; int i = 1; - Assert.IsType((s1 >> 1).GetType(), i.GetType()); - Assert.IsType((b1 >> 1).GetType(), i.GetType()); - Assert.IsType((i1 >> 1).GetType(), i1.GetType()); - Assert.IsType((l1 >> 1).GetType(), l1.GetType()); + Assert.IsInstanceOfType((s1 >> 1).GetType(), i.GetType()); + Assert.IsInstanceOfType((b1 >> 1).GetType(), i.GetType()); + Assert.IsInstanceOfType((i1 >> 1).GetType(), i1.GetType()); + Assert.IsInstanceOfType((l1 >> 1).GetType(), l1.GetType()); } } public class ValueIntegralTestClass70 diff --git a/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs b/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs index 803e6ca9..8dcb7042 100644 --- a/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs +++ b/Tests/NFUnitTestTypes/UnitTestValueSimpleTests.cs @@ -110,64 +110,56 @@ public class ValueSimpleTestClass01 { public static void testMethod() { - byte b = 0; - Assert.IsType(Type.GetType("System.Byte"), b); + Assert.IsInstanceOfType(Type.GetType("System.Byte"), typeof(byte)); } } public class ValueSimpleTestClass02 { public static void testMethod() { - char c = 'a'; - Assert.IsType(Type.GetType("System.Char"), c); + Assert.IsInstanceOfType(Type.GetType("System.Char"), typeof(char)); } } public class ValueSimpleTestClass03 { public static void testMethod() { - short s = 0; - Assert.IsType(Type.GetType("System.Int16"), s); + Assert.IsInstanceOfType(Type.GetType("System.Int16"), typeof(short)); } } public class ValueSimpleTestClass04 { public static void testMethod() { - int i = 0; - Assert.IsType(Type.GetType("System.Int32"), i); + Assert.IsInstanceOfType(Type.GetType("System.Int32"), typeof(int)); } } public class ValueSimpleTestClass05 { public static void testMethod() { - long l = 0L; - Assert.IsType(Type.GetType("System.Int64"), l); + Assert.IsInstanceOfType(Type.GetType("System.Int64"), typeof(long)); } } public class ValueSimpleTestClass06 { public static void testMethod() { - float f = 0.0f; - Assert.IsType(Type.GetType("System.Single"), f); + Assert.IsInstanceOfType(Type.GetType("System.Single"), typeof(float)); } } public class ValueSimpleTestClass07 { public static void testMethod() { - double d = 0.0d; - Assert.IsType(Type.GetType("System.Double"), d); + Assert.IsInstanceOfType(Type.GetType("System.Double"), typeof(double)); } } public class ValueSimpleTestClass09 { public static void testMethod() { - bool b = true; - Assert.IsType(Type.GetType("System.Boolean"), b); + Assert.IsInstanceOfType(Type.GetType("System.Boolean"), typeof(bool)); } } public class ValueSimpleTestClass11 @@ -197,24 +189,21 @@ public class ValueSimpleTestClass13 { public static void testMethod() { - sbyte sb = 0; - Assert.IsType(Type.GetType("System.SByte"), sb); + Assert.IsInstanceOfType(Type.GetType("System.SByte"), typeof(sbyte)); } } public class ValueSimpleTestClass14 { public static void testMethod() { - ushort us = 0; - Assert.IsType(Type.GetType("System.UInt16"), us); + Assert.IsInstanceOfType(Type.GetType("System.UInt16"), typeof(ushort)); } } public class ValueSimpleTestClass15 { public static void testMethod() { - uint ui = 0; - Assert.IsType(Type.GetType("System.UInt32"), ui); + Assert.IsInstanceOfType(Type.GetType("System.UInt32"), typeof(uint)); } } From 5a1904792de66efec1f5b6730d4febd4be883bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 25 Feb 2025 04:30:56 +0000 Subject: [PATCH 45/70] Rework `Guid` (#233) ***NO_CI*** (cherry picked from commit 76583b5c8c7446189c59ab63932b051e5781b782) --- nanoFramework.CoreLibrary/System/Guid.cs | 397 ++++++++++------------- 1 file changed, 178 insertions(+), 219 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Guid.cs b/nanoFramework.CoreLibrary/System/Guid.cs index 07079219..77794b61 100644 --- a/nanoFramework.CoreLibrary/System/Guid.cs +++ b/nanoFramework.CoreLibrary/System/Guid.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; @@ -11,25 +11,23 @@ namespace System [Serializable] public struct Guid { - //////////////////////////////////////////////////////////////////////////////// - // Member variables - //////////////////////////////////////////////////////////////////////////////// - private int _a; - private short _b; - private short _c; - private byte _d; - private byte _e; - private byte _f; - private byte _g; - private byte _h; - private byte _i; - private byte _j; - private byte _k; + private int[] _data; /// /// A read-only instance of the Guid class which consists of all zeros. /// - public static readonly Guid Empty = new Guid(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + public static readonly Guid Empty = new Guid( + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0); /// /// Initializes a new instance of the structure by using the specified integers and bytes. @@ -46,19 +44,24 @@ public struct Guid /// The next byte of the GUID. /// The next byte of the GUID. /// Specifying individual bytes in this manner can be used to circumvent byte order restrictions (big-endian or little-endian byte order) on particular types of computers. - public Guid(int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) + public Guid(int a, + short b, + short c, + byte d, + byte e, + byte f, + byte g, + byte h, + byte i, + byte j, + byte k) { - _a = a; - _b = b; - _c = c; - _d = d; - _e = e; - _f = f; - _g = g; - _h = h; - _i = i; - _j = j; - _k = k; + _data = new int[4]; + + _data[0] = a; + _data[1] = (ushort)b | (ushort)c << 16; + _data[2] = d | (e | (f | g << 8) << 8) << 8; + _data[3] = h | (i | (j | k << 8) << 8) << 8; } /// @@ -77,141 +80,135 @@ public Guid(int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byt /// The next byte of the GUID. /// Specifying the bytes in this manner avoids endianness issues. [CLSCompliant(false)] - public Guid(uint a, ushort b, ushort c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) + public Guid( + uint a, + ushort b, + ushort c, + byte d, + byte e, + byte f, + byte g, + byte h, + byte i, + byte j, + byte k) { - _a = (int)a; - _b = (short)b; - _c = (short)c; - _d = d; - _e = e; - _f = f; - _g = g; - _h = h; - _i = i; - _j = j; - _k = k; + _data = new int[4]; + + _data[0] = (int)a; + _data[1] = b | c << 16; + _data[2] = d | (e | (f | g << 8) << 8) << 8; + _data[3] = h | (i | (j | k << 8) << 8) << 8; } /// /// Initializes a new instance of the structure by using the specified array of bytes. /// /// A 16-element byte array containing values with which to initialize the GUID. + /// is . + /// is not 16 bytes long." public Guid(byte[] b) { - if (b == null) + ArgumentNullException.ThrowIfNull(b); + #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - throw new ArgumentNullException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one if (b.Length != 16) -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one + { throw new ArgumentException(); + } #pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one - _a = b[3] << 24 | b[2] << 16 | b[1] << 8 | b[0]; - _b = (short)(b[5] << 8 | b[4]); - _c = (short)(b[7] << 8 | b[6]); - _d = b[8]; - _e = b[9]; - _f = b[10]; - _g = b[11]; - _h = b[12]; - _i = b[13]; - _j = b[14]; - _k = b[15]; + _data = new int[4]; + + int i = 0; + + for (int j = 0; j < 4; j++) + { + _data[j] = b[i] | (b[i + 1] | (b[i + 2] | b[i + 3] << 8) << 8) << 8; + i += 4; + } } /// - /// Creates a new based on the value in the string. The value is made up - /// of hex digits speared by the dash ("-"). The string may begin and end with - /// brackets ("{", "}"). - /// - /// The string must be of the form dddddddd-dddd-dddd-dddd-dddddddddddd. where - /// d is a hex digit. (That is 8 hex digits, followed by 4, then 4, then 4, - /// then 12) such as: "CA761232-ED42-11CE-BACD-00AA0057B223" + /// Initializes a new instance of the structure by using the value represented by the specified string. /// - /// String representation of new . - /// + /// + /// A string that contains a GUID in one of the following formats ("d" represents a hexadecimal digit whose case is ignored): + /// + /// 32 contiguous hexadecimal digits: + /// + /// dddddddddddddddddddddddddddddddd + /// + /// -or- + /// + /// Groups of 8, 4, 4, 4, and 12 hexadecimal digits with hyphens between the groups. The entire GUID can optionally be enclosed in matching braces or parentheses: + /// + /// dddddddd-dddd-dddd-dddd-dddddddddddd + /// + /// -or- + /// + /// {dddddddd-dddd-dddd-dddd-dddddddddddd} + /// + /// -or- + /// + /// (dddddddd-dddd-dddd-dddd-dddddddddddd) + /// + /// -or- + /// + /// Groups of 8, 4, and 4 hexadecimal digits, and a subset of eight groups of 2 hexadecimal digits, with each group prefixed by "0x" or "0X", and separated by commas. The entire GUID, as well as the subset, is enclosed in matching braces: + /// + /// {0xdddddddd, 0xdddd, 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}} + /// + /// All braces, commas, and "0x" prefixes are required. All embedded spaces are ignored. All leading zeros in a group are ignored. + /// + /// The hexadecimal digits shown in a group are the maximum number of meaningful hexadecimal digits that can appear in that group. You can specify from 1 to the number of hexadecimal digits shown for a group. The specified digits are assumed to be the low-order digits of the group. + /// + /// is ." + /// is not in a recognized format. public Guid(string g) { - if (!TryParseGuidWithDashes(g, out this)) + ArgumentNullException.ThrowIfNull(g); + +#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one + if (!TryParseGuidWithDashes( + g, + out this)) { - throw new ArgumentException("Guid string not in expected format: [{]dddddddd-dddd-dddd-dddd-dddddddddddd[}]"); + throw new ArgumentException(); } +#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one } /// /// Compares this instance to a specified object and returns an indication of their relative values. /// - /// Guid instance to compare, or null. - /// Indication of the relative values (0 = equal, -1 = this instance less, +1 = this instance greater) - public int CompareTo(Object value) + /// An object to compare, or . + /// A signed number indicating the relative values of this instance and value. + /// (0 = This instance is equal to ., -1 = This instance is less than ., +1 = This instance is greater than , or is .) + /// is not a . + public int CompareTo(object value) { if (value == null) { return 1; } - if (!(value is Guid)) - { -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - throw new ArgumentException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one - } - - Guid g = (Guid)value; - if (g._a != _a) - { - return GetResult((uint)_a, (uint)g._a); - } - - if (g._b != _b) - { - return GetResult((uint)_b, (uint)g._b); - } - - if (g._c != _c) - { - return GetResult((uint)_c, (uint)g._c); - } - - if (g._d != _d) - { - return GetResult((uint)_d, (uint)g._d); - } - - if (g._e != _e) - { - return GetResult((uint)_e, (uint)g._e); - } - - if (g._f != _f) - { - return GetResult((uint)_f, (uint)g._f); - } - - if (g._g != _g) - { - return GetResult((uint)_g, (uint)g._g); - } - - if (g._h != _h) - { - return GetResult((uint)_h, (uint)g._h); - } - - if (g._i != _i) +#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one + if (value is not Guid) { - return GetResult((uint)_i, (uint)g._i); + throw new ArgumentException(); } +#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (g._j != _j) - { - return GetResult((uint)_j, (uint)g._j); - } + int[] other = ((Guid)value)._data; + other ??= new int[4]; - if (g._k != _k) + for (int i = 0; i < 4; i++) { - return GetResult((uint)_k, (uint)g._k); + if (_data[i] != other[i]) + { + return _data[i] - other[i]; + } } return 0; @@ -223,30 +220,26 @@ public int CompareTo(Object value) /// A 16-element byte array. public byte[] ToByteArray() { - byte[] g = new byte[16]; - - g[0] = (byte)(_a); - g[1] = (byte)(_a >> 8); - g[2] = (byte)(_a >> 16); - g[3] = (byte)(_a >> 24); - g[4] = (byte)(_b); - g[5] = (byte)(_b >> 8); - g[6] = (byte)(_c); - g[7] = (byte)(_c >> 8); - g[8] = _d; - g[9] = _e; - g[10] = _f; - g[11] = _g; - g[12] = _h; - g[13] = _i; - g[14] = _j; - g[15] = _k; - - return g; + byte[] buffer = new byte[16]; + + int index = 0; + + for (int i = 0; i < 4; i++) + { + int value = _data[i]; + + for (int j = 0; j < 4; j++) + { + buffer[index++] = (byte)(value & 0xFF); + value = value >> 8; + } + } + + return buffer; } /// - /// Returns a string representation of the value of this instance of the structure. + /// Returns a string representation of the value of this instance in registry format. /// /// The value of this Guid, formatted by using the "D" format specifier as follows: /// @@ -256,7 +249,7 @@ public byte[] ToByteArray() /// public override string ToString() { - // default format is dddddddd-dddd-dddd-dddd-dddddddddddd + _data ??= new int[4]; byte[] bytes = ToByteArray(); @@ -305,41 +298,20 @@ public override string ToString() /// /// Returns a value that indicates whether this instance is equal to a specified object. /// - /// The object to compare with this instance. - /// - public override bool Equals(Object obj) + /// The object to compare with this instance. + /// if is a that has the same value as this instance; otherwise, . + /// Two objects are equal if they have identical byte values. + public override bool Equals(object o) { - Guid g; - // Check that o is a Guid first - if (obj == null || !(obj is Guid)) + if (o is not Guid) + { return false; - else g = (Guid)obj; + } - // Now compare each of the elements - if (g._a != _a) - return false; - if (g._b != _b) - return false; - if (g._c != _c) - return false; - if (g._d != _d) - return false; - if (g._e != _e) - return false; - if (g._f != _f) - return false; - if (g._g != _g) - return false; - if (g._h != _h) - return false; - if (g._i != _i) - return false; - if (g._j != _j) - return false; - if (g._k != _k) - return false; + int[] other = ((Guid)o)._data; + other ??= new int[4]; - return true; + return (_data[0] == other[0]) && (_data[1] == other[1]) && (_data[2] == other[2]) && (_data[3] == other[3]); } /// @@ -348,7 +320,7 @@ public override bool Equals(Object obj) /// The hash code for this instance. public override int GetHashCode() { - return _a ^ (((int)_b << 16) | (int)(ushort)_c) ^ (((int)_f << 24) | _k); + return _data[0] ^ _data[1] ^ _data[2] ^ _data[3]; } /// @@ -369,20 +341,6 @@ private static char HexToChar(int a) return (char)((a > 9) ? a - 10 + 0x61 : a + 0x30); } - private int GetResult(uint me, uint them) - { - if (me < them) - { - return -1; - } - else if (me > them) - { - return 1; - } - - return 0; - } - /// /// Creates a new based on the value in the string. The value is made up /// of hex digits speared by the dash ("-"). The string may begin and end with @@ -392,16 +350,17 @@ private int GetResult(uint me, uint them) /// d is a hex digit. (That is 8 hex digits, followed by 4, then 4, then 4, /// then 12) such as: "CA761232-ED42-11CE-BACD-00AA0057B223" /// - /// Guid string to parse. - /// Resulting Guid. - /// - public static bool TryParseGuidWithDashes(String guidString, out Guid result) + /// A string containing the GUID to convert. + /// When this method returns, contains the parsed value. If the method returns , result contains a valid . If the method returns , result equals . + /// if the parse operation was successful; otherwise, . + public static bool TryParseGuidWithDashes( + string guidString, + out Guid result) { int startPos = 0; int temp; long templ; - int currentPos = 0; - result = Guid.Empty; + result = Empty; // check to see that it's the proper length if (guidString[0] == '{') @@ -425,35 +384,35 @@ public static bool TryParseGuidWithDashes(String guidString, out Guid result) return false; } - currentPos = startPos; + int currentPos = startPos; try { - result._a = (int)HexStringToLong(guidString, ref currentPos, 8); - ++currentPos; // Increment past the '-' - result._b = (short)HexStringToLong(guidString, ref currentPos, 4); - ++currentPos; // Increment past the '-' - result._c = (short)HexStringToLong(guidString, ref currentPos, 4); - ++currentPos; // Increment past the '-' + result._data[0] = (int)HexStringToLong(guidString, ref currentPos, 8); + + // Increment past the '-' + ++currentPos; + + result._data[1] = (ushort)HexStringToLong(guidString, ref currentPos, 4) + | ((ushort)HexStringToLong(guidString, ref currentPos, 4) << 16); + + // Increment past the '-' + ++currentPos; + temp = (int)HexStringToLong(guidString, ref currentPos, 4); - ++currentPos; // Increment past the '-' + + // Increment past the '-' + ++currentPos; + templ = HexStringToLong(guidString, ref currentPos, 12); } catch { - result = Guid.Empty; + result = Empty; return false; } - result._d = (byte)(temp >> 8); - result._e = (byte)(temp); - temp = (int)(templ >> 32); - result._f = (byte)(temp >> 8); - result._g = (byte)(temp); - temp = (int)(templ); - result._h = (byte)(temp >> 24); - result._i = (byte)(temp >> 16); - result._j = (byte)(temp >> 8); - result._k = (byte)(temp); + result._data[2] = temp | (int)(templ >> 32) << 16; + result._data[3] = (int)templ; return true; } @@ -465,7 +424,7 @@ public static bool TryParseGuidWithDashes(String guidString, out Guid result) /// The position of the hex sub-string within str. /// The length of the hex sub-string. /// False if any character is not a hex digit or string is shorter than needed for the requiredLength. Otherwise true. - private static long HexStringToLong(String str, ref int parsePos, int requiredLength) + private static long HexStringToLong(string str, ref int parsePos, int requiredLength) { long result = Convert.ToInt64(str.Substring(parsePos, requiredLength), 16); parsePos += requiredLength; From 2925e1b8a573303f37ca8e9234536b039fa53caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 25 Feb 2025 05:13:59 +0000 Subject: [PATCH 46/70] Remove types to exclude from project file (#234) ***NO_CI*** (cherry picked from commit da7ea10fe8512ba76847ca9b4571176bb6522ca2) --- .../CoreLibrary.NoReflection.nfproj | 212 ----------------- nanoFramework.CoreLibrary/CoreLibrary.nfproj | 217 +----------------- .../EditorBrowsableAttribute.cs | 1 + nanoFramework.CoreLibrary/System/Convert.cs | 1 + nanoFramework.CoreLibrary/System/DateTime.cs | 2 + nanoFramework.CoreLibrary/System/DayOfWeek.cs | 5 +- nanoFramework.CoreLibrary/System/Decimal.cs | 1 + .../System/Diagnostics/DebuggerAttributes.cs | 4 + .../System/IO/IOException.cs | 5 +- .../System/Reflection/AssemblyNameFlags.cs | 6 +- .../System/Reflection/MemberTypes.cs | 4 +- .../CompilerServices/ExtensionAttribute.cs | 1 + .../CompilerServices/MethodImplAttribute.cs | 2 +- .../System/Threading/ThreadPriority.cs | 2 - nanoFramework.CoreLibrary/System/Type.cs | 4 +- 15 files changed, 30 insertions(+), 437 deletions(-) diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 61ec73e2..429dc37d 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -227,218 +227,6 @@ - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index ab132cce..acdd3b3a 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -220,221 +220,6 @@ - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - - false - - @@ -466,4 +251,4 @@ - \ No newline at end of file + diff --git a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs index 3e92cea4..9508b477 100644 --- a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs @@ -10,6 +10,7 @@ namespace System.ComponentModel /// /// Specifies the browsable state of a property or method from within an editor. /// + [ExcludeType] public enum EditorBrowsableState { /// diff --git a/nanoFramework.CoreLibrary/System/Convert.cs b/nanoFramework.CoreLibrary/System/Convert.cs index 6c96d256..dbaa3a37 100644 --- a/nanoFramework.CoreLibrary/System/Convert.cs +++ b/nanoFramework.CoreLibrary/System/Convert.cs @@ -9,6 +9,7 @@ namespace System /// Specifies whether relevant Convert.ToBase64CharArray and Convert.ToBase64String methods insert line breaks in their output. /// [Flags] + [ExcludeType] public enum Base64FormattingOptions { /// diff --git a/nanoFramework.CoreLibrary/System/DateTime.cs b/nanoFramework.CoreLibrary/System/DateTime.cs index cb9f3cd6..ed428be6 100644 --- a/nanoFramework.CoreLibrary/System/DateTime.cs +++ b/nanoFramework.CoreLibrary/System/DateTime.cs @@ -17,6 +17,7 @@ namespace System /// nanoFramework doesn't support local time, only UTC, so it's not possible to specify . /// [Serializable] + [ExcludeType] public enum DateTimeKind { /// @@ -152,6 +153,7 @@ public struct DateTime // this enum is used to make the call to get date part // keep in sync with native + [ExcludeType] private enum DateTimePart { Year, diff --git a/nanoFramework.CoreLibrary/System/DayOfWeek.cs b/nanoFramework.CoreLibrary/System/DayOfWeek.cs index fa395bcc..9bb828d4 100644 --- a/nanoFramework.CoreLibrary/System/DayOfWeek.cs +++ b/nanoFramework.CoreLibrary/System/DayOfWeek.cs @@ -1,12 +1,15 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.CompilerServices; + namespace System { /// /// Specifies the day of the week. /// [Serializable] + [ExcludeType] public enum DayOfWeek { /// diff --git a/nanoFramework.CoreLibrary/System/Decimal.cs b/nanoFramework.CoreLibrary/System/Decimal.cs index 143e8295..a44654a0 100644 --- a/nanoFramework.CoreLibrary/System/Decimal.cs +++ b/nanoFramework.CoreLibrary/System/Decimal.cs @@ -12,6 +12,7 @@ namespace System /// /// Represents a decimal number. /// + [ExcludeType] [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] public struct Decimal { diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs index 9a325b4b..fc80ca23 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs @@ -89,12 +89,14 @@ public DebuggerNonUserCodeAttribute() { } /// Modifies code generation for runtime just-in-time (JIT) debugging. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module)] + [ExcludeType] public sealed class DebuggableAttribute : Attribute { /// /// Specifies the debugging mode for the just-in-time (JIT) compiler. /// [Flags] + [ExcludeType] public enum DebuggingModes { /// @@ -187,6 +189,7 @@ public DebuggingModes DebuggingFlags /// /// Provides display instructions for the debugger. /// + [ExcludeType] public enum DebuggerBrowsableState { /// @@ -207,6 +210,7 @@ public enum DebuggerBrowsableState /// Determines if and how a member is displayed in the debugger variable windows. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + [ExcludeType] public sealed class DebuggerBrowsableAttribute : Attribute { private readonly DebuggerBrowsableState _state; diff --git a/nanoFramework.CoreLibrary/System/IO/IOException.cs b/nanoFramework.CoreLibrary/System/IO/IOException.cs index 3d3bc803..e62b9003 100644 --- a/nanoFramework.CoreLibrary/System/IO/IOException.cs +++ b/nanoFramework.CoreLibrary/System/IO/IOException.cs @@ -1,6 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.CompilerServices; + namespace System.IO { /// @@ -12,6 +14,7 @@ public class IOException : SystemException /// /// Provides values for error codes. /// + [ExcludeType] public enum IOExceptionErrorCode { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs index 265284d5..6a54ec6f 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION @@ -6,11 +6,14 @@ namespace System.Reflection { using System; + using System.Runtime.CompilerServices; + /// /// Provides information about an Assembly reference. /// /// Available only in mscorlib build with support for System.Reflection. [Serializable, Flags] + [ExcludeType] public enum AssemblyNameFlags { /// @@ -40,6 +43,7 @@ public enum AssemblyNameFlags /// Identifies the processor and bits-per-word of the platform targeted by an executable. /// [Serializable] + [ExcludeType] public enum ProcessorArchitecture { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs index 744d1e13..b629738f 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION @@ -6,12 +6,14 @@ namespace System.Reflection { using System; + using System.Runtime.CompilerServices; /// /// Marks each type of member that is defined as a derived class of MemberInfo. /// /// Available only in mscorlib build with support for System.Reflection. [Serializable] + [ExcludeType] public enum MemberTypes { /// diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs index 64aaa96e..47382f69 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExtensionAttribute.cs @@ -6,6 +6,7 @@ namespace System.Runtime.CompilerServices /// /// Indicates that a method is an extension method, or that a class or assembly contains extension methods. /// + [ExcludeType] [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] public sealed class ExtensionAttribute : Attribute { } } diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs index 4122f9d8..c65938d7 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs @@ -66,6 +66,7 @@ public enum MethodCodeType /// Specifies the details of how a method is implemented. This class cannot be inherited. /// [Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [ExcludeType] public sealed class MethodImplAttribute : Attribute { internal MethodImplOptions _val; @@ -107,5 +108,4 @@ public MethodImplAttribute() /// public MethodImplOptions Value { get { return _val; } } } - } diff --git a/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs b/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs index 451e77bf..258a6cb6 100644 --- a/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs +++ b/nanoFramework.CoreLibrary/System/Threading/ThreadPriority.cs @@ -32,5 +32,3 @@ public enum ThreadPriority } } - - diff --git a/nanoFramework.CoreLibrary/System/Type.cs b/nanoFramework.CoreLibrary/System/Type.cs index f47444c7..d7a134f5 100644 --- a/nanoFramework.CoreLibrary/System/Type.cs +++ b/nanoFramework.CoreLibrary/System/Type.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #if NANOCLR_REFLECTION @@ -97,7 +97,7 @@ public abstract Assembly Assembly /// The object that refers to the type. /// The type referenced by the specified RuntimeTypeHandle, or null if the Value property of handle is null. [MethodImpl(MethodImplOptions.InternalCall)] - public static extern Type GetTypeFromHandle(RuntimeTypeHandle handle); + public extern static Type GetTypeFromHandle(RuntimeTypeHandle handle); /// /// Gets the fully qualified name of the type, including its namespace but not its assembly. From 0fef780c0e99d49181ce12cbeec70d6778e702d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 25 Feb 2025 11:25:31 +0000 Subject: [PATCH 47/70] Rework ArgumentNullException (#235) ***NO_CI*** (cherry picked from commit c836380f2ea103f261e7e59cba2910e8045290e2) --- nanoFramework.CoreLibrary/System/Convert.cs | 22 +++++++------------ nanoFramework.CoreLibrary/System/String.cs | 12 +++------- .../System/TargetFrameworkAttribute.cs | 7 +++--- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Convert.cs b/nanoFramework.CoreLibrary/System/Convert.cs index dbaa3a37..e040ec9c 100644 --- a/nanoFramework.CoreLibrary/System/Convert.cs +++ b/nanoFramework.CoreLibrary/System/Convert.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; @@ -479,9 +479,7 @@ public static float ToSingle(string value) /// The String representation, in base 64, of the contents of . public static string ToBase64String(byte[] inArray) { -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (inArray == null) throw new ArgumentNullException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one + ArgumentNullException.ThrowIfNull(inArray); return ToBase64String(inArray, 0, inArray.Length, Base64FormattingOptions.None); } @@ -494,9 +492,7 @@ public static string ToBase64String(byte[] inArray) /// The string representation in base 64 of the elements in . public static String ToBase64String(byte[] inArray, Base64FormattingOptions options) { -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (inArray == null) throw new ArgumentNullException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one + ArgumentNullException.ThrowIfNull(inArray); return ToBase64String(inArray, 0, inArray.Length, options); } @@ -523,10 +519,9 @@ public static String ToBase64String(byte[] inArray, int offset, int length) /// The string representation in base 64 of elements of , starting at position . public static string ToBase64String(byte[] inArray, int offset, int length, Base64FormattingOptions options) { - //Do data verfication -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (inArray == null) throw new ArgumentNullException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one + // Do data verfication + ArgumentNullException.ThrowIfNull(inArray); + #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one if (length < 0) throw new ArgumentOutOfRangeException(); #pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one @@ -564,9 +559,8 @@ public static string ToBase64String(byte[] inArray, int offset, int length, Base /// An array of 8-bit unsigned integers equivalent to elements at position in . public static byte[] FromBase64CharArray(char[] inArray, int offset, int length) { -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (inArray == null) throw new ArgumentNullException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one + ArgumentNullException.ThrowIfNull(inArray); + #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one if (length < 0) throw new ArgumentOutOfRangeException(); #pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one diff --git a/nanoFramework.CoreLibrary/System/String.cs b/nanoFramework.CoreLibrary/System/String.cs index d29b84cf..fdcf2909 100644 --- a/nanoFramework.CoreLibrary/System/String.cs +++ b/nanoFramework.CoreLibrary/System/String.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics.CodeAnalysis; @@ -863,10 +863,7 @@ public bool Contains(string value) /// is . public bool StartsWith(string value) { - if ((object)value == null) - { - throw new ArgumentNullException(); - } + ArgumentNullException.ThrowIfNull(value); if ((object)this == value) { @@ -895,10 +892,7 @@ public bool StartsWith(string value) /// if matches the end of this instance; otherwise, . public bool EndsWith(string value) { - if ((object)value == null) - { - throw new ArgumentNullException(); - } + ArgumentNullException.ThrowIfNull(value); if ((object)this == value) { diff --git a/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs b/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs index b29e5d6a..b9502344 100644 --- a/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs +++ b/nanoFramework.CoreLibrary/System/TargetFrameworkAttribute.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Runtime.Versioning @@ -19,9 +19,8 @@ public sealed class TargetFrameworkAttribute : Attribute /// public TargetFrameworkAttribute(String frameworkName) { -#pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (frameworkName == null) throw new ArgumentNullException(); -#pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one + ArgumentNullException.ThrowIfNull(frameworkName); + _frameworkName = frameworkName; } From b34f23372e1e50f67c49c274fa8ea0bf934044ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 28 Feb 2025 18:03:47 +0000 Subject: [PATCH 48/70] Fix inclusion of DefaultMemberAttribute in no reflection version (#239) ***NO_CI*** (cherry picked from commit 257e93234168f13e701850c478ee528e7baf6cd1) --- .../System/Reflection/DefaultMemberAttribute.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs index 5505040c..29116fe9 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs @@ -1,10 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; -#if NANOCLR_REFLECTION - namespace System.Reflection { using System; @@ -18,17 +16,15 @@ namespace System.Reflection [Serializable] public sealed class DefaultMemberAttribute : Attribute { - private readonly String _memberName; - // You must provide the name of the member, this is required /// /// Initializes a new instance of the DefaultMemberAttribute class. /// /// A String containing the name of the member to invoke. This may be a constructor, method, property, or field. /// A suitable invocation attribute must be specified when the member is invoked. The default member of a class can be specified by passing an empty String as the name of the member. - public DefaultMemberAttribute(String memberName) + public DefaultMemberAttribute(string memberName) { - _memberName = memberName; + MemberName = memberName; } /// @@ -37,11 +33,6 @@ public DefaultMemberAttribute(String memberName) /// /// A string representing the member name. /// - public String MemberName - { - get { return _memberName; } - } + public string MemberName { get; } } } - -#endif // NANOCLR_REFLECTION From a26c47906099329a439572063fd0752f9103356b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 28 Feb 2025 18:23:07 +0000 Subject: [PATCH 49/70] Fix TestFramework clone project (#238) ***NO_CI*** (cherry picked from commit e27a6b61178b90063e6d93868a6f080646eef0ac) --- Tests/TestFramework/TestFramework.nfproj | 18 ++++++++---------- nanoFramework.TestFramework | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Tests/TestFramework/TestFramework.nfproj b/Tests/TestFramework/TestFramework.nfproj index 22b7869c..10e7fb24 100644 --- a/Tests/TestFramework/TestFramework.nfproj +++ b/Tests/TestFramework/TestFramework.nfproj @@ -30,15 +30,13 @@ - - - - - - - - - + + + + + + + @@ -50,4 +48,4 @@ - \ No newline at end of file + diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index fb7f57a9..3b48df79 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit fb7f57a9cc20dd0fa46645b8f3c45c9d68ce6fa2 +Subproject commit 3b48df792339bc0bcd0a4d6572380821781b65f0 From d51b0361666561924430a294f2b93d704649d3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 10 Mar 2025 09:28:00 +0000 Subject: [PATCH 50/70] Fix `Guid.TryParseGuidWithDashes()` and `Guid` constructor with string parameter (#240) (cherry picked from commit 296050d292636d28d77492653c7367c15475b0f5) --- Tests/NFUnitTestSystemLib/UnitTestGuid.cs | 188 ++++++++++++++++++---- nanoFramework.CoreLibrary/System/Guid.cs | 122 ++++++++------ 2 files changed, 226 insertions(+), 84 deletions(-) diff --git a/Tests/NFUnitTestSystemLib/UnitTestGuid.cs b/Tests/NFUnitTestSystemLib/UnitTestGuid.cs index e2b3ea3b..a85d00fc 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGuid.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGuid.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -60,7 +60,7 @@ public void ByteArrayConstructor_Test2() /// /// - Byte[] guid16 = GetRandomBytes(16); + byte[] guid16 = GetRandomBytes(16); Guid myGuid1 = new Guid(guid16); } @@ -82,7 +82,7 @@ public void ArgumentException_Test3() { size = random.Next(100); } - Byte[] guidNot16 = GetRandomBytes(size); + byte[] guidNot16 = GetRandomBytes(size); Assert.ThrowsException(typeof(ArgumentException), () => { Guid myGuid1 = new Guid(guidNot16); }); } @@ -95,7 +95,7 @@ public void ArgumentNullException_Test4() /// /// - Byte[] nullByte = null; + byte[] nullByte = null; Assert.ThrowsException(typeof(ArgumentNullException), () => { Guid myGuid1 = new Guid(nullByte); }); } @@ -157,11 +157,11 @@ public void Int_Short_Constructor_Test6() /// Random random = new Random(); - int _int = random.Next(Int32.MaxValue); + int _int = random.Next(int.MaxValue); short _short1 = (short)random.Next(32768); short _short2 = (short)random.Next(32768); - Byte[] _bArr = GetRandomBytes(8); - Guid _guid = new Guid(_int, _short1, _short2, _bArr[0], _bArr[1], _bArr[2], _bArr[3], _bArr[4], _bArr[5], _bArr[6], _bArr[7]); + byte[] _bArr = GetRandomBytes(8); + _ = new Guid(_int, _short1, _short2, _bArr[0], _bArr[1], _bArr[2], _bArr[3], _bArr[4], _bArr[5], _bArr[6], _bArr[7]); } [TestMethod] @@ -174,11 +174,11 @@ public void UInt_Ushort_Constructor_Test7() /// Random random = new Random(); - int randoInt = random.Next(Int32.MaxValue); + int randoInt = random.Next(int.MaxValue); uint _uInt = (uint)(randoInt * 2); ushort _uShort1 = (ushort)random.Next(65536); ushort _uShort2 = (ushort)random.Next(65536); - Byte[] _bArr = GetRandomBytes(8); + byte[] _bArr = GetRandomBytes(8); Guid _guid = new Guid(_uInt, _uShort1, _uShort1, _bArr[0], _bArr[1], _bArr[2], _bArr[3], _bArr[4], _bArr[5], _bArr[6], _bArr[7]); } @@ -192,7 +192,7 @@ public void Guid_Empty_Test8() /// /// Guid guid = Guid.Empty; - Byte[] _bArr = guid.ToByteArray(); + byte[] _bArr = guid.ToByteArray(); for (int i = 0; i < 16; i++) { Assert.AreEqual(_bArr[i], (byte)0); @@ -211,26 +211,21 @@ public void Guid_CompareTo_Test9() Guid guid1 = Guid.Empty; // Verifing any instance of Guid, regardless of its value, is greater than null Assert.AreEqual(guid1.CompareTo(null), 1); - Byte[] _bArr = new Byte[16]; + byte[] _bArr = new byte[16]; + // Creating a Guid with all bytes zero Guid guid2 = new Guid(_bArr); Assert.AreEqual(guid1.CompareTo(guid2), 0); + Guid guid3 = new Guid(0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3d); - if (guid3.CompareTo(guid1) <= 0) - { - throw new Exception("Expected : " + guid3.ToString() + " is greater than " + guid1.ToString()); - } + Assert.IsTrue(guid3.CompareTo(guid1) > 0, "Expected : " + guid3.ToString() + " is greater than " + guid1.ToString()); + Guid guid4 = new Guid(0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3d); Assert.AreEqual(guid4.CompareTo(guid3), 0); + Guid guid5 = new Guid(0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3e); - if (guid5.CompareTo(guid4) <= 0) - { - throw new Exception("Expected : " + guid5.ToString() + " is greater than " + guid4.ToString()); - } - if (guid4.CompareTo(guid5) >= 0) - { - throw new Exception("Expected : " + guid4.ToString() + " is less than " + guid5.ToString()); - } + Assert.IsTrue(guid5.CompareTo(guid4) > 0, "Expected : " + guid5.ToString() + " is greater than " + guid4.ToString()); + Assert.IsTrue(guid4.CompareTo(guid5) < 0, "Expected : " + guid4.ToString() + " is less than " + guid5.ToString()); } [TestMethod] @@ -242,25 +237,34 @@ public void Guid_ToString_Test10() /// /// - String[] strArr1 = new String[] { "00000000-0000-0000-0000-000000000000", + string[] strArr1 = new string[] + { + "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "4dff36b5-9dde-4f76-9a2a-96435047063d", - "ffffffff-ffff-ffff-ffff-ffffffffffff"}; + "ffffffff-ffff-ffff-ffff-ffffffffffff" + }; + Guid guid1 = Guid.Empty; - Byte[] _byteArr1 = new Byte[16]; + byte[] _byteArr1 = new byte[16]; Guid guid2 = new Guid(_byteArr1); Guid guid3 = new Guid(0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3d); - Byte[] _byteArr2 = new Byte[16]; + + byte[] _byteArr2 = new byte[16]; + for (int i = 0; i < _byteArr2.Length; i++) { - _byteArr2[i] = Byte.MaxValue; + _byteArr2[i] = byte.MaxValue; } + Guid guid4 = new Guid(_byteArr2); - String[] strArr2 = new String[] { guid1.ToString(), guid2.ToString(), guid3.ToString(), guid4.ToString() }; + + string[] strArr2 = new string[] { guid1.ToString(), guid2.ToString(), guid3.ToString(), guid4.ToString() }; + for (int i = 0; i < strArr1.Length; i++) { OutputHelper.WriteLine(strArr1[i]); - Assert.AreEqual(String.Compare(strArr1[i], strArr2[i]), 0); + Assert.AreEqual(string.Compare(strArr1[i], strArr2[i]), 0); } } @@ -280,11 +284,14 @@ public void Guid_Equals_Test11() Guid[] gArr1 = new Guid[] { guid11, guid12, guid13 }; // Creating Guids with 16 bytes constructor - Byte[] _bArr1 = new Byte[16]; + byte[] _bArr1 = new byte[16]; + Guid guid21 = new Guid(_bArr1); - Byte[] _bArr2 = new Byte[] { 181, 54, 255, 77, 222, 157, 118, 79, 154, 42, 150, 67, 80, 71, 6, 61 }; + byte[] _bArr2 = new byte[] { 181, 54, 255, 77, 222, 157, 118, 79, 154, 42, 150, 67, 80, 71, 6, 61 }; + Guid guid22 = new Guid(_bArr2); - Byte[] _bArr3 = new Byte[] { 255, 255, 255, 127, 255, 127, 255, 127, 255, 255, 255, 255, 255, 255, 255, 255 }; + byte[] _bArr3 = new byte[] { 255, 255, 255, 127, 255, 127, 255, 127, 255, 255, 255, 255, 255, 255, 255, 255 }; + Guid guid23 = new Guid(_bArr3); Guid[] gArr2 = new Guid[] { guid21, guid22, guid23 }; @@ -315,5 +322,120 @@ public void Guid_Equals_Test11() } } + [DataRow("00000000-0000-0000-0000-000000000000")] + [DataRow("4dff36b5-9dde-4f76-9a2a-96435047063d")] + [DataRow("ffffffff-ffff-ffff-ffff-ffffffffffff")] + [DataRow("a8a110d5-fc49-43c5-bf46-802db8f843ff")] + [DataRow("44332211-6655-8877-9900-aabbccddeeff")] + [DataRow("11223344-5566-7788-9900-aabbccddeeff")] + [TestMethod] + public void Ctor_FromString_Test00(string guidString) + { + /// + /// 1. Creates a Guid from a string + /// 2. Verifies the Guid is created correctly + /// + + Guid guid = new Guid(guidString); + + Assert.AreEqual(guidString, guid.ToString()); + } + [DataRow("{00000000-0000-0000-0000-000000000000}")] + [DataRow("{4dff36b5-9dde-4f76-9a2a-96435047063d}")] + [DataRow("{ffffffff-ffff-ffff-ffff-ffffffffffff}")] + [DataRow("{a8a110d5-fc49-43c5-bf46-802db8f843ff}")] + [DataRow("{44332211-6655-8877-9900-aabbccddeeff}")] + [DataRow("{11223344-5566-7788-9900-aabbccddeeff}")] + [TestMethod] + public void Ctor_FromString_Test01(string guidString) + { + /// + /// 1. Creates a Guid from a string + /// 2. Verifies the Guid is created correctly + /// + + Guid guid = new Guid(guidString); + + Assert.AreEqual(guidString, $"{{{guid.ToString()}}}"); + } + + [TestMethod] + public void Ctor_FromString_Test02() + { + Guid testGuid = new Guid("a8a110d5-fc49-43c5-bf46-802db8f843ff"); + Guid fullGuid = new Guid(uint.MaxValue, ushort.MaxValue, ushort.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); + + Assert.AreEqual(new Guid("ffffffff-ffff-ffff-ffff-ffffffffffff"), fullGuid); + Assert.AreEqual((new Guid("a8a110d5-fc49-43c5-bf46-802db8f843ff")).ToString(), testGuid.ToString()); + } + + [TestMethod] + public void Guid_ByteArray_Test() + { + object[][] testData = new object[][] + { + new object[] { Guid.Empty, new byte[16] }, + new object[] { new Guid("44332211-6655-8877-9900-aabbccddeeff"), new byte[] { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF } }, + new object[] { new Guid("11223344-5566-7788-9900-aabbccddeeff"), new byte[] { 0x44, 0x33, 0x22, 0x11, 0x66, 0x55, 0x88, 0x77, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF } }, + new object[] { new Guid("a8a110d5-fc49-43c5-bf46-802db8f843ff"), new byte[] { 0xd5, 0x10, 0xa1, 0xa8, 0x49, 0xfc, 0xc5, 0x43, 0xbf, 0x46, 0x80, 0x2d, 0xb8, 0xf8, 0x43, 0xff } } + }; + + foreach (object[] item in testData) + { + Guid guid = new Guid((byte[])item[1]); + + OutputHelper.WriteLine($"Actual: {guid}"); + OutputHelper.WriteLine($"Expected: {item[0]}"); + + Assert.AreEqual(item[0], guid); + } + } + + [TestMethod] + public void Ctor_NullByteArray_ThrowsArgumentNullException() + { + Assert.ThrowsException( + typeof(ArgumentNullException), + () => new Guid((byte[])null)); + } + + [DataRow(15)] + [DataRow(17)] + [TestMethod] + public void Ctor_InvalidLengthByteArray_ThrowsArgumentException(int length) + { + Assert.ThrowsException( + typeof(ArgumentException), + () => new Guid(new byte[length])); + } + + [TestMethod] + public void Ctor_UInt_UShort_UShort_Byte_Byte_Byte_Byte_Byte_Byte_Byte_Byte() + { + Guid guid = new Guid(0xa8a110d5, 0xfc49, 0x43c5, 0xbf, 0x46, 0x80, 0x2d, 0xb8, 0xf8, 0x43, 0xff); + Assert.AreEqual(new Guid("a8a110d5-fc49-43c5-bf46-802db8f843ff"), guid); + } + + [TestMethod] + public void NewGuid() + { + Guid guid1 = Guid.NewGuid(); + + Assert.AreNotEqual(Guid.Empty, guid1); + Assert.IsTrue((guid1.ToByteArray()[7] & 0xF0) == 0x40); + + Guid guid2 = Guid.NewGuid(); + + Assert.AreNotEqual(guid1, guid2); + Assert.IsTrue((guid2.ToByteArray()[7] & 0xF0) == 0x40); + } + + [TestMethod] + public void ToByteArray() + { + byte[] myGuidAsArray = new Guid("a8a110d5-fc49-43c5-bf46-802db8f843ff").ToByteArray(); + + CollectionAssert.AreEqual(new byte[] { 0xd5, 0x10, 0xa1, 0xa8, 0x49, 0xfc, 0xc5, 0x43, 0xbf, 0x46, 0x80, 0x2d, 0xb8, 0xf8, 0x43, 0xff }, myGuidAsArray); + } } } diff --git a/nanoFramework.CoreLibrary/System/Guid.cs b/nanoFramework.CoreLibrary/System/Guid.cs index 77794b61..6ccee863 100644 --- a/nanoFramework.CoreLibrary/System/Guid.cs +++ b/nanoFramework.CoreLibrary/System/Guid.cs @@ -135,12 +135,6 @@ public Guid(byte[] b) /// /// A string that contains a GUID in one of the following formats ("d" represents a hexadecimal digit whose case is ignored): /// - /// 32 contiguous hexadecimal digits: - /// - /// dddddddddddddddddddddddddddddddd - /// - /// -or- - /// /// Groups of 8, 4, 4, 4, and 12 hexadecimal digits with hyphens between the groups. The entire GUID can optionally be enclosed in matching braces or parentheses: /// /// dddddddd-dddd-dddd-dddd-dddddddddddd @@ -149,18 +143,6 @@ public Guid(byte[] b) /// /// {dddddddd-dddd-dddd-dddd-dddddddddddd} /// - /// -or- - /// - /// (dddddddd-dddd-dddd-dddd-dddddddddddd) - /// - /// -or- - /// - /// Groups of 8, 4, and 4 hexadecimal digits, and a subset of eight groups of 2 hexadecimal digits, with each group prefixed by "0x" or "0X", and separated by commas. The entire GUID, as well as the subset, is enclosed in matching braces: - /// - /// {0xdddddddd, 0xdddd, 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}} - /// - /// All braces, commas, and "0x" prefixes are required. All embedded spaces are ignored. All leading zeros in a group are ignored. - /// /// The hexadecimal digits shown in a group are the maximum number of meaningful hexadecimal digits that can appear in that group. You can specify from 1 to the number of hexadecimal digits shown for a group. The specified digits are assumed to be the low-order digits of the group. /// /// is ." @@ -172,11 +154,13 @@ public Guid(string g) #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one if (!TryParseGuidWithDashes( g, - out this)) + out Guid result)) { throw new ArgumentException(); } #pragma warning restore S3928 // Parameter names used into ArgumentException constructors should match an existing one + + this = result; } /// @@ -342,78 +326,114 @@ private static char HexToChar(int a) } /// - /// Creates a new based on the value in the string. The value is made up - /// of hex digits speared by the dash ("-"). The string may begin and end with - /// brackets ("{", "}"). - /// - /// The string must be of the form dddddddd-dddd-dddd-dddd-dddddddddddd. where - /// d is a hex digit. (That is 8 hex digits, followed by 4, then 4, then 4, - /// then 12) such as: "CA761232-ED42-11CE-BACD-00AA0057B223" + /// Converts the string representation of a GUID to the equivalent structure. /// - /// A string containing the GUID to convert. + /// A string containing the GUID to convert. /// When this method returns, contains the parsed value. If the method returns , result contains a valid . If the method returns , result equals . /// if the parse operation was successful; otherwise, . + /// + /// The .NET nanoFramework implementation of this method only supports 'D' and 'N' format specifiers. + /// + [Obsolete("This will be renamed to TryParse in a future version.")] public static bool TryParseGuidWithDashes( - string guidString, + string input, out Guid result) { int startPos = 0; - int temp; - long templ; - result = Empty; - // check to see that it's the proper length - if (guidString[0] == '{') + // because this is a struct we can't assign the Empty directly to result, + // otherwise it will overwrite the _data field of the struct, as this is a shallow copy + result = new Guid(Empty.ToByteArray()); + + // Check for optional surrounding braces + if (input[0] == '{') { - if (guidString.Length != 38 || guidString[37] != '}') + if (input.Length != 38 || input[37] != '}') { return false; } + startPos = 1; } - else if (guidString.Length != 36) + else if (input.Length != 36) { return false; } - if (guidString[8 + startPos] != '-' || - guidString[13 + startPos] != '-' || - guidString[18 + startPos] != '-' || - guidString[23 + startPos] != '-') + // Verify hyphen positions + if (input[8 + startPos] != '-' || + input[13 + startPos] != '-' || + input[18 + startPos] != '-' || + input[23 + startPos] != '-') { return false; } int currentPos = startPos; + try { - result._data[0] = (int)HexStringToLong(guidString, ref currentPos, 8); + // Data1: 8 hex digits + result._data[0] = (int)HexStringToLong(input, ref currentPos, 8); - // Increment past the '-' + // Skip dash ++currentPos; - result._data[1] = (ushort)HexStringToLong(guidString, ref currentPos, 4) - | ((ushort)HexStringToLong(guidString, ref currentPos, 4) << 16); + // Data2: 4 hex digits + ushort data2 = (ushort)HexStringToLong(input, ref currentPos, 4); - // Increment past the '-' + // Skip dash ++currentPos; - temp = (int)HexStringToLong(guidString, ref currentPos, 4); + // Data3: 4 hex digits + ushort data3 = (ushort)HexStringToLong(input, ref currentPos, 4); - // Increment past the '-' + // These values are already in big‑endian order as in the string + // They must be stored directly (without swapping) in the internal little‑endian representation + result._data[1] = data2 | (data3 << 16); + + // Skip dash ++currentPos; - templ = HexStringToLong(guidString, ref currentPos, 12); + // Data4 – first part: 4 hex digits (2 bytes) + ushort group4 = (ushort)HexStringToLong(input, ref currentPos, 4); + + // Skip dash + ++currentPos; + + // Data4 – second part: 12 hex digits (6 bytes) + long group5 = HexStringToLong(input, ref currentPos, 12); + + // For Data4, we need to convert from big‑endian to little‑endian + // Swap the 2-byte group + ushort group4_le = (ushort)(((group4 & 0xFF) << 8) | (group4 >> 8)); + + // Split the 6-byte group into its high 2 bytes and low 4 bytes + // high 16 bits (big‑endian) + ushort group5High = (ushort)(group5 >> 32); + + // low 32 bits (big‑endian) + uint group5Low = (uint)(group5 & 0xFFFFFFFF); + + // Swap bytes for each + ushort group5High_le = (ushort)(((group5High & 0xFF) << 8) | (group5High >> 8)); + uint group5Low_le = ((group5Low & 0xFF) << 24) | + (((group5Low >> 8) & 0xFF) << 16) | + (((group5Low >> 16) & 0xFF) << 8) | + ((group5Low >> 24) & 0xFF); + + // Combine the converted Data4 parts into _data[2] and _data[3] + // _data[2]: lower 16 bits from swapped group4, upper 16 bits from swapped group5High + result._data[2] = group4_le | (group5High_le << 16); + + // _data[3]: swapped group5Low + result._data[3] = (int)group5Low_le; } catch { - result = Empty; return false; } - result._data[2] = temp | (int)(templ >> 32) << 16; - result._data[3] = (int)templ; - return true; } From 4f1e809c66ea21167ef3366747be9b5268fb564f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 14 Mar 2025 14:32:57 +0000 Subject: [PATCH 51/70] Update test framework sub-module @5182f1f --- nanoFramework.TestFramework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index 3b48df79..5182f1f6 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit 3b48df792339bc0bcd0a4d6572380821781b65f0 +Subproject commit 5182f1f6064628e62c38861efa57dd83d412b585 From 778672c9ee60ad97a65da0b52ba6fb924849894b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 17 Mar 2025 19:05:58 +0000 Subject: [PATCH 52/70] Fix types wrongly excluded from metadata (cherry picked from commit ce90159f4d0c19a771684b6086a3c5b495e3eddd) --- nanoFramework.CoreLibrary/System/Convert.cs | 1 - nanoFramework.CoreLibrary/System/DateTime.cs | 1 - nanoFramework.CoreLibrary/System/DayOfWeek.cs | 1 - nanoFramework.CoreLibrary/System/IO/IOException.cs | 1 - nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs | 1 - nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs | 1 - 6 files changed, 6 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Convert.cs b/nanoFramework.CoreLibrary/System/Convert.cs index e040ec9c..7ce6ca90 100644 --- a/nanoFramework.CoreLibrary/System/Convert.cs +++ b/nanoFramework.CoreLibrary/System/Convert.cs @@ -9,7 +9,6 @@ namespace System /// Specifies whether relevant Convert.ToBase64CharArray and Convert.ToBase64String methods insert line breaks in their output. /// [Flags] - [ExcludeType] public enum Base64FormattingOptions { /// diff --git a/nanoFramework.CoreLibrary/System/DateTime.cs b/nanoFramework.CoreLibrary/System/DateTime.cs index ed428be6..7f5ce948 100644 --- a/nanoFramework.CoreLibrary/System/DateTime.cs +++ b/nanoFramework.CoreLibrary/System/DateTime.cs @@ -17,7 +17,6 @@ namespace System /// nanoFramework doesn't support local time, only UTC, so it's not possible to specify . /// [Serializable] - [ExcludeType] public enum DateTimeKind { /// diff --git a/nanoFramework.CoreLibrary/System/DayOfWeek.cs b/nanoFramework.CoreLibrary/System/DayOfWeek.cs index 9bb828d4..dbd4054a 100644 --- a/nanoFramework.CoreLibrary/System/DayOfWeek.cs +++ b/nanoFramework.CoreLibrary/System/DayOfWeek.cs @@ -9,7 +9,6 @@ namespace System /// Specifies the day of the week. /// [Serializable] - [ExcludeType] public enum DayOfWeek { /// diff --git a/nanoFramework.CoreLibrary/System/IO/IOException.cs b/nanoFramework.CoreLibrary/System/IO/IOException.cs index e62b9003..2f7fddc1 100644 --- a/nanoFramework.CoreLibrary/System/IO/IOException.cs +++ b/nanoFramework.CoreLibrary/System/IO/IOException.cs @@ -14,7 +14,6 @@ public class IOException : SystemException /// /// Provides values for error codes. /// - [ExcludeType] public enum IOExceptionErrorCode { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs index 6a54ec6f..280f8224 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyNameFlags.cs @@ -13,7 +13,6 @@ namespace System.Reflection /// /// Available only in mscorlib build with support for System.Reflection. [Serializable, Flags] - [ExcludeType] public enum AssemblyNameFlags { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs index b629738f..e5ed7429 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs @@ -13,7 +13,6 @@ namespace System.Reflection /// /// Available only in mscorlib build with support for System.Reflection. [Serializable] - [ExcludeType] public enum MemberTypes { /// From 67abf1926721e60abed9229ee75fbc69c5888086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 18 Mar 2025 19:23:45 +0000 Subject: [PATCH 53/70] Fix missing source file in project --- Tests/UnitTestLauncher/UnitTestLauncher.nfproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UnitTestLauncher/UnitTestLauncher.nfproj b/Tests/UnitTestLauncher/UnitTestLauncher.nfproj index b03d676e..646eace2 100644 --- a/Tests/UnitTestLauncher/UnitTestLauncher.nfproj +++ b/Tests/UnitTestLauncher/UnitTestLauncher.nfproj @@ -27,7 +27,7 @@ - + From 2b3ec897afa996732418c6d2aea3bf9250a1f857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 19 Mar 2025 19:13:34 +0000 Subject: [PATCH 54/70] Update test framework sub-module @c0a77fd --- nanoFramework.TestFramework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index 5182f1f6..c0a77fd1 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit 5182f1f6064628e62c38861efa57dd83d412b585 +Subproject commit c0a77fd1299ddf5bc57764642b31566b828b3aa3 From 601e5d73ada64128a225c7047cbaa0645db6d842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 21 Mar 2025 15:29:32 +0000 Subject: [PATCH 55/70] Add extra output to unit test to help debug --- .../UnitTestInitLocalTests.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs b/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs index fea53af7..93b37f48 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs @@ -49,6 +49,9 @@ public void SystemType1_GetType_Test() // ConstructorInfo) // NOTE: We add the reflection items to the ArrayList to assure that they can be properly // assigned to a object container (this used to lead to a access violation) + + OutputHelper.WriteLine("Testing Int32"); + Type type = typeof(int); list.Add(type); string name = ((Type)list[i]).Name; @@ -68,12 +71,16 @@ public void SystemType1_GetType_Test() //fRes &= name.ToLower() == "mscorlib"; //i++; + OutputHelper.WriteLine("Testing NFUnitTestSystemLib.UnitTestInitLocalTests+TestObj"); + type = Type.GetType("NFUnitTestSystemLib.UnitTestInitLocalTests+TestObj"); list.Add(type); name = ((Type)list[i]).Name; Assert.AreEqual(name, "TestObj"); i++; + OutputHelper.WriteLine("Testing IEmptyInterface"); + Type iface = type.GetInterfaces()[0]; list.Add(iface); name = ((Type)list[i]).Name; @@ -81,6 +88,8 @@ public void SystemType1_GetType_Test() Assert.AreEqual(iface.Name, "IEmptyInterface"); i++; + OutputHelper.WriteLine("Testing FieldInfo"); + FieldInfo fi = type.GetField("Field1"); list.Add(fi); name = ((FieldInfo)list[i]).Name; @@ -88,6 +97,8 @@ public void SystemType1_GetType_Test() Assert.AreEqual(fi.Name, "Field1"); i++; + OutputHelper.WriteLine("Testing MethodInfo"); + MethodInfo mi = type.GetMethod("Method1"); list.Add(mi); name = ((MethodInfo)list[i]).Name; @@ -95,6 +106,8 @@ public void SystemType1_GetType_Test() Assert.AreEqual(mi.Name, "Method1"); i++; + OutputHelper.WriteLine("Testing ConstructorInfo"); + ConstructorInfo ci = type.GetConstructor(new Type[] { }); list.Add(ci); name = ((ConstructorInfo)list[i]).Name; @@ -104,7 +117,10 @@ public void SystemType1_GetType_Test() // // Now test arrays of reflection types - // + // + + OutputHelper.WriteLine("Testing Array of Type"); + Type[] types = new Type[] { typeof(int), typeof(bool), Type.GetType("NFUnitTestSystemLib.UnitTestInitLocalTests+TestObj") }; list.Add(types[2]); name = ((Type)list[i]).Name; @@ -127,6 +143,8 @@ public void SystemType1_GetType_Test() //fRes &= asms[0].GetName().Name == "Microsoft.SPOT.Platform.Tests.Systemlib2"; //i++; + OutputHelper.WriteLine("Testing Array of FieldInfo"); + FieldInfo[] fis = new FieldInfo[] { types[2].GetField("Field1"), type.GetFields()[0] }; list.Add(fis[0]); name = ((FieldInfo)list[i]).Name; @@ -134,6 +152,8 @@ public void SystemType1_GetType_Test() Assert.AreEqual(fis[0].Name, "Field1"); i++; + OutputHelper.WriteLine("Testing Array of MethodInfo"); + MethodInfo[] mis = new MethodInfo[] { type.GetMethods()[2], types[2].GetMethod("Method2", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) }; list.Add(mis[1]); name = ((MethodInfo)list[i]).Name; @@ -141,6 +161,8 @@ public void SystemType1_GetType_Test() Assert.AreEqual(mis[1].Name, "Method2"); i++; + OutputHelper.WriteLine("Testing Array of ConstructorInfo"); + ConstructorInfo[] cis = new ConstructorInfo[] { types[2].GetConstructor(new Type[] { }), typeof(TestObj).GetConstructor(new Type[] { typeof(int) }) }; list.Add(cis[0]); name = ((ConstructorInfo)list[i]).Name; @@ -148,6 +170,8 @@ public void SystemType1_GetType_Test() Assert.AreEqual(cis[0].Name, ".ctor"); i++; + OutputHelper.WriteLine("Testing Array of System.Collections.ArrayList"); + Array ar = Array.CreateInstance(typeof(Type), 3); ((IList)ar)[0] = typeof(Type); ((IList)ar)[1] = Type.GetType("System.Collections.ArrayList"); @@ -157,7 +181,6 @@ public void SystemType1_GetType_Test() Assert.AreEqual(name, "ArrayList"); Assert.AreEqual(((Type)((IList)ar)[0]).Name, "Type"); Assert.AreEqual(((Type)ar.GetValue(1)).Name, "ArrayList"); - i++; list.Clear(); } From 40ce642a953ab8b22caf7142214fb4ee97ceab64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 21 Mar 2025 16:58:26 +0000 Subject: [PATCH 56/70] Fix UnitTestReflectionType tests - Fix order in the AreEqual asserts. - Add output message to help debug. --- .../UnitTestReflectionTypeTest.cs | 72 ++++++++++++------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs b/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs index 709f2122..471b394d 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs @@ -52,85 +52,103 @@ public void SystemReflectionType_RuntimeType_Test1() /// TestClass cls = new TestClass(); + OutputHelper.WriteLine("Testing Type members for a class type"); + // Test Type members for a class type Type t = cls.GetType(); Assembly asm = t.Assembly; list.Add(asm); - Assert.AreEqual(((Assembly)list[i]).GetName().Name, "NFUnitTest"); - Assert.AreEqual(asm.GetName().Name, "NFUnitTest"); - Assert.AreEqual(t.Name, "TestClass"); - Assert.AreEqual(t.FullName, "NFUnitTestSystemLib.UnitTestReflectionTypeTest+TestClass"); + Assert.AreEqual("NFUnitTest", ((Assembly)list[i]).GetName().Name); + Assert.AreEqual("NFUnitTest", asm.GetName().Name); + Assert.AreEqual("TestClass", t.Name); + Assert.AreEqual("NFUnitTestSystemLib.UnitTestReflectionTypeTest+TestClass", t.FullName); Assert.IsInstanceOfType(t.BaseType, typeof(object)); Assert.IsNull(t.GetElementType()); + OutputHelper.WriteLine("Testing methods of class type"); + MethodInfo[] mis = t.GetMethods(); - Assert.AreEqual(mis[0].Name, "Method1"); + Assert.AreEqual("Method1", mis[0].Name); mis = t.GetMethods(BindingFlags.Instance | BindingFlags.NonPublic); - Assert.AreEqual(mis[0].Name, "Method2"); + Assert.AreEqual("Method2", mis[0].Name); Assert.IsNotNull(t.GetMethod("Method1")); Assert.IsNotNull(t.GetMethod("Method2", BindingFlags.Instance | BindingFlags.NonPublic)); + OutputHelper.WriteLine("Testing fields of class type"); + FieldInfo[] fis = t.GetFields(); - Assert.AreEqual(fis[0].Name, "m_Field1"); + Assert.AreEqual("m_Field1", fis[0].Name); fis = t.GetFields(BindingFlags.Instance | BindingFlags.NonPublic); - Assert.AreEqual(fis[0].Name, "m_Field2"); + Assert.AreEqual("m_Field2", fis[0].Name); Assert.IsNotNull(t.GetField("m_Field1")); Assert.IsNotNull(t.GetField("m_Field2", BindingFlags.NonPublic | BindingFlags.Instance)); Assert.IsNotNull(t.GetConstructor(new Type[] { })); + OutputHelper.WriteLine("Testing interfaces of class type"); + Type[] ifaces = t.GetInterfaces(); - Assert.AreEqual(ifaces.Length, 2); - Assert.AreEqual(ifaces[0].Name, "IInterface1"); - Assert.AreEqual(ifaces[1].Name, "IInterface2"); + Assert.AreEqual(2, ifaces.Length); + Assert.AreEqual("IInterface1", ifaces[0].Name); + Assert.AreEqual("IInterface2", ifaces[1].Name); Assert.IsTrue(t.IsSubclassOf(typeof(object))); i++; + OutputHelper.WriteLine("Testing Type members for a struct valuetype"); + // test Type members for a struct valuetype TestStruct str = new TestStruct(); t = str.GetType(); asm = t.Assembly; list.Add(asm); - Assert.AreEqual(((Assembly)list[i]).GetName().Name, "NFUnitTest"); - Assert.AreEqual(asm.GetName().Name, "NFUnitTest"); - Assert.AreEqual(t.Name, "TestStruct"); - Assert.AreEqual(t.FullName, "NFUnitTestSystemLib.UnitTestReflectionTypeTest+TestStruct"); + Assert.AreEqual("NFUnitTest", ((Assembly)list[i]).GetName().Name); + Assert.AreEqual("NFUnitTest", asm.GetName().Name); + Assert.AreEqual("TestStruct", t.Name); + Assert.AreEqual("NFUnitTestSystemLib.UnitTestReflectionTypeTest+TestStruct", t.FullName); Assert.IsInstanceOfType(t.BaseType, typeof(ValueType)); - Assert.AreEqual(t.GetInterfaces().Length, 0); + Assert.AreEqual(0, t.GetInterfaces().Length); Assert.IsNull(t.GetElementType()); i++; + OutputHelper.WriteLine("Testing Type members for an Assembly reflection type"); + // test Type members for an Assembly reflection type //Assembly asmObj = typeof(TestClass).Assembly; //t = asmObj.GetType(); //asm = t.Assembly; //list.Add(asm); - //Assert.AreEqual(((Assembly)list[i]).GetName().Name, "mscorlib"); - //Assert.AreEqual(asm.GetName().Name, "mscorlib"); - //Assert.AreEqual(t.Name, "Assembly"); - //Assert.AreEqual(t.FullName, "System.Reflection.Assembly"); + //Assert.AreEqual("mscorlib", ((Assembly)list[i]).GetName().Name); + //Assert.AreEqual("mscorlib", asm.GetName().Name); + //Assert.AreEqual("Assembly", t.Name); + //Assert.AreEqual("System.Reflection.Assembly", t.FullName); //Assert.IsInstanceOfType(t.BaseType, typeof(Object)); - //Assert.AreEqual(t.GetInterfaces().Length, 0); + //Assert.AreEqual(0, t.GetInterfaces().Length); //Assert.IsNull(t.GetElementType()); + OutputHelper.WriteLine("Testing Type members for a MethodInfo reflection type"); + mis = typeof(TestClass).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); t = mis.GetType(); - Assert.AreEqual(t.Name, "RuntimeMethodInfo[]"); - Assert.AreEqual(t.FullName, "System.Reflection.RuntimeMethodInfo[]"); + Assert.AreEqual("RuntimeMethodInfo[]", t.Name); + Assert.AreEqual("System.Reflection.RuntimeMethodInfo[]", t.FullName); Assert.IsInstanceOfType(t.BaseType, typeof(Array)); Assert.IsTrue(t.GetInterfaces().Length > 0); - Assert.AreEqual(t.GetElementType().Name, "RuntimeMethodInfo"); + Assert.AreEqual("RuntimeMethodInfo", t.GetElementType().Name); + + OutputHelper.WriteLine("Testing Type members for a delegate"); // test Type members for a delegate Delegate del = new MyDelegate(MyDelegateImpl); t = del.GetType(); Assert.IsNotNull(t.DeclaringType); - Assert.AreEqual(t.Name, "MyDelegate"); + Assert.AreEqual("MyDelegate", t.Name); Assert.IsInstanceOfType(t.BaseType, typeof(MulticastDelegate)); + OutputHelper.WriteLine("Testing Type members for an enum"); + // test Type members for an enum TestEnum en = TestEnum.Item1; t = en.GetType(); - Assert.IsInstanceOfType(t.DeclaringType, typeof(UnitTestReflectionTypeTest)); + Assert.IsInstanceOfType(typeof(UnitTestReflectionTypeTest), t.DeclaringType); Assert.IsTrue(t.IsEnum); Assert.IsFalse(t.IsAbstract); Assert.IsFalse(t.IsClass); @@ -148,7 +166,7 @@ public void SystemReflectionType_SystemType_Test2() Assert.IsFalse(typeof(Array).IsValueType); Assert.IsTrue(typeof(TestStruct).IsValueType); Assert.IsTrue(typeof(Type).IsSubclassOf(typeof(MemberInfo))); - Assert.AreEqual(typeof(Type).GetInterfaces()[0].Name, "IReflect"); + Assert.AreEqual("IReflect", typeof(Type).GetInterfaces()[0].Name); Assert.IsTrue(typeof(MyDelegate).IsInstanceOfType(new MyDelegate(MyDelegateImpl))); // Get known type from assembly qualified type name Culture and PublicKeyToken are used by debugger to identify types From c228f9f48839a704455f6342c06aa5b6ee983ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 17 Mar 2025 19:05:58 +0000 Subject: [PATCH 57/70] Fix types wrongly excluded from metadata --- nanoFramework.CoreLibrary/System/Convert.cs | 1 - nanoFramework.CoreLibrary/System/DateTime.cs | 1 - nanoFramework.CoreLibrary/System/DayOfWeek.cs | 1 - nanoFramework.CoreLibrary/System/IO/IOException.cs | 1 - nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs | 1 - 5 files changed, 5 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Convert.cs b/nanoFramework.CoreLibrary/System/Convert.cs index e040ec9c..7ce6ca90 100644 --- a/nanoFramework.CoreLibrary/System/Convert.cs +++ b/nanoFramework.CoreLibrary/System/Convert.cs @@ -9,7 +9,6 @@ namespace System /// Specifies whether relevant Convert.ToBase64CharArray and Convert.ToBase64String methods insert line breaks in their output. /// [Flags] - [ExcludeType] public enum Base64FormattingOptions { /// diff --git a/nanoFramework.CoreLibrary/System/DateTime.cs b/nanoFramework.CoreLibrary/System/DateTime.cs index ed428be6..7f5ce948 100644 --- a/nanoFramework.CoreLibrary/System/DateTime.cs +++ b/nanoFramework.CoreLibrary/System/DateTime.cs @@ -17,7 +17,6 @@ namespace System /// nanoFramework doesn't support local time, only UTC, so it's not possible to specify . /// [Serializable] - [ExcludeType] public enum DateTimeKind { /// diff --git a/nanoFramework.CoreLibrary/System/DayOfWeek.cs b/nanoFramework.CoreLibrary/System/DayOfWeek.cs index 9bb828d4..dbd4054a 100644 --- a/nanoFramework.CoreLibrary/System/DayOfWeek.cs +++ b/nanoFramework.CoreLibrary/System/DayOfWeek.cs @@ -9,7 +9,6 @@ namespace System /// Specifies the day of the week. /// [Serializable] - [ExcludeType] public enum DayOfWeek { /// diff --git a/nanoFramework.CoreLibrary/System/IO/IOException.cs b/nanoFramework.CoreLibrary/System/IO/IOException.cs index e62b9003..2f7fddc1 100644 --- a/nanoFramework.CoreLibrary/System/IO/IOException.cs +++ b/nanoFramework.CoreLibrary/System/IO/IOException.cs @@ -14,7 +14,6 @@ public class IOException : SystemException /// /// Provides values for error codes. /// - [ExcludeType] public enum IOExceptionErrorCode { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs index b629738f..e5ed7429 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MemberTypes.cs @@ -13,7 +13,6 @@ namespace System.Reflection /// /// Available only in mscorlib build with support for System.Reflection. [Serializable] - [ExcludeType] public enum MemberTypes { /// From 674924b00f2a2c305f82be4e1a23c36448c7bf52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 1 Apr 2025 00:54:40 +0100 Subject: [PATCH 58/70] Rename TryParse Guid --- nanoFramework.CoreLibrary/System/Guid.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/Guid.cs b/nanoFramework.CoreLibrary/System/Guid.cs index 6ccee863..06ac415c 100644 --- a/nanoFramework.CoreLibrary/System/Guid.cs +++ b/nanoFramework.CoreLibrary/System/Guid.cs @@ -152,7 +152,7 @@ public Guid(string g) ArgumentNullException.ThrowIfNull(g); #pragma warning disable S3928 // Parameter names used into ArgumentException constructors should match an existing one - if (!TryParseGuidWithDashes( + if (!TryParse( g, out Guid result)) { @@ -334,8 +334,7 @@ private static char HexToChar(int a) /// /// The .NET nanoFramework implementation of this method only supports 'D' and 'N' format specifiers. /// - [Obsolete("This will be renamed to TryParse in a future version.")] - public static bool TryParseGuidWithDashes( + public static bool TryParse( string input, out Guid result) { From d24d148cb25d65a22833dd80ddc1846e64209830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 1 Apr 2025 01:03:04 +0100 Subject: [PATCH 59/70] Rename runsetting file --- Tests/NFUnitTest_DummyAdapter/nano.runsettings => .runsettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Tests/NFUnitTest_DummyAdapter/nano.runsettings => .runsettings (97%) diff --git a/Tests/NFUnitTest_DummyAdapter/nano.runsettings b/.runsettings similarity index 97% rename from Tests/NFUnitTest_DummyAdapter/nano.runsettings rename to .runsettings index 3d17b679..0e8dd6b2 100644 --- a/Tests/NFUnitTest_DummyAdapter/nano.runsettings +++ b/.runsettings @@ -13,4 +13,4 @@ False --forcegc - \ No newline at end of file + From 912cb278fef911414c9514338d0dda4f08c3e3c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 1 Apr 2025 01:07:31 +0100 Subject: [PATCH 60/70] Fix merge --- azure-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 29ea68d3..7d187f69 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -163,9 +163,6 @@ jobs: eq(variables['UPDATE_DEPENDENTS'], 'true') ) - dependsOn: - - Build_mscorlib - pool: vmImage: 'windows-latest' @@ -192,7 +189,6 @@ jobs: nanoFramework.Networking.Sntp nanoFramework.TI.EasyLink nanoFramework.ResourceManager - nanoframework.System.Runtime System.Device.Adc System.Device.Dac System.Device.I2c From bf70eccdad8da50d45614056b1f4a7abf1a30096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 2 Apr 2025 10:17:30 +0100 Subject: [PATCH 61/70] Work on `GC` APIs (#243) ***NO_CI*** --- Tests/NFUnitTestGC/TestGC.cs | 36 +++++++-- Tests/NFUnitTestSystemLib/UnitTestGCTest.cs | 85 +++++++++------------ nanoFramework.CoreLibrary/System/GC.cs | 70 +++++++++++++---- 3 files changed, 121 insertions(+), 70 deletions(-) diff --git a/Tests/NFUnitTestGC/TestGC.cs b/Tests/NFUnitTestGC/TestGC.cs index 0bec97a8..bf52e121 100644 --- a/Tests/NFUnitTestGC/TestGC.cs +++ b/Tests/NFUnitTestGC/TestGC.cs @@ -1,7 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using nanoFramework.TestFramework; namespace NFUnitTestGC @@ -15,8 +16,6 @@ public void TestGCStress() int maxArraySize = 1024 * 32; object[] arrays = new object[600]; - // Starting TestGCStress - for (int loop = 0; loop < 100; loop++) { OutputHelper.WriteLine($"Running iteration {loop}"); @@ -24,7 +23,7 @@ public void TestGCStress() for (int i = 0; i < arrays.Length - 1;) { OutputHelper.WriteLine($"Alloc array of {maxArraySize} bytes @ pos {i}"); - arrays[i++] = new byte[maxArraySize]; ; + arrays[i++] = new byte[maxArraySize]; OutputHelper.WriteLine($"Alloc array of 64 bytes @ pos {i}"); arrays[i++] = new byte[64]; @@ -37,8 +36,35 @@ public void TestGCStress() arrays[i] = null; } } + } + + [TestMethod] + public void TestGetTotalMemory() + { + // create several objects + object[] objects = new object[100]; + + for (int i = 0; i < objects.Length; i++) + { + objects[i] = new object(); + } + + // get total memory + long totalMemory = GC.GetTotalMemory(false); + OutputHelper.WriteLine($"Total memory: {totalMemory} bytes"); + + // release objects + for (int i = 0; i < objects.Length; i++) + { + objects[i] = null; + } + + // get total memory, forcing full collection + long totalMemoryAfterCollection = GC.GetTotalMemory(true); + OutputHelper.WriteLine($"Total memory: {totalMemoryAfterCollection} bytes"); - // Completed TestGCStress + // check if memory was released + Assert.IsTrue(totalMemory > totalMemoryAfterCollection, "Memory was not released"); } } } diff --git a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs index 05c73642..42a3e8f0 100644 --- a/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs +++ b/Tests/NFUnitTestSystemLib/UnitTestGCTest.cs @@ -9,6 +9,11 @@ namespace NFUnitTestSystemLib [TestClass] public class UnitTestGCTest { +#pragma warning disable S1215 // this is intended to test the GC +#pragma warning disable S1854 // this is intended to test the GC +#pragma warning disable S2696 // this is intended to test the GC +#pragma warning disable S3971 // this is intended to test the GC + internal class FinalizeObject { public static FinalizeObject m_currentInstance = null; @@ -54,17 +59,20 @@ public void SystemGC1_Test() /// 6. Verify that object has been collected /// /// - // Tests ReRegisterForFinalize - // Create a FinalizeObject. + + OutputHelper.WriteLine("Tests ReRegisterForFinalize"); + OutputHelper.WriteLine("Create a FinalizeObject."); + FinalizeObject mfo = new FinalizeObject(); m_hasFinalized1 = false; m_hasFinalized2 = false; // Release reference + OutputHelper.WriteLine("Release reference"); mfo = null; - // Allow GC - GC.WaitForPendingFinalizers(); + OutputHelper.WriteLine("Allow GC"); + GC.Collect(); int sleepTime = 1000; int slept = 0; @@ -85,10 +93,10 @@ public void SystemGC1_Test() // FinalizeObject.m_currentInstance field. Setting this value // to null and forcing another garbage collection will now // cause the object to Finalize permanently. - // Reregister and allow for GC - FinalizeObject.m_currentInstance = null; - GC.WaitForPendingFinalizers(); + OutputHelper.WriteLine("Reregister and allow for GC"); + FinalizeObject.m_currentInstance = null; + GC.Collect(); sleepTime = 1000; slept = 0; @@ -119,18 +127,19 @@ public void SystemGC2_Test() /// 6. Verify that object has not been collected /// /// - // Tests SuppressFinalize - // Create a FinalizeObject. + + OutputHelper.WriteLine("Tests SuppressFinalize"); + OutputHelper.WriteLine("Create a FinalizeObject"); FinalizeObject mfo = new FinalizeObject(); m_hasFinalized1 = false; m_hasFinalized2 = false; - // Releasing + OutputHelper.WriteLine("Releasing"); GC.SuppressFinalize(mfo); mfo = null; - // Allow GC - GC.WaitForPendingFinalizers(); + OutputHelper.WriteLine("Allow GC"); + GC.Collect(); int sleepTime = 1000; int slept = 0; @@ -138,7 +147,7 @@ public void SystemGC2_Test() while (!m_hasFinalized1 && slept < sleepTime) { // force GC run caused by memory allocation - var dummyArray = new byte[1024 * 1024 * 1]; + _ = new byte[1024 * 1024 * 1]; System.Threading.Thread.Sleep(10); slept += 10; @@ -161,59 +170,35 @@ public void SystemGC3_Test() /// /// - // Tests WaitForPendingFinalizers, dependant on test 1 - // will auto-fail if test 1 fails. OutputHelper.Write("Tests WaitForPendingFinalizers, dependant on test 1"); - OutputHelper.WriteLine("will auto-fail if test 1 fails."); + OutputHelper.WriteLine("will fail if test 1 fails."); - Assert.IsTrue(m_Test1Result); + Assert.IsTrue(m_Test1Result, "Can't run this test as SystemGC1_Test has failed."); - // Create a FinalizeObject. + OutputHelper.WriteLine("Create a FinalizeObject"); FinalizeObject mfo = new FinalizeObject(); m_hasFinalized1 = false; m_hasFinalized2 = false; - // Releasing + OutputHelper.WriteLine("Releasing"); mfo = null; - int sleepTime = 1000; - int slept = 0; - - while (!m_hasFinalized1 && slept < sleepTime) - { - // force GC run caused by memory allocation - var dummyArray = new byte[1024 * 1024 * 1]; - - System.Threading.Thread.Sleep(10); - slept += 10; - } - - OutputHelper.WriteLine($"GC took {slept}"); - - // Wait for GC + OutputHelper.WriteLine("Wait for GC"); + GC.Collect(); GC.WaitForPendingFinalizers(); - // Releasing again + OutputHelper.WriteLine("Releasing again"); FinalizeObject.m_currentInstance = null; - sleepTime = 1000; - slept = 0; - - while (!m_hasFinalized2 && slept < sleepTime) - { - // force GC run caused by memory allocation - var dummyArray = new byte[1024 * 1024 * 1]; - - System.Threading.Thread.Sleep(10); - slept += 10; - } - - OutputHelper.WriteLine($"GC took {slept}"); - - // Wait for GC + OutputHelper.WriteLine("Wait for GC"); + GC.Collect(); GC.WaitForPendingFinalizers(); Assert.IsTrue(m_hasFinalized2); } } +#pragma warning restore S1215 // "GC.Collect" should not be called +#pragma warning restore S1854 // Unused assignments should be removed +#pragma warning restore S2696 // Instance members should not write to "static" fields +#pragma warning restore S3971 // "GC.SuppressFinalize" should not be called } diff --git a/nanoFramework.CoreLibrary/System/GC.cs b/nanoFramework.CoreLibrary/System/GC.cs index 13f07e8c..7746f4f3 100644 --- a/nanoFramework.CoreLibrary/System/GC.cs +++ b/nanoFramework.CoreLibrary/System/GC.cs @@ -1,39 +1,79 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.CompilerServices; + namespace System { - using Runtime.CompilerServices; - /// /// Controls the system garbage collector, a service that automatically reclaims unused memory. /// public static class GC { +#pragma warning disable S4200 // Native methods should be wrapped + + /// + /// Enables or disables the output of garbage collection messages. + /// + /// to enable the output of GC messages; otherwise, . + /// + /// + /// Enabling GC messages may not always result in output, depending on the target build options. + /// For example, RTM builds, which remove all non-essential features, may not output these messages. + /// + /// + /// This method is specific of .NET nanoFramework implementation. There is no equivalent in full .NET API. + /// + /// [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool AnyPendingFinalizers(); + public static extern void EnableGCMessages(bool enable); /// - /// Suspends the current thread until the thread that is processing the queue of finalizers has emptied that queue. + /// Retrieves the heap size excluding fragmentation. For example if the total GC heap size is 1MB and fragmentation, ie, space taken up by free objects, takes up 400kB, this API would report 600kB. A parameter indicates whether this method can wait a short interval before returning, to allow the system to collect garbage and finalize objects. /// - public static void WaitForPendingFinalizers() - { - while (AnyPendingFinalizers()) Threading.Thread.Sleep(10); - } + /// to indicate that this method can wait for garbage collection and heap compaction to occur before returning; otherwise, . + /// The heap size, in bytes, excluding fragmentation. + public static long GetTotalMemory(bool forceFullCollection) => Run(forceFullCollection); /// - /// Requests that the system not call the finalizer for the specified object. + /// Requests that the system call the finalizer for the specified object for which has previously been called. /// - /// The object that a finalizer must not be called for. + /// The object that a finalizer must be called for. + /// is . [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void SuppressFinalize(Object obj); + public static extern void ReRegisterForFinalize(object obj); + + /// + /// Forces an immediate garbage collection of all generations. + /// + /// + /// Use this method to try to reclaim all memory that is inaccessible. It performs a blocking garbage collection of all generations. + /// All objects, regardless of how long they have been in memory, are considered for collection; however, objects that are referenced in managed code are not collected. Use this method to force the system to try to reclaim the maximum amount of available memory. + /// + public static void Collect() => Run(true); /// - /// Requests that the system call the finalizer for the specified object for which SuppressFinalize has previously been called. + /// Requests that the common language runtime not call the finalizer for the specified object. /// - /// The object that a finalizer must be called for. + /// The object whose finalizer must not be executed. + /// is . [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void ReRegisterForFinalize(Object obj); + public static extern void SuppressFinalize(object obj); + /// + /// Suspends the current thread until the thread that is processing the queue of finalizers has emptied that queue. + /// + public static void WaitForPendingFinalizers() + { + while (AnyPendingFinalizers()) Threading.Thread.Sleep(10); + } + +#pragma warning restore S4200 // Native methods should be wrapped + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool AnyPendingFinalizers(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern uint Run(bool compactHeap); } } From f437d5454846564132070cada6832c9de56c51d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 4 Apr 2025 11:04:23 +0100 Subject: [PATCH 62/70] Bump native assembly version --- nanoFramework.CoreLibrary/System/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanoFramework.CoreLibrary/System/AssemblyInfo.cs b/nanoFramework.CoreLibrary/System/AssemblyInfo.cs index 682d3ff7..8375deaf 100644 --- a/nanoFramework.CoreLibrary/System/AssemblyInfo.cs +++ b/nanoFramework.CoreLibrary/System/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -10,4 +10,4 @@ [assembly: AssemblyProduct(".NET nanoFramework mscorlib")] [assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")] -[assembly: AssemblyNativeVersion("100.5.0.24")] +[assembly: AssemblyNativeVersion("100.22.0.0")] From 6fbdec2dedcde58b3e66039e70e125c100ffb449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 4 Apr 2025 11:12:03 +0100 Subject: [PATCH 63/70] Add preview to nbgv version config --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 08f237fb..3e6d3118 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.0", + "version": "2.0.0-preview.{height}", "assemblyVersion": { "precision": "build" }, From d5207127cd0cbba40e0522d13f1c0ae4fe21e50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 4 Apr 2025 11:18:41 +0100 Subject: [PATCH 64/70] Work CI-CD - Add generics branch to nbgv config. ***NO_CI*** --- version.json | 1 + 1 file changed, 1 insertion(+) diff --git a/version.json b/version.json index 3e6d3118..3269dd37 100644 --- a/version.json +++ b/version.json @@ -11,6 +11,7 @@ "publicReleaseRefSpec": [ "^refs/heads/develop$", "^refs/heads/main$", + "^refs/heads/generics$", "^refs/heads/v\\d+(?:\\.\\d+)?$" ], "cloudBuild": { From 6abe4b8f267ecf8c57cbc06be3ae113dc943ba78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 4 Apr 2025 11:21:48 +0100 Subject: [PATCH 65/70] Work CI-CD - Add generics branh to pipeline trigger. ***NO_CI*** --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7d187f69..1cb5ce1b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,6 +7,7 @@ trigger: - main - develop - release-* + - generics* paths: exclude: - .gitignore From 530fb992115f123698a2faeec340e457b848840c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 16 Apr 2025 14:59:49 +0100 Subject: [PATCH 66/70] Fix nuspec to package with nano TFM --- nanoFramework.CoreLibrary.nuspec | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nanoFramework.CoreLibrary.nuspec b/nanoFramework.CoreLibrary.nuspec index 63518a26..0dc517b8 100644 --- a/nanoFramework.CoreLibrary.nuspec +++ b/nanoFramework.CoreLibrary.nuspec @@ -18,12 +18,7 @@ nanoFramework C# csharp netmf netnf nanoFramework.CoreLibrary - - - - - - + From b262767d335e8c5be1312a3c9821a2b6a5626d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 16 Apr 2025 19:05:58 +0100 Subject: [PATCH 67/70] Work CI-CD - Config usage of preview VS extension. --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1cb5ce1b..b49953b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -81,6 +81,7 @@ jobs: runUnitTests: ${{ ne(variables['processPrLabels.SKIP_UNIT_TESTS'], 'true') }} unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings' skipNuGetCache: true + buildComponentsUsePreview: true # rebuild CoreLibrary project to get the assembly checksum - task: MSBuild@1 From 1a7c13824aa17a6df7cbf13145f533cd5f78c758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 17 Apr 2025 18:05:39 +0100 Subject: [PATCH 68/70] Update test sub-module @18e4b3d --- nanoFramework.TestFramework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index c0a77fd1..18e4b3d4 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit c0a77fd1299ddf5bc57764642b31566b828b3aa3 +Subproject commit 18e4b3d4b0c6b647bc3c2a8a0d11a53c059145a7 From aee2353ff3d42ee7ea2d6d337a32662cc484a674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 17 Apr 2025 18:07:19 +0100 Subject: [PATCH 69/70] Update runsettings to use preview CLR --- .runsettings | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.runsettings b/.runsettings index 0e8dd6b2..536c73fb 100644 --- a/.runsettings +++ b/.runsettings @@ -1,4 +1,4 @@ - + @@ -12,5 +12,6 @@ Verbose False --forcegc + True From b114fb76f2105b1df1ef5be719dea047fe0022d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 17 Apr 2025 18:09:58 +0100 Subject: [PATCH 70/70] Remove "generics" from branch trigger --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b49953b4..8cf81cb4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,6 @@ trigger: - main - develop - release-* - - generics* paths: exclude: - .gitignore