Skip to content

Commit ad19dd8

Browse files
Ja bist du narrischJa bist du narrisch
authored andcommitted
Removed more CE residues
1 parent 841cf11 commit ad19dd8

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

src/Migrator.Tests/MigrationLoaderTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Reflection;
2+
using DotNetProjects.Migrator;
23
using Migrator.Framework;
34
using Migrator.Framework.Loggers;
45
using NUnit.Framework;

src/Migrator.Tests/MigrationTypeComparerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ namespace Migrator.Tests;
2121
[TestFixture]
2222
public class MigrationTypeComparerTest
2323
{
24-
private readonly Type[] _types = {
24+
private readonly Type[] _types = [
2525
typeof (Migration1),
2626
typeof (Migration2),
2727
typeof (Migration3)
28-
};
28+
];
2929

3030
[Migration(1, Ignore = true)]
3131
internal class Migration1 : Migration

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void ChangeColumn()
159159
{
160160
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50));
161161
Assert.That(Provider.ColumnExists("TestTwo", "TestId"), Is.True);
162-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 1, "Not an Int val." });
162+
Provider.Insert("TestTwo", ["Id", "TestId"], [1, "Not an Int val."]);
163163
}
164164

165165
[Test]
@@ -168,7 +168,7 @@ public void ChangeColumn_FromNullToNull()
168168
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50, ColumnProperty.Null));
169169
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50, ColumnProperty.Null));
170170
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50, ColumnProperty.Null));
171-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 2, "Not an Int val." });
171+
Provider.Insert("TestTwo", ["Id", "TestId"], [2, "Not an Int val."]);
172172
}
173173

174174
[Test]
@@ -307,8 +307,8 @@ public void CommitTwice()
307307
[Test]
308308
public void InsertData()
309309
{
310-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 1, "1" });
311-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 2, "2" });
310+
Provider.Insert("TestTwo", ["Id", "TestId"], [1, "1"]);
311+
Provider.Insert("TestTwo", ["Id", "TestId"], [2, "2"]);
312312

313313
using var cmd = Provider.CreateCommand();
314314
using var reader = Provider.Select(cmd, "TestId", "TestTwo");
@@ -323,8 +323,8 @@ public void CanInsertNullData()
323323
{
324324
AddTable();
325325

326-
Provider.Insert("Test", new[] { "Id", "Title" }, new[] { "1", "foo" });
327-
Provider.Insert("Test", new[] { "Id", "Title" }, new[] { "2", null });
326+
Provider.Insert("Test", ["Id", "Title"], ["1", "foo"]);
327+
Provider.Insert("Test", ["Id", "Title"], ["2", null]);
328328

329329
using var cmd = Provider.CreateCommand();
330330
using var reader = Provider.Select(cmd, "Title", "Test");
@@ -338,7 +338,7 @@ public void CanInsertNullData()
338338
public void CanInsertDataWithSingleQuotes()
339339
{
340340
AddTable();
341-
Provider.Insert("Test", new[] { "Id", "Title" }, new[] { "1", "Muad'Dib" });
341+
Provider.Insert("Test", ["Id", "Title"], ["1", "Muad'Dib"]);
342342
using var cmd = Provider.CreateCommand();
343343
using var reader = Provider.Select(cmd, "Title", "Test");
344344
Assert.That(reader.Read(), Is.True);
@@ -362,7 +362,7 @@ public void DeleteData()
362362
public void DeleteDataWithArrays()
363363
{
364364
InsertData();
365-
Provider.Delete("TestTwo", new[] { "TestId" }, new[] { "1" });
365+
Provider.Delete("TestTwo", ["TestId"], ["1"]);
366366
using var cmd = Provider.CreateCommand();
367367
using var reader = Provider.Select(cmd, "TestId", "TestTwo");
368368
Assert.That(reader.Read(), Is.True);
@@ -373,10 +373,10 @@ public void DeleteDataWithArrays()
373373
[Test]
374374
public void UpdateData()
375375
{
376-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 20, "1" });
377-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 21, "2" });
376+
Provider.Insert("TestTwo", ["Id", "TestId"], [20, "1"]);
377+
Provider.Insert("TestTwo", ["Id", "TestId"], [21, "2"]);
378378

379-
Provider.Update("TestTwo", new[] { "TestId" }, new[] { "3" });
379+
Provider.Update("TestTwo", ["TestId"], ["3"]);
380380
using var cmd = Provider.CreateCommand();
381381
using var reader = Provider.Select(cmd, "TestId", "TestTwo");
382382
var vals = GetVals(reader);
@@ -390,10 +390,10 @@ public void UpdateData()
390390
public void CanUpdateWithNullData()
391391
{
392392
AddTable();
393-
Provider.Insert("Test", new[] { "Id", "Title" }, new[] { "1", "foo" });
394-
Provider.Insert("Test", new[] { "Id", "Title" }, new[] { "2", null });
393+
Provider.Insert("Test", ["Id", "Title"], ["1", "foo"]);
394+
Provider.Insert("Test", ["Id", "Title"], ["2", null]);
395395

396-
Provider.Update("Test", new[] { "Title" }, new string[] { null });
396+
Provider.Update("Test", ["Title"], [null]);
397397
using var cmd = Provider.CreateCommand();
398398
using var reader = Provider.Select(cmd, "Title", "Test");
399399
var vals = GetStringVals(reader);

src/Migrator.Tests/Providers/Oracle/OracleTransformationProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void ChangeColumn_FromNotNullToNotNull()
3131
{
3232
Provider.ExecuteNonQuery("DELETE FROM TestTwo");
3333
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50, ColumnProperty.Null));
34-
Provider.Insert("TestTwo", new[] { "Id", "TestId" }, new object[] { 3, "Not an Int val." });
34+
Provider.Insert("TestTwo", ["Id", "TestId"], [3, "Not an Int val."]);
3535
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50, ColumnProperty.NotNull));
3636
Provider.ChangeColumn("TestTwo", new Column("TestId", DbType.String, 50, ColumnProperty.NotNull));
3737
}

