Increase code coverage of System.ComponentModel.Primitives to 100% (dotnet/corefx...
authorHugh Bellamy <hughbellars@gmail.com>
Mon, 4 Feb 2019 14:55:42 +0000 (14:55 +0000)
committerStephen Toub <stoub@microsoft.com>
Mon, 4 Feb 2019 14:55:42 +0000 (09:55 -0500)
* Increase code coverage of  System.ComponentModel.Primitives to 100%

* Move files to right folder

Commit migrated from https://github.com/dotnet/corefx/commit/81c116a55d8788f563a8e02c21c9388bdf681647

23 files changed:
src/libraries/System.ComponentModel.Primitives/tests/ComponentModelPrimitivesBasicTests.cs [deleted file]
src/libraries/System.ComponentModel.Primitives/tests/System.ComponentModel.Primitives.Tests.csproj
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/BrowsableAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/BrowsableAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/CategoryAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/CategoryAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/ComponentCollectionTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/ComponentCollectionTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/ComponentTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/ComponentTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/DescriptionAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/DescriptionAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/DesignOnlyAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/DesignOnlyAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/DesignerCategoryAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/DesignerCategoryAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/DesignerSerializationVisibilityAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/DesignerSerializationVisibilityAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/DisplayNameAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/DisplayNameAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/EventHandlerListTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/EventHandlerListTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/ImmutableObjectAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/ImmutableObjectAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InitializationEventAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/InitializationEventAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidAsynchronousStateExceptionTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/InvalidAsynchronousStateExceptionTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidEnumArgumentExceptionTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/InvalidEnumArgumentExceptionTests.cs with 88% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/LocalizableAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/LocalizableAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/MergablePropertyAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/MergablePropertyAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/MockISite.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/MockISite.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/NotifyParentPropertyAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/NotifyParentPropertyAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/ParenthesizePropertyNameAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/ParenthesizePropertyNameAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/ReadOnlyAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/ReadOnlyAttributeTests.cs with 100% similarity]
src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/RefreshPropertiesAttributeTests.cs [moved from src/libraries/System.ComponentModel.Primitives/tests/RefreshPropertiesAttributeTests.cs with 100% similarity]

diff --git a/src/libraries/System.ComponentModel.Primitives/tests/ComponentModelPrimitivesBasicTests.cs b/src/libraries/System.ComponentModel.Primitives/tests/ComponentModelPrimitivesBasicTests.cs
deleted file mode 100644 (file)
index 2f2f0f0..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using Xunit;
-
-namespace System.ComponentModel.Tests
-{
-    public class ComponentModelPrimitivesTests
-    {
-        [Fact]
-        public static void TestComponentPrimitivesModelBasic()
-        {
-            // dummy tests to make sure the System.ComponentModel.Primitives library loaded successfully
-#pragma warning disable 0219
-            IComponent iComponent = null;
-            Assert.Null(iComponent);
-
-            IContainer iContainer = null;
-            Assert.Null(iContainer);
-
-            ISite iSite = null;
-            IServiceProvider iServiceProvider = iSite;
-            Assert.Null(iServiceProvider);
-#pragma warning restore 0219
-        }
-    }
-}
index e84eca3..896ccf9 100644 (file)
@@ -4,27 +4,26 @@
     <Configurations>netstandard-Debug;netstandard-Release</Configurations>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="InvalidAsynchronousStateExceptionTests.cs" />
-    <Compile Include="InvalidEnumArgumentExceptionTests.cs" />
-    <Compile Include="BrowsableAttributeTests.cs" />
-    <Compile Include="ComponentCollectionTests.cs" />
-    <Compile Include="ComponentTests.cs" />
-    <Compile Include="CategoryAttributeTests.cs" />
-    <Compile Include="ComponentModelPrimitivesBasicTests.cs" />
-    <Compile Include="DescriptionAttributeTests.cs" />
-    <Compile Include="DesignerCategoryAttributeTests.cs" />
-    <Compile Include="DesignerSerializationVisibilityAttributeTests.cs" />
-    <Compile Include="DesignOnlyAttributeTests.cs" />
-    <Compile Include="DisplayNameAttributeTests.cs" />
-    <Compile Include="ImmutableObjectAttributeTests.cs" />
-    <Compile Include="InitializationEventAttributeTests.cs" />
-    <Compile Include="LocalizableAttributeTests.cs" />
-    <Compile Include="MergablePropertyAttributeTests.cs" />
-    <Compile Include="MockISite.cs" />
-    <Compile Include="NotifyParentPropertyAttributeTests.cs" />
-    <Compile Include="ParenthesizePropertyNameAttributeTests.cs" />
-    <Compile Include="ReadOnlyAttributeTests.cs" />
-    <Compile Include="RefreshPropertiesAttributeTests.cs" />
-    <Compile Include="EventHandlerListTests.cs" />
+    <Compile Include="System\ComponentModel\BrowsableAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\CategoryAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\ComponentCollectionTests.cs" />
+    <Compile Include="System\ComponentModel\ComponentTests.cs" />
+    <Compile Include="System\ComponentModel\DescriptionAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\DesignerCategoryAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\DesignerSerializationVisibilityAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\DesignOnlyAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\DisplayNameAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\EventHandlerListTests.cs" />
+    <Compile Include="System\ComponentModel\ImmutableObjectAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\InitializationEventAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\InvalidAsynchronousStateExceptionTests.cs" />
+    <Compile Include="System\ComponentModel\InvalidEnumArgumentExceptionTests.cs" />
+    <Compile Include="System\ComponentModel\LocalizableAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\MergablePropertyAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\MockISite.cs" />
+    <Compile Include="System\ComponentModel\NotifyParentPropertyAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\ParenthesizePropertyNameAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\ReadOnlyAttributeTests.cs" />
+    <Compile Include="System\ComponentModel\RefreshPropertiesAttributeTests.cs" />
   </ItemGroup>
 </Project>
\ No newline at end of file
@@ -88,11 +88,17 @@ namespace System.ComponentModel.Tests
             Assert.Throws<NullReferenceException>(() => new InvalidEnumArgumentException("argumentName", 1, null));
         }
 
-        [Serializable]
-        public class SubException : InvalidEnumArgumentException
+        [Fact]
+        public void Ctor_SerializationInfo_StreamingContext()
         {
-            public SubException() : base() { }
-            protected SubException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+            using (var stream = new MemoryStream())
+            {
+                var formatter = new BinaryFormatter();
+                formatter.Serialize(stream, new InvalidEnumArgumentException());
+                stream.Seek(0, SeekOrigin.Begin);
+
+                Assert.IsType<InvalidEnumArgumentException>(formatter.Deserialize(stream));
+            }
         }
     }
 }