Skip to content

Commit 8c6c22d

Browse files
committed
fix alltest sin github
1 parent c911187 commit 8c6c22d

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

src/Migrator.Tests/Providers/Base/TransformationProviderSimpleBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public virtual void TearDown()
1414
{
1515
DropTestTables();
1616

17-
Provider.Rollback();
17+
Provider?.Rollback();
1818
}
1919

2020
protected void DropTestTables()
@@ -75,4 +75,4 @@ public void AddTableWithPrimaryKey()
7575
new Column("bigstring", DbType.String, 50000)
7676
);
7777
}
78-
}
78+
}

src/Migrator.Tests/Providers/SQLServer/Base/SQLServerTransformationProviderTestBase.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ public void SetUp()
1717
{
1818
var configReader = new ConfigurationReader();
1919
var connectionString = configReader.GetDatabaseConnectionConfigById(DatabaseConnectionConfigIds.SQLServerConnectionConfigId)
20-
.ConnectionString;
21-
20+
?.ConnectionString;
21+
22+
if (string.IsNullOrEmpty(connectionString))
23+
{
24+
throw new IgnoreException("No SqlServer ConnectionString is Set.");
25+
}
2226

2327
DbProviderFactories.RegisterFactory("Microsoft.Data.SqlClient", () => Microsoft.Data.SqlClient.SqlClientFactory.Instance);
2428

src/Migrator.Tests/Providers/SQLServer/SqlServerTransformationProviderGenericTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void SetUp()
1616
{
1717
var configReader = new ConfigurationReader();
1818
var connectionString = configReader.GetDatabaseConnectionConfigById(DatabaseConnectionConfigIds.SQLServerConnectionConfigId)
19-
.ConnectionString;
19+
?.ConnectionString;
2020

2121
if (string.IsNullOrEmpty(connectionString))
2222
{

src/Migrator.Tests/Providers/SQLServer/SqlServerTransformationProviderTests.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
#region License
2-
3-
//The contents of this file are subject to the Mozilla Public License
4-
//Version 1.1 (the "License"); you may not use this file except in
5-
//compliance with the License. You may obtain a copy of the License at
6-
//http://www.mozilla.org/MPL/
7-
//Software distributed under the License is distributed on an "AS IS"
8-
//basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9-
//License for the specific language governing rights and limitations
10-
//under the License.
11-
12-
#endregion
13-
141
using System.Data;
152
using Migrator.Providers;
163
using Migrator.Providers.SqlServer;
@@ -65,4 +52,4 @@ public void TableExistsShouldWorkWithTableNamesWithBracket()
6552
{
6653
Assert.That(Provider.TableExists("[TestTwo]"), Is.True);
6754
}
68-
}
55+
}

0 commit comments

Comments
 (0)