diff options
author | Daniel Harvey <dharvey@microsoft.com> | 2017-04-18 19:52:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-18 19:52:02 +0300 |
commit | b43b4df2e0e2182154bb0f425cb4a61bc1269828 (patch) | |
tree | 0542a70918ed2276e68091b6ec724e09e040c1de /src/System.Private.Xml.Linq/tests | |
parent | f61b464b62939e8ab8361d41a78ecf21304a42ed (diff) |
Bulk updates of tests for AssertExtensions (#18491)
Bulk update to AssertExtensions.Throws for AOT support. This doesn't disable Assert.Throws.
Diffstat (limited to 'src/System.Private.Xml.Linq/tests')
-rw-r--r-- | src/System.Private.Xml.Linq/tests/misc/Annotation.cs | 21 | ||||
-rw-r--r-- | src/System.Private.Xml.Linq/tests/misc/System.Xml.Linq.Misc.Tests.csproj | 3 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/System.Private.Xml.Linq/tests/misc/Annotation.cs b/src/System.Private.Xml.Linq/tests/misc/Annotation.cs index db7f249c16..b6109bedf1 100644 --- a/src/System.Private.Xml.Linq/tests/misc/Annotation.cs +++ b/src/System.Private.Xml.Linq/tests/misc/Annotation.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; using System.Linq; using Microsoft.Test.ModuleCore; @@ -184,42 +185,42 @@ namespace System.Xml.Linq.Tests [MemberData(nameof(GetXObjects))] public void AddNull(XObject xo) { - Assert.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation(null)); + AssertExtensions.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation(null)); Assert.Null(xo.Annotation<object>()); - Assert.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation(null)); + AssertExtensions.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation(null)); } [Theory] [MemberData(nameof(GetXObjects))] public void RemoveNull(XObject xo) { - Assert.Throws<ArgumentNullException>("type", () => xo.RemoveAnnotations(null)); - Assert.Throws<ArgumentNullException>("type", () => xo.RemoveAnnotations(null)); + AssertExtensions.Throws<ArgumentNullException>("type", () => xo.RemoveAnnotations(null)); + AssertExtensions.Throws<ArgumentNullException>("type", () => xo.RemoveAnnotations(null)); } [Theory] [MemberData(nameof(GetXObjects))] public void GetAllNull(XObject xo) { - Assert.Throws<ArgumentNullException>("type", () => xo.Annotations(null)); - Assert.Throws<ArgumentNullException>("type", () => xo.Annotations(null)); + AssertExtensions.Throws<ArgumentNullException>("type", () => xo.Annotations(null)); + AssertExtensions.Throws<ArgumentNullException>("type", () => xo.Annotations(null)); } [Theory] [MemberData(nameof(GetXObjects))] public void GetOneNull(XObject xo) { - Assert.Throws<ArgumentNullException>("type", () => xo.Annotation(null)); - Assert.Throws<ArgumentNullException>("type", () => xo.Annotation(null)); + AssertExtensions.Throws<ArgumentNullException>("type", () => xo.Annotation(null)); + AssertExtensions.Throws<ArgumentNullException>("type", () => xo.Annotation(null)); } [Theory] [MemberData(nameof(GetXObjects))] public void AddNullString(XObject xo) { - Assert.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation((string)null)); + AssertExtensions.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation((string)null)); Assert.Null(xo.Annotation<object>()); - Assert.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation((string)null)); + AssertExtensions.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation((string)null)); } [Theory] diff --git a/src/System.Private.Xml.Linq/tests/misc/System.Xml.Linq.Misc.Tests.csproj b/src/System.Private.Xml.Linq/tests/misc/System.Xml.Linq.Misc.Tests.csproj index ef13353846..8c45c26a47 100644 --- a/src/System.Private.Xml.Linq/tests/misc/System.Xml.Linq.Misc.Tests.csproj +++ b/src/System.Private.Xml.Linq/tests/misc/System.Xml.Linq.Misc.Tests.csproj @@ -18,6 +18,9 @@ <Compile Include="XLinqErrata4.cs" /> <Compile Include="XNameAPI.cs" /> <Compile Include="LoadSaveAsyncTests.cs" Condition="'$(TargetGroup)'=='netcoreapp'" /> + <Compile Include="$(CommonTestPath)\System\AssertExtensions.cs"> + <Link>Common\System\AssertExtensions.cs</Link> + </Compile> </ItemGroup> <ItemGroup> <ProjectReference Include="$(CommonTestPath)\System\Xml\ModuleCore\ModuleCore.csproj" /> |