Skip to content

Commit ecb930d

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/Server/Coderr.Server.SqlServer.Tests/Helpers/DatabaseManager.cs
2 parents cb05a25 + d33bdcb commit ecb930d

File tree

7 files changed

+18
-1055
lines changed

7 files changed

+18
-1055
lines changed

src/Server/Coderr.Server.SqlServer.Tests/Helpers/DatabaseManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public DatabaseManager(string databaseName = null, Func<string> connectionString
3434
}
3535

3636
var instanceId = Interlocked.Increment(ref InstanceCounter);
37-
_databaseName = databaseName ?? $"coderTest{DateTime.Now:MMddHHmmss}_{instanceId}";
37+
_databaseName = databaseName ?? $"coderrTest{DateTime.Now:MMddHHmmss}_{instanceId}";
3838
Console.WriteLine("DBNMAE: " + _databaseName);
3939
ConnectionString = connectionStringTemplateProvider()
4040
.Replace("{databaseName}", _databaseName);

src/Server/Coderr.Server.SqlServer.Tests/Helpers/TestDataManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public void ActivateAccount(int accountId)
6666
}
6767
}
6868

69-
7069
/// <summary>
7170
/// Creates an incident and a report.
7271
/// </summary>

src/Server/Coderr.Server.SqlServer.Tests/IntegrationTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using codeRR.Server.Api.Core.Incidents.Queries;
32
using codeRR.Server.SqlServer.Core.Accounts;
43
using codeRR.Server.SqlServer.Tests.Helpers;
54
using Griffin.Data;

src/Server/Coderr.Server.Web.Tests/Helpers/IisExpressHelper.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ public void Start(string site)
6060
SetDefaultsWhereNecessary();
6161

6262
if (!File.Exists(ExePath))
63-
throw new FileNotFoundException("Path to IIS Express executable is invalid: '" + ExePath + "'.");
63+
throw new FileNotFoundException($"Path to IIS Express executable is invalid: '{ExePath}'.");
6464

6565
if (string.IsNullOrEmpty(ConfigPath) || !File.Exists(ConfigPath))
66-
throw new FileNotFoundException("Path to IIS Express configuration file is invalid: '" + ConfigPath +
67-
"'.");
66+
throw new FileNotFoundException($"Path to IIS Express configuration file is invalid: '{ConfigPath}'.");
6867

6968
var iisExpressThread = new Thread(() => StartIisExpress(p => _process = p, site)) {IsBackground = true};
7069
iisExpressThread.Start();
@@ -76,9 +75,9 @@ public void Start(string site)
7675
Thread.Sleep(200);
7776
attemptsLeft--;
7877
}
78+
7979
if (_process == null)
8080
throw new InvalidOperationException("Failed to start IIS express");
81-
8281
}
8382

8483
/// <summary>
@@ -155,7 +154,6 @@ private void StartIisExpress(Action<Process> action, string site)
155154
if (!isRunning)
156155
throw new InvalidOperationException("Failed to receive data from IIS ex");
157156

158-
159157
action(process);
160158
}
161159
}

src/Server/Coderr.Server.Web.Tests/WebTest.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ static WebTest()
2525
mapper.Scan(typeof(AccountRepository).Assembly);
2626
EntityMappingProvider.Provider = mapper;
2727

28-
2928
_databaseManager.CreateEmptyDatabase();
3029
_databaseManager.InitSchema();
3130

@@ -39,12 +38,12 @@ static WebTest()
3938
_iisExpress = new IisExpressHelper
4039
{
4140
ConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "applicationhost.config"),
42-
EnvironmentVariables =
43-
new Dictionary<string, string> { { "coderr_ConnectionString", _databaseManager.ConnectionString } }
41+
42+
// Pass on connectionstring to codeRR.Server.Web during testing, overriding connectionstring in web.config
43+
EnvironmentVariables = new Dictionary<string, string> { { "coderr_ConnectionString", _databaseManager.ConnectionString } }
4444
};
4545
_iisExpress.Start("codeRR.Server.Web");
4646

47-
4847
TestData = new TestDataManager(_databaseManager.OpenConnection);
4948
WebDriver = DriverFactory.Create(BrowserType.Chrome);
5049
AppDomain.CurrentDomain.DomainUnload += (o, e) => { DisposeWebDriver(); };
@@ -56,7 +55,6 @@ protected WebTest()
5655
TestData.ResetDatabase(_iisExpress.BaseUrl);
5756
}
5857

59-
6058
public string ServerUrl => _iisExpress.BaseUrl;
6159

6260
public static TestDataManager TestData { get; }

0 commit comments

Comments
 (0)