Skip to content

Commit d0b8933

Browse files
committed
update .sln to use file-scoped namespaces
1 parent 2811b70 commit d0b8933

221 files changed

Lines changed: 12084 additions & 12305 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Sources/SqlDatabase.PowerShell.Test/CreateCmdLetTest.cs

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,79 +4,78 @@
44
using SqlDatabase.Configuration;
55
using SqlDatabase.PowerShell.TestApi;
66

7-
namespace SqlDatabase.PowerShell
7+
namespace SqlDatabase.PowerShell;
8+
9+
[TestFixture]
10+
public class CreateCmdLetTest : SqlDatabaseCmdLetTest<CreateCmdLet>
811
{
9-
[TestFixture]
10-
public class CreateCmdLetTest : SqlDatabaseCmdLetTest<CreateCmdLet>
12+
[Test]
13+
[TestCase("New-SqlDatabase")]
14+
[TestCase("Create-SqlDatabase")]
15+
public void BuildCommandLine(string commandName)
1116
{
12-
[Test]
13-
[TestCase("New-SqlDatabase")]
14-
[TestCase("Create-SqlDatabase")]
15-
public void BuildCommandLine(string commandName)
16-
{
17-
var commandLines = InvokeSqlDatabase(
18-
commandName,
19-
c =>
20-
{
21-
c.Parameters.Add(nameof(CreateCmdLet.Database), "connection string");
22-
c.Parameters.Add(nameof(CreateCmdLet.From), new[] { "file 1", "file 2" });
23-
c.Parameters.Add(nameof(CreateCmdLet.Configuration), "app.config");
24-
c.Parameters.Add(nameof(CreateCmdLet.Var), new[] { "x=1", "y=2" });
25-
c.Parameters.Add(nameof(CreateCmdLet.WhatIf));
26-
c.Parameters.Add(nameof(CreateCmdLet.Log), "log.txt");
27-
});
17+
var commandLines = InvokeSqlDatabase(
18+
commandName,
19+
c =>
20+
{
21+
c.Parameters.Add(nameof(CreateCmdLet.Database), "connection string");
22+
c.Parameters.Add(nameof(CreateCmdLet.From), new[] { "file 1", "file 2" });
23+
c.Parameters.Add(nameof(CreateCmdLet.Configuration), "app.config");
24+
c.Parameters.Add(nameof(CreateCmdLet.Var), new[] { "x=1", "y=2" });
25+
c.Parameters.Add(nameof(CreateCmdLet.WhatIf));
26+
c.Parameters.Add(nameof(CreateCmdLet.Log), "log.txt");
27+
});
2828

29-
commandLines.Length.ShouldBe(1);
30-
var commandLine = commandLines[0];
29+
commandLines.Length.ShouldBe(1);
30+
var commandLine = commandLines[0];
3131

32-
commandLine.Command.ShouldBe(CommandLineFactory.CommandCreate);
33-
commandLine.Connection.ShouldBe("connection string");
32+
commandLine.Command.ShouldBe(CommandLineFactory.CommandCreate);
33+
commandLine.Connection.ShouldBe("connection string");
3434

35-
commandLine.Scripts.Count.ShouldBe(2);
36-
Path.IsPathRooted(commandLine.Scripts[0]).ShouldBeTrue();
37-
Path.GetFileName(commandLine.Scripts[0]).ShouldBe("file 1");
38-
Path.IsPathRooted(commandLine.Scripts[1]).ShouldBeTrue();
39-
Path.GetFileName(commandLine.Scripts[1]).ShouldBe("file 2");
35+
commandLine.Scripts.Count.ShouldBe(2);
36+
Path.IsPathRooted(commandLine.Scripts[0]).ShouldBeTrue();
37+
Path.GetFileName(commandLine.Scripts[0]).ShouldBe("file 1");
38+
Path.IsPathRooted(commandLine.Scripts[1]).ShouldBeTrue();
39+
Path.GetFileName(commandLine.Scripts[1]).ShouldBe("file 2");
4040

41-
Path.IsPathRooted(commandLine.ConfigurationFile).ShouldBeTrue();
42-
Path.GetFileName(commandLine.ConfigurationFile).ShouldBe("app.config");
41+
Path.IsPathRooted(commandLine.ConfigurationFile).ShouldBeTrue();
42+
Path.GetFileName(commandLine.ConfigurationFile).ShouldBe("app.config");
4343

44-
Path.IsPathRooted(commandLine.LogFileName).ShouldBeTrue();
45-
Path.GetFileName(commandLine.LogFileName).ShouldBe("log.txt");
44+
Path.IsPathRooted(commandLine.LogFileName).ShouldBeTrue();
45+
Path.GetFileName(commandLine.LogFileName).ShouldBe("log.txt");
4646

47-
commandLine.WhatIf.ShouldBeTrue();
47+
commandLine.WhatIf.ShouldBeTrue();
4848

49-
commandLine.Variables.Keys.ShouldBe(new[] { "x", "y" });
50-
commandLine.Variables["x"].ShouldBe("1");
51-
commandLine.Variables["y"].ShouldBe("2");
52-
}
49+
commandLine.Variables.Keys.ShouldBe(new[] { "x", "y" });
50+
commandLine.Variables["x"].ShouldBe("1");
51+
commandLine.Variables["y"].ShouldBe("2");
52+
}
5353

54-
[Test]
55-
[TestCase("New-SqlDatabase")]
56-
[TestCase("Create-SqlDatabase")]
57-
public void BuildPipeCommandLine(string commandName)
58-
{
59-
var commandLines = InvokeInvokeSqlDatabasePipeLine(
60-
commandName,
61-
c => c.Parameters.Add(nameof(CreateCmdLet.Database), "connection string"),
62-
"file 1",
63-
"file 2");
54+
[Test]
55+
[TestCase("New-SqlDatabase")]
56+
[TestCase("Create-SqlDatabase")]
57+
public void BuildPipeCommandLine(string commandName)
58+
{
59+
var commandLines = InvokeInvokeSqlDatabasePipeLine(
60+
commandName,
61+
c => c.Parameters.Add(nameof(CreateCmdLet.Database), "connection string"),
62+
"file 1",
63+
"file 2");
6464

65-
commandLines.Length.ShouldBe(2);
65+
commandLines.Length.ShouldBe(2);
6666

67-
commandLines[0].Command.ShouldBe(CommandLineFactory.CommandCreate);
68-
commandLines[0].Connection.ShouldBe("connection string");
69-
commandLines[0].Scripts.Count.ShouldBe(1);
70-
Path.IsPathRooted(commandLines[0].Scripts[0]).ShouldBeTrue();
71-
Path.GetFileName(commandLines[0].Scripts[0]).ShouldBe("file 1");
72-
commandLines[0].InLineScript.Count.ShouldBe(0);
67+
commandLines[0].Command.ShouldBe(CommandLineFactory.CommandCreate);
68+
commandLines[0].Connection.ShouldBe("connection string");
69+
commandLines[0].Scripts.Count.ShouldBe(1);
70+
Path.IsPathRooted(commandLines[0].Scripts[0]).ShouldBeTrue();
71+
Path.GetFileName(commandLines[0].Scripts[0]).ShouldBe("file 1");
72+
commandLines[0].InLineScript.Count.ShouldBe(0);
7373

74-
commandLines[1].Command.ShouldBe(CommandLineFactory.CommandCreate);
75-
commandLines[1].Connection.ShouldBe("connection string");
76-
commandLines[1].Scripts.Count.ShouldBe(1);
77-
Path.IsPathRooted(commandLines[1].Scripts[0]).ShouldBeTrue();
78-
Path.GetFileName(commandLines[1].Scripts[0]).ShouldBe("file 2");
79-
commandLines[1].InLineScript.Count.ShouldBe(0);
80-
}
74+
commandLines[1].Command.ShouldBe(CommandLineFactory.CommandCreate);
75+
commandLines[1].Connection.ShouldBe("connection string");
76+
commandLines[1].Scripts.Count.ShouldBe(1);
77+
Path.IsPathRooted(commandLines[1].Scripts[0]).ShouldBeTrue();
78+
Path.GetFileName(commandLines[1].Scripts[0]).ShouldBe("file 2");
79+
commandLines[1].InLineScript.Count.ShouldBe(0);
8180
}
82-
}
81+
}

