Skip to content

Commit d2ab8cf

Browse files
committed
Fixed tests for NUnit console runner
1 parent 157839c commit d2ab8cf

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_VERSION = "0.8.3"
1+
BUILD_VERSION = "0.8.5"

src/LightningDB.Tests/CursorTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public class CursorTests
1818
public CursorTests()
1919
{
2020
var location = typeof(EnvironmentTests).Assembly.Location;
21-
_path = Path.Combine(Path.GetDirectoryName(location), "TestDb");
21+
_path = Path.Combine(
22+
Path.GetDirectoryName(location),
23+
"TestDb" + Guid.NewGuid().ToString());
2224
}
2325

2426
[SetUp]

src/LightningDB.Tests/DatabaseIOTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public class DatabaseIOTests
1919
public DatabaseIOTests()
2020
{
2121
var location = typeof(EnvironmentTests).Assembly.Location;
22-
_path = Path.Combine(Path.GetDirectoryName(location), "TestDb");
22+
_path = Path.Combine(
23+
Path.GetDirectoryName(location),
24+
"TestDb" + Guid.NewGuid().ToString());
2325
}
2426

2527
[SetUp]

src/LightningDB.Tests/DatabaseTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using NUnit.Framework;
34

45
namespace LightningDB.Tests
@@ -13,7 +14,9 @@ public class DatabaseTests
1314
public DatabaseTests()
1415
{
1516
var location = typeof(EnvironmentTests).Assembly.Location;
16-
_path = Path.Combine(Path.GetDirectoryName(location), "TestDb");
17+
_path = Path.Combine(
18+
Path.GetDirectoryName(location),
19+
"TestDb" + Guid.NewGuid().ToString());
1720
}
1821

1922
[SetUp]

src/LightningDB.Tests/EnvironmentTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using NUnit.Framework;
34

45
namespace LightningDB.Tests
@@ -14,7 +15,7 @@ public EnvironmentTests()
1415
var location = typeof(EnvironmentTests).Assembly.Location;
1516
var dir = Path.GetDirectoryName(location);
1617

17-
_path = Path.Combine(dir, "TestDb");
18+
_path = Path.Combine(dir, "TestDb" + Guid.NewGuid().ToString());
1819
_pathCopy = _path + "Copy";
1920
}
2021

src/LightningDB.Tests/TransactionTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using NUnit.Framework;
34

45
namespace LightningDB.Tests
@@ -13,7 +14,9 @@ public class TransactionTests
1314
public TransactionTests()
1415
{
1516
var location = typeof(EnvironmentTests).Assembly.Location;
16-
_path = Path.Combine(Path.GetDirectoryName(location), "TestDb");
17+
_path = Path.Combine(
18+
Path.GetDirectoryName(location),
19+
"TestDb" + Guid.NewGuid().ToString());
1720
}
1821

1922
[SetUp]
@@ -30,11 +33,7 @@ public void Cleanup()
3033
{
3134
_env.Close();
3235

33-
try
34-
{
35-
Directory.Delete(_path, true);
36-
}
37-
catch { }
36+
Directory.Delete(_path, true);
3837
}
3938

4039
[Test]

0 commit comments

Comments
 (0)