mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 19:10:41 -10:00
* Add tests from mono and more to existing tests * Clean up tests for Mono * Fix up some tests, add necessary XML file * Add more tests, add XML to correct location XML will automatically compile when moved to right location that is in the project, not on local desktop. Add tests for TypedTableBaseExtensions and EnumerableRowCollectionExtensions * Fix path of testdataset1.xml So tests can find doc Commit migrated from https://github.com/dotnet/corefx/commit/73f62d06803d086ee7f6745b55dfde63e27be779
32 lines
1.5 KiB
C#
32 lines
1.5 KiB
C#
// 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.Data.Tests
|
|
{
|
|
public class DataTableExtensionsTests
|
|
{
|
|
[Fact]
|
|
public void AsEnumerable_NullSource_ThrowsArgumentNullException()
|
|
{
|
|
AssertExtensions.Throws<ArgumentNullException>("source", () => DataTableExtensions.AsEnumerable(null));
|
|
}
|
|
|
|
[Fact]
|
|
public void CopyToDataTable_NullSource_ThrowsArgumentNullException()
|
|
{
|
|
AssertExtensions.Throws<ArgumentNullException>("source", () => DataTableExtensions.CopyToDataTable<DataRow>(null));
|
|
AssertExtensions.Throws<ArgumentNullException>("source", () => DataTableExtensions.CopyToDataTable<DataRow>(null, new DataTable(), LoadOption.OverwriteChanges));
|
|
AssertExtensions.Throws<ArgumentNullException>("source", () => DataTableExtensions.CopyToDataTable<DataRow>(null, new DataTable(), LoadOption.OverwriteChanges, null));
|
|
}
|
|
|
|
[Fact]
|
|
public void CopyToDataTable_NullTable_ThrowsArgumentNullException()
|
|
{
|
|
AssertExtensions.Throws<ArgumentNullException>("table", () => DataTableExtensions.CopyToDataTable(new DataRow[0], null, LoadOption.OverwriteChanges));
|
|
AssertExtensions.Throws<ArgumentNullException>("table", () => DataTableExtensions.CopyToDataTable(new DataRow[0], null, LoadOption.OverwriteChanges, null));
|
|
}
|
|
}
|
|
} |