Sources/SqlDatabase.PowerShell.Test/ExecuteCmdLetTest.cs

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,84 +4,83 @@
44
using SqlDatabase.Configuration;
55
using SqlDatabase.PowerShell.TestApi;
66

7-
namespace SqlDatabase.PowerShell
7+
namespace SqlDatabase.PowerShell;
8+
9+
[TestFixture]
10+
public class ExecuteCmdLetTest : SqlDatabaseCmdLetTest<ExecuteCmdLet>
811
{
9-
[TestFixture]
10-
public class ExecuteCmdLetTest : SqlDatabaseCmdLetTest<ExecuteCmdLet>
12+
[Test]
13+
[TestCase("Invoke-SqlDatabase")]
14+
[TestCase("Execute-SqlDatabase")]
15+
public void BuildCommandLine(string commandName)
1116
{
12-
[Test]
13-
[TestCase("Invoke-SqlDatabase")]
14-
[TestCase("Execute-SqlDatabase")]
15-
public void BuildCommandLine(string commandName)
16-
{
17-
var commandLines = InvokeSqlDatabase(
18-
commandName,
19-
c =>
20-
{
21-
c.Parameters.Add(nameof(ExecuteCmdLet.Database), "connection string");
22-
c.Parameters.Add(nameof(ExecuteCmdLet.From), new[] { "file 1", "file 2" });
23-
c.Parameters.Add(nameof(ExecuteCmdLet.FromSql), new[] { "sql text 1", "sql text 2" });
24-
c.Parameters.Add(nameof(ExecuteCmdLet.Transaction), TransactionMode.PerStep);
25-
c.Parameters.Add(nameof(ExecuteCmdLet.Configuration), "app.config");
26-
c.Parameters.Add(nameof(ExecuteCmdLet.Var), new[] { "x=1", "y=2" });
27-
c.Parameters.Add(nameof(ExecuteCmdLet.WhatIf));
28-
c.Parameters.Add(nameof(CreateCmdLet.Log), "log.txt");
29-
});
17+
var commandLines = InvokeSqlDatabase(
18+
commandName,
19+
c =>
20+
{
21+
c.Parameters.Add(nameof(ExecuteCmdLet.Database), "connection string");
22+
c.Parameters.Add(nameof(ExecuteCmdLet.From), new[] { "file 1", "file 2" });
23+
c.Parameters.Add(nameof(ExecuteCmdLet.FromSql), new[] { "sql text 1", "sql text 2" });
24+
c.Parameters.Add(nameof(ExecuteCmdLet.Transaction), TransactionMode.PerStep);
25+
c.Parameters.Add(nameof(ExecuteCmdLet.Configuration), "app.config");
26+
c.Parameters.Add(nameof(ExecuteCmdLet.Var), new[] { "x=1", "y=2" });
27+
c.Parameters.Add(nameof(ExecuteCmdLet.WhatIf));
28+
c.Parameters.Add(nameof(CreateCmdLet.Log), "log.txt");
29+
});
3030

31-
commandLines.Length.ShouldBe(1);
32-
var commandLine = commandLines[0];
31+
commandLines.Length.ShouldBe(1);
32+
var commandLine = commandLines[0];
3333

34-
commandLine.Command.ShouldBe(CommandLineFactory.CommandExecute);
35-
commandLine.Connection.ShouldBe("connection string");
34+
commandLine.Command.ShouldBe(CommandLineFactory.CommandExecute);
35+
commandLine.Connection.ShouldBe("connection string");
3636

37-
commandLine.Scripts.Count.ShouldBe(2);
38-
Path.IsPathRooted(commandLine.Scripts[0]).ShouldBeTrue();
39-
Path.GetFileName(commandLine.Scripts[0]).ShouldBe("file 1");
40-
Path.IsPathRooted(commandLine.Scripts[1]).ShouldBeTrue();
41-
Path.GetFileName(commandLine.Scripts[1]).ShouldBe("file 2");
37+
commandLine.Scripts.Count.ShouldBe(2);
38+
Path.IsPathRooted(commandLine.Scripts[0]).ShouldBeTrue();
39+
Path.GetFileName(commandLine.Scripts[0]).ShouldBe("file 1");
40+
Path.IsPathRooted(commandLine.Scripts[1]).ShouldBeTrue();
41+
Path.GetFileName(commandLine.Scripts[1]).ShouldBe("file 2");
4242

43-
commandLine.InLineScript.ShouldBe(new[] { "sql text 1", "sql text 2" });
44-
commandLine.Transaction.ShouldBe(TransactionMode.PerStep);
43+
commandLine.InLineScript.ShouldBe(new[] { "sql text 1", "sql text 2" });
44+
commandLine.Transaction.ShouldBe(TransactionMode.PerStep);
4545

46-
Path.IsPathRooted(commandLine.ConfigurationFile).ShouldBeTrue();
47-
Path.GetFileName(commandLine.ConfigurationFile).ShouldBe("app.config");
46+
Path.IsPathRooted(commandLine.ConfigurationFile).ShouldBeTrue();
47+
Path.GetFileName(commandLine.ConfigurationFile).ShouldBe("app.config");
4848

49-
Path.IsPathRooted(commandLine.LogFileName).ShouldBeTrue();
50-
Path.GetFileName(commandLine.LogFileName).ShouldBe("log.txt");
49+
Path.IsPathRooted(commandLine.LogFileName).ShouldBeTrue();
50+
Path.GetFileName(commandLine.LogFileName).ShouldBe("log.txt");
5151

52-
commandLine.WhatIf.ShouldBeTrue();
52+
commandLine.WhatIf.ShouldBeTrue();
5353

54-
commandLine.Variables.Keys.ShouldBe(new[] { "x", "y" });
55-
commandLine.Variables["x"].ShouldBe("1");
56-
commandLine.Variables["y"].ShouldBe("2");
57-
}
54+
commandLine.Variables.Keys.ShouldBe(new[] { "x", "y" });
55+
commandLine.Variables["x"].ShouldBe("1");
56+
commandLine.Variables["y"].ShouldBe("2");
57+
}
5858

59-
[Test]
60-
[TestCase("Invoke-SqlDatabase")]
61-
[TestCase("Execute-SqlDatabase")]
62-
public void BuildPipeCommandLine(string commandName)
63-
{
64-
var commandLines = InvokeInvokeSqlDatabasePipeLine(
65-
commandName,
66-
c => c.Parameters.Add(nameof(ExecuteCmdLet.Database), "connection string"),
67-
"file 1",
68-
"file 2");
59+
[Test]
60+
[TestCase("Invoke-SqlDatabase")]
61+
[TestCase("Execute-SqlDatabase")]
62+
public void BuildPipeCommandLine(string commandName)
63+
{
64+
var commandLines = InvokeInvokeSqlDatabasePipeLine(
65+
commandName,
66+
c => c.Parameters.Add(nameof(ExecuteCmdLet.Database), "connection string"),
67+
"file 1",
68+
"file 2");
6969

70-
commandLines.Length.ShouldBe(2);
70+
commandLines.Length.ShouldBe(2);
7171

72-
commandLines[0].Command.ShouldBe(CommandLineFactory.CommandExecute);
73-
commandLines[0].Connection.ShouldBe("connection string");
74-
commandLines[0].Scripts.Count.ShouldBe(1);
75-
Path.IsPathRooted(commandLines[0].Scripts[0]).ShouldBeTrue();
76-
Path.GetFileName(commandLines[0].Scripts[0]).ShouldBe("file 1");
77-
commandLines[0].InLineScript.Count.ShouldBe(0);
72+
commandLines[0].Command.ShouldBe(CommandLineFactory.CommandExecute);
73+
commandLines[0].Connection.ShouldBe("connection string");
74+
commandLines[0].Scripts.Count.ShouldBe(1);
75+
Path.IsPathRooted(commandLines[0].Scripts[0]).ShouldBeTrue();
76+
Path.GetFileName(commandLines[0].Scripts[0]).ShouldBe("file 1");
77+
commandLines[0].InLineScript.Count.ShouldBe(0);
7878

79-
commandLines[1].Command.ShouldBe(CommandLineFactory.CommandExecute);
80-
commandLines[1].Connection.ShouldBe("connection string");
81-
commandLines[1].Scripts.Count.ShouldBe(1);
82-
Path.IsPathRooted(commandLines[1].Scripts[0]).ShouldBeTrue();
83-
Path.GetFileName(commandLines[1].Scripts[0]).ShouldBe("file 2");
84-
commandLines[1].InLineScript.Count.ShouldBe(0);
85-
}
79+
commandLines[1].Command.ShouldBe(CommandLineFactory.CommandExecute);
80+
commandLines[1].Connection.ShouldBe("connection string");
81+
commandLines[1].Scripts.Count.ShouldBe(1);
82+
Path.IsPathRooted(commandLines[1].Scripts[0]).ShouldBeTrue();
83+
Path.GetFileName(commandLines[1].Scripts[0]).ShouldBe("file 2");
84+
commandLines[1].InLineScript.Count.ShouldBe(0);
8685
}
8786
}

