Skip to content

Commit d4611e0

Browse files
ErikEJcheenamalhotra
authored andcommitted
Tests | Last batch of mono tests ported (dotnet#263)
1 parent 559ef74 commit d4611e0

File tree

7 files changed

+2548
-0
lines changed

7 files changed

+2548
-0
lines changed

src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
<Compile Include="AlwaysEncryptedTests\SqlConnectionShould.cs" />
2222
<Compile Include="AlwaysEncryptedTests\TestFixtures.cs" />
2323
<Compile Include="AlwaysEncryptedTests\Utility.cs" />
24+
<Compile Include="SqlCommandBuilderTest.cs" />
25+
<Compile Include="SqlBulkCopyTest.cs" />
26+
<Compile Include="SqlClientMetaDataCollectionNamesTest.cs" />
27+
<Compile Include="SqlDataAdapterTest.cs" />
2428
<Compile Include="SqlConnectionBasicTests.cs" />
29+
<Compile Include="SqlCommandTest.cs" />
30+
<Compile Include="SqlConnectionTest.cs" />
2531
<Compile Include="TestTdsServer.cs" />
2632
<Compile Include="AADAccessTokenTest.cs" />
2733
<Compile Include="CloneTests.cs" />
@@ -57,6 +63,9 @@
5763
<PackageReference Include="microsoft.dotnet.buildtools.testsuite" Version="2.2.0-preview1-03110-01" />
5864
<PackageReference Include="System.Linq.Expressions" Version="4.3.0" />
5965
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.1" />
66+
</ItemGroup>
67+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
68+
<PackageReference Include="System.Data.Odbc" Version="4.5.0" />
6069
</ItemGroup>
6170
<ItemGroup>
6271
<Reference Include="System.Transactions" />
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using Xunit;
7+
8+
namespace Microsoft.Data.SqlClient.Tests
9+
{
10+
public class SqlBulkCopyTest
11+
{
12+
[Fact]
13+
public void ConstructorNotNull1()
14+
{
15+
Assert.Throws<ArgumentNullException>(() => new SqlBulkCopy((SqlConnection)null));
16+
}
17+
18+
[Fact]
19+
public void ConstructorNotNull2()
20+
{
21+
Assert.Throws<ArgumentNullException>(() => new SqlBulkCopy((string)null));
22+
}
23+
24+
[Fact]
25+
public void ConstructorNotNull3()
26+
{
27+
Assert.Throws<ArgumentNullException>(() => new SqlBulkCopy((SqlConnection)null));
28+
}
29+
30+
[Fact]
31+
public void ConstructorNotNull4()
32+
{
33+
Assert.Throws<ArgumentNullException>(() => new SqlBulkCopy((SqlConnection)null));
34+
}
35+
36+
[Fact]
37+
public void ConstructorNotNull5()
38+
{
39+
Assert.Throws<ArgumentNullException>(() => new SqlBulkCopy((SqlConnection)null));
40+
}
41+
42+
[Fact]
43+
public void ConstructorNotNull6()
44+
{
45+
Assert.Throws<ArgumentNullException>(() => new SqlBulkCopy((SqlConnection)null));
46+
}
47+
}
48+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Xunit;
6+
7+
namespace Microsoft.Data.SqlClient.Tests
8+
{
9+
public class SqlClientMetaDataCollectionNamesTest
10+
{
11+
[Fact]
12+
public void ValuesTest()
13+
{
14+
Assert.Equal("Columns", SqlClientMetaDataCollectionNames.Columns);
15+
Assert.Equal("Databases", SqlClientMetaDataCollectionNames.Databases);
16+
Assert.Equal("ForeignKeys", SqlClientMetaDataCollectionNames.ForeignKeys);
17+
Assert.Equal("IndexColumns", SqlClientMetaDataCollectionNames.IndexColumns);
18+
Assert.Equal("Indexes", SqlClientMetaDataCollectionNames.Indexes);
19+
Assert.Equal("Parameters", SqlClientMetaDataCollectionNames.Parameters);
20+
Assert.Equal("ProcedureColumns", SqlClientMetaDataCollectionNames.ProcedureColumns);
21+
Assert.Equal("Procedures", SqlClientMetaDataCollectionNames.Procedures);
22+
Assert.Equal("Tables", SqlClientMetaDataCollectionNames.Tables);
23+
Assert.Equal("UserDefinedTypes", SqlClientMetaDataCollectionNames.UserDefinedTypes);
24+
Assert.Equal("Users", SqlClientMetaDataCollectionNames.Users);
25+
Assert.Equal("ViewColumns", SqlClientMetaDataCollectionNames.ViewColumns);
26+
Assert.Equal("Views", SqlClientMetaDataCollectionNames.Views);
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)