-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathDeleteAllUnitTestDatabases.cs
37 lines (32 loc) · 1.38 KB
/
DeleteAllUnitTestDatabases.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2017 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
// Licensed under MIT licence. See License.txt in the project root for license information.
using test.Attributes;
using test.EfHelpers;
using Xunit.Abstractions;
namespace test.UnitCommands
{
public class DeleteAllUnitTestDatabases
{
private readonly ITestOutputHelper _output;
public DeleteAllUnitTestDatabases(ITestOutputHelper output)
{
_output = output;
}
//Run this method to wipe ALL the test database for the current branch
//You need to run it in debug mode - that stops it being run when you "run all" unit tests
[RunnableInDebugOnly]
public void DeleteAllTestDatabasesOk()
{
var numDeleted = SqlDatabaseHelpers.DeleteAllUnitTestBranchDatabases();
_output.WriteLine("This deleted {0} databases.", numDeleted);
}
//Run this method to wipe ALL the test database for the current branch
//You need to run it in debug mode - that stops it being run when you "run all" unit tests
[RunnableInDebugOnly]
public void DeleteAllTestDatabasesForAllBranchesOk()
{
var numDeleted = SqlDatabaseHelpers.DeleteAllUnitTestDatabasesForAllBranches();
_output.WriteLine("This deleted {0} databases.", numDeleted);
}
}
}