Sources/SqlDatabase.PowerShell.Test/ExportCmdLetTest.cs

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,52 @@
44
using SqlDatabase.Configuration;
55
using SqlDatabase.PowerShell.TestApi;
66

7-
namespace SqlDatabase.PowerShell
7+
namespace SqlDatabase.PowerShell;
8+
9+
[TestFixture]
10+
public class ExportCmdLetTest : SqlDatabaseCmdLetTest<ExportCmdLet>
811
{
9-
[TestFixture]
10-
public class ExportCmdLetTest : SqlDatabaseCmdLetTest<ExportCmdLet>
12+
[Test]
13+
public void BuildCommandLine()
1114
{
12-
[Test]
13-
public void BuildCommandLine()
14-
{
15-
var commandLines = InvokeSqlDatabase(
16-
"Export-SqlDatabase",
17-
c =>
18-
{
19-
c.Parameters.Add(nameof(ExportCmdLet.Database), "connection string");
20-
c.Parameters.Add(nameof(ExportCmdLet.From), new[] { "file 1", "file 2" });
21-
c.Parameters.Add(nameof(ExportCmdLet.FromSql), new[] { "sql text 1", "sql text 2" });
22-
c.Parameters.Add(nameof(ExportCmdLet.ToFile), "to file");
23-
c.Parameters.Add(nameof(ExportCmdLet.ToTable), "to table");
24-
c.Parameters.Add(nameof(ExportCmdLet.Configuration), "app.config");
25-
c.Parameters.Add(nameof(ExportCmdLet.Var), new[] { "x=1", "y=2" });
26-
c.Parameters.Add(nameof(CreateCmdLet.Log), "log.txt");
27-
});
28-
29-
commandLines.Length.ShouldBe(1);
30-
var commandLine = commandLines[0];
31-
32-
commandLine.Command.ShouldBe(CommandLineFactory.CommandExport);
33-
commandLine.Connection.ShouldBe("connection string");
34-
35-
commandLine.Scripts.Count.ShouldBe(2);
36-
Path.IsPathRooted(commandLine.Scripts[0]).ShouldBeTrue();
37-
Path.GetFileName(commandLine.Scripts[0]).ShouldBe("file 1");
38-
Path.IsPathRooted(commandLine.Scripts[1]).ShouldBeTrue();
39-
Path.GetFileName(commandLine.Scripts[1]).ShouldBe("file 2");
40-
41-
commandLine.InLineScript.ShouldBe(new[] { "sql text 1", "sql text 2" });
42-
commandLine.ExportToFile.ShouldBe("to file");
43-
commandLine.ExportToTable.ShouldBe("to table");
44-
45-
Path.IsPathRooted(commandLine.ConfigurationFile).ShouldBeTrue();
46-
Path.GetFileName(commandLine.ConfigurationFile).ShouldBe("app.config");
47-
48-
Path.IsPathRooted(commandLine.LogFileName).ShouldBeTrue();
49-
Path.GetFileName(commandLine.LogFileName).ShouldBe("log.txt");
50-
51-
commandLine.Variables.Keys.ShouldBe(new[] { "x", "y" });
52-
commandLine.Variables["x"].ShouldBe("1");
53-
commandLine.Variables["y"].ShouldBe("2");
54-
}
15+
var commandLines = InvokeSqlDatabase(
16+
"Export-SqlDatabase",
17+
c =>
18+
{
19+
c.Parameters.Add(nameof(ExportCmdLet.Database), "connection string");
20+
c.Parameters.Add(nameof(ExportCmdLet.From), new[] { "file 1", "file 2" });
21+
c.Parameters.Add(nameof(ExportCmdLet.FromSql), new[] { "sql text 1", "sql text 2" });
22+
c.Parameters.Add(nameof(ExportCmdLet.ToFile), "to file");
23+
c.Parameters.Add(nameof(ExportCmdLet.ToTable), "to table");
24+
c.Parameters.Add(nameof(ExportCmdLet.Configuration), "app.config");
25+
c.Parameters.Add(nameof(ExportCmdLet.Var), new[] { "x=1", "y=2" });
26+
c.Parameters.Add(nameof(CreateCmdLet.Log), "log.txt");
27+
});
28+
29+
commandLines.Length.ShouldBe(1);
30+
var commandLine = commandLines[0];
31+
32+
commandLine.Command.ShouldBe(CommandLineFactory.CommandExport);
33+
commandLine.Connection.ShouldBe("connection string");
34+
35+
commandLine.Scripts.Count.ShouldBe(2);
36+
Path.IsPathRooted(commandLine.Scripts[0]).ShouldBeTrue();
37+
Path.GetFileName(commandLine.Scripts[0]).ShouldBe("file 1");
38+
Path.IsPathRooted(commandLine.Scripts[1]).ShouldBeTrue();
39+
Path.GetFileName(commandLine.Scripts[1]).ShouldBe("file 2");
40+
41+
commandLine.InLineScript.ShouldBe(new[] { "sql text 1", "sql text 2" });
42+
commandLine.ExportToFile.ShouldBe("to file");
43+
commandLine.ExportToTable.ShouldBe("to table");
44+
45+
Path.IsPathRooted(commandLine.ConfigurationFile).ShouldBeTrue();
46+
Path.GetFileName(commandLine.ConfigurationFile).ShouldBe("app.config");
47+
48+
Path.IsPathRooted(commandLine.LogFileName).ShouldBeTrue();
49+
Path.GetFileName(commandLine.LogFileName).ShouldBe("log.txt");
50+
51+
commandLine.Variables.Keys.ShouldBe(new[] { "x", "y" });
52+
commandLine.Variables["x"].ShouldBe("1");
53+
commandLine.Variables["y"].ShouldBe("2");
5554
}
56-
}
55+
}

0 commit comments

Comments
 (0)