+++ /dev/null
-// 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
- }
- }
-}
<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
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));
+ }
}
}
}