src/Migrator/DuplicatedVersionException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
using System;
1515

16-
namespace Migrator;
16+
namespace DotNetProjects.Migrator;
1717

1818
/// <summary>
1919
/// Exception thrown when a migration number is not unique.

src/Migrator/Framework/Support/TransformationProviderUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class TransformationProviderUtility
88
{
99
public const int MaxLengthForForeignKeyInOracle = 30;
1010
//static readonly ILog log = LogManager.GetLogger(typeof (TransformationProviderUtility));
11-
private static readonly string[] CommonWords = new[] { "Test" };
11+
private static readonly string[] CommonWords = ["Test"];
1212

1313
public static string CreateForeignKeyName(string tableName, string foreignKeyTableName)
1414
{

src/Migrator/MigrationLoader.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Reflection;
44
using Migrator.Framework;
55
using System.Linq;
6+
using DotNetProjects.Migrator;
67

78
namespace Migrator;
89

src/Migrator/ProviderFactory.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ public static Dialect DialectForProvider(ProviderTypes providerType)
8383
return (Dialect)Activator.CreateInstance(typeof(SqlServerDialect));
8484
case ProviderTypes.SqlServer2005:
8585
return (Dialect)Activator.CreateInstance(typeof(SqlServer2005Dialect));
86-
case ProviderTypes.SqlServerCe:
87-
return (Dialect)Activator.CreateInstance(typeof(SqlServerCeDialect));
8886
case ProviderTypes.MsOracle:
8987
return (Dialect)Activator.CreateInstance(typeof(MsOracleDialect));
9088
case ProviderTypes.IBM_DB2:

src/Migrator/Providers/Impl/PostgreSQL/PostgreSQLTransformationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public override void ChangeColumn(string table, Column column)
212212

213213
if (isUniqueSet)
214214
{
215-
AddUniqueConstraint(string.Format("UX_{0}_{1}", table, column.Name), table, new string[] { column.Name });
215+
AddUniqueConstraint(string.Format("UX_{0}_{1}", table, column.Name), table, [column.Name]);
216216
}
217217
}
218218

src/Migrator/Providers/TransformationProvider.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ protected virtual string GetWhereStringIsNotNull(string[] whereColumns)
14601460
public virtual int InsertIfNotExists(string table, string[] columns, object[] values, string[] whereColumns, object[] whereValues)
14611461
{
14621462
using var cmd = CreateCommand();
1463-
using var reader = this.Select(cmd, table, new[] { whereColumns[0] }, whereColumns, whereValues);
1463+
using var reader = this.Select(cmd, table, [whereColumns[0]], whereColumns, whereValues);
14641464
if (!reader.Read())
14651465
{
14661466
reader.Close();
@@ -1631,7 +1631,7 @@ public virtual List<long> AppliedMigrations
16311631

16321632
public virtual bool IsMigrationApplied(long version, string scope)
16331633
{
1634-
var value = SelectScalar("Version", _schemaInfotable, new[] { "Scope", "Version" }, new object[] { scope, version });
1634+
var value = SelectScalar("Version", _schemaInfotable, ["Scope", "Version"], [scope, version]);
16351635
return Convert.ToInt64(value) == version;
16361636
}
16371637

@@ -1642,7 +1642,7 @@ public virtual bool IsMigrationApplied(long version, string scope)
16421642
public virtual void MigrationApplied(long version, string scope)
16431643
{
16441644
CreateSchemaInfoTable();
1645-
Insert(_schemaInfotable, new string[] { "Scope", "Version", "TimeStamp" }, new object[] { scope ?? _scope, version, DateTime.UtcNow });
1645+
Insert(_schemaInfotable, ["Scope", "Version", "TimeStamp"], [scope ?? _scope, version, DateTime.UtcNow]);
16461646
_appliedMigrations.Add(version);
16471647
}
16481648

@@ -1653,7 +1653,7 @@ public virtual void MigrationApplied(long version, string scope)
16531653
public virtual void MigrationUnApplied(long version, string scope)
16541654
{
16551655
CreateSchemaInfoTable();
1656-
Delete(_schemaInfotable, new[] { "Scope", "Version" }, new[] { scope ?? _scope, version.ToString() });
1656+
Delete(_schemaInfotable, ["Scope", "Version"], [scope ?? _scope, version.ToString()]);
16571657
_appliedMigrations.Remove(version);
16581658
}
16591659

@@ -1890,7 +1890,7 @@ protected virtual void CreateSchemaInfoTable()
18901890
{
18911891
AddColumn(_schemaInfotable, "Scope", DbType.String, 50, ColumnProperty.NotNull, "default");
18921892
RemoveAllConstraints(_schemaInfotable);
1893-
AddPrimaryKey("PK_SchemaInfo", _schemaInfotable, new[] { "Version", "Scope" });
1893+
AddPrimaryKey("PK_SchemaInfo", _schemaInfotable, ["Version", "Scope"]);
18941894
}
18951895

18961896
if (!ColumnExists(_schemaInfotable, "TimeStamp"))
@@ -1902,7 +1902,7 @@ protected virtual void CreateSchemaInfoTable()
19021902

19031903
public virtual string QuoteValues(string values)
19041904
{
1905-
return QuoteValues(new[] { values })[0];
1905+
return QuoteValues([values])[0];
19061906
}
19071907

19081908
public virtual string[] QuoteValues(string[] values)

0 commit comments

Comments
 (0)