Index: Migration/Core/test/Migration.Core.Storage.Test/Migration.Core.Storage.Test.csproj
===================================================================
diff -u -r08e8d26a0715f0f3db57c1d3e86256aa06934db4 -re401a63b704142abd9fe4050de03c6f661d2670b
--- Migration/Core/test/Migration.Core.Storage.Test/Migration.Core.Storage.Test.csproj (.../Migration.Core.Storage.Test.csproj) (revision 08e8d26a0715f0f3db57c1d3e86256aa06934db4)
+++ Migration/Core/test/Migration.Core.Storage.Test/Migration.Core.Storage.Test.csproj (.../Migration.Core.Storage.Test.csproj) (revision e401a63b704142abd9fe4050de03c6f661d2670b)
@@ -19,8 +19,11 @@
3.8.1
-
- 3.6.1
+
+ 4.4.0
+
+ 1.0.16
+
\ No newline at end of file
Index: Migration/Core/test/Migration.Core.Storage.Test/VersionedFileMigratorTest.cs
===================================================================
diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -re401a63b704142abd9fe4050de03c6f661d2670b
--- Migration/Core/test/Migration.Core.Storage.Test/VersionedFileMigratorTest.cs (.../VersionedFileMigratorTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980)
+++ Migration/Core/test/Migration.Core.Storage.Test/VersionedFileMigratorTest.cs (.../VersionedFileMigratorTest.cs) (revision e401a63b704142abd9fe4050de03c6f661d2670b)
@@ -27,8 +27,8 @@
using Migration.Scripts.Data;
using Migration.Scripts.Data.Exceptions;
using Migration.Scripts.Data.TestUtil;
+using NSubstitute;
using NUnit.Framework;
-using Rhino.Mocks;
namespace Migration.Core.Storage.Test
{
@@ -52,17 +52,14 @@
public void IsVersionSupported_FromVersionIsNullOrWhiteSpace_ReturnsFalse(string fromVersion)
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
var migrator = new SimpleVersionedFileMigrator(comparer);
// Call
bool isSupported = migrator.IsVersionSupported(fromVersion);
// Assert
Assert.IsFalse(isSupported);
- mockRepository.VerifyAll();
}
[Test]
@@ -71,9 +68,7 @@
public void IsVersionSupported_ValidFromVersion_ReturnsIfSupported(string fromVersion, bool shouldSupport)
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
const string toVersion = "1";
var migrator = new SimpleVersionedFileMigrator(comparer)
@@ -93,16 +88,13 @@
// Assert
Assert.AreEqual(shouldSupport, isSupported);
- mockRepository.VerifyAll();
}
[Test]
public void NeedsMigrate_VersionedFileNull_ThrowsArgumentNullException()
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
var migrator = new SimpleVersionedFileMigrator(comparer);
// Call
@@ -111,17 +103,14 @@
// Assert
string paramName = Assert.Throws(call).ParamName;
Assert.AreEqual("versionedFile", paramName);
- mockRepository.VerifyAll();
}
[Test]
public void NeedsMigrate_ToVersionNull_ThrowsArgumentNullException()
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
var migrator = new SimpleVersionedFileMigrator(comparer);
// Call
@@ -130,7 +119,6 @@
// Assert
string paramName = Assert.Throws(call).ParamName;
Assert.AreEqual("toVersion", paramName);
- mockRepository.VerifyAll();
}
[Test]
@@ -140,10 +128,8 @@
public void NeedsMigrate_ValidVersionedFile_ReturnsIfNeedsMigrate(string fromVersion, string toVersion, bool shouldMigrate)
{
// Setup
- var mockRepository = new MockRepository();
- var versionedFile = mockRepository.Stub();
- versionedFile.Expect(vf => vf.GetVersion()).Return(fromVersion);
- mockRepository.ReplayAll();
+ var versionedFile = Substitute.For();
+ versionedFile.GetVersion().Returns(fromVersion);
var migrator = new SimpleVersionedFileMigrator(new SimpleVersionComparer())
{
@@ -162,16 +148,14 @@
// Assert
Assert.AreEqual(shouldMigrate, needsMigrate);
- mockRepository.VerifyAll();
+ versionedFile.Received().GetVersion();
}
[Test]
public void Migrate_VersionedFileNull_ThrowsArgumentNullException()
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
const string toVersion = "toVersion";
const string toLocation = "location";
@@ -184,17 +168,14 @@
// Assert
string paramName = Assert.Throws(call).ParamName;
Assert.AreEqual("versionedFile", paramName);
- mockRepository.VerifyAll();
}
[Test]
public void Migrate_ToVersionNull_ThrowsArgumentNullException()
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
const string toLocation = "location";
@@ -206,17 +187,14 @@
// Assert
string paramName = Assert.Throws(call).ParamName;
Assert.AreEqual("toVersion", paramName);
- mockRepository.VerifyAll();
}
[Test]
public void Migrate_NewFileLocationNull_ThrowsArgumentNullException()
{
// Setup
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
const string toVersion = "toVersion";
@@ -228,7 +206,6 @@
// Assert
string paramName = Assert.Throws(call).ParamName;
Assert.AreEqual("newFileLocation", paramName);
- mockRepository.VerifyAll();
}
[Test]
@@ -238,11 +215,9 @@
const string toVersion = "toVersion";
const string toLocation = "location";
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- versionedFile.Expect(vf => vf.Location).Return(toLocation);
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
+ versionedFile.Location.Returns(toLocation);
var migrator = new SimpleVersionedFileMigrator(comparer);
@@ -252,7 +227,7 @@
// Assert
var exception = Assert.Throws(call);
Assert.AreEqual("Het doelprojectpad moet anders zijn dan het bronprojectpad.", exception.Message);
- mockRepository.VerifyAll();
+ _ = versionedFile.Received().Location;
}
[Test]
@@ -264,12 +239,10 @@
const string toLocation = "location";
const string incorrectVersion = "not supported";
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- versionedFile.Expect(vf => vf.Location).Return(fromLocation);
- versionedFile.Expect(vf => vf.GetVersion()).Return(incorrectVersion);
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
+ versionedFile.Location.Returns(fromLocation);
+ versionedFile.GetVersion().Returns(incorrectVersion);
var migrator = new SimpleVersionedFileMigrator(comparer);
@@ -279,7 +252,8 @@
// Assert
var exception = Assert.Throws(call);
Assert.AreEqual($"Het migreren van een projectbestand met versie '{incorrectVersion}' naar versie '{toVersion}' is niet ondersteund.", exception.Message);
- mockRepository.VerifyAll();
+ _ = versionedFile.Received().Location;
+ versionedFile.Received().GetVersion();
}
[Test]
@@ -292,12 +266,10 @@
const string toLocation = "location";
const string incorrectVersion = "not supported";
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- versionedFile.Expect(vf => vf.Location).Return(fromLocation);
- versionedFile.Expect(vf => vf.GetVersion()).Return(fromVersion);
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
+ versionedFile.Location.Returns(fromLocation);
+ versionedFile.GetVersion().Returns(fromVersion);
var migrator = new SimpleVersionedFileMigrator(comparer)
{
@@ -317,7 +289,8 @@
// Assert
var exception = Assert.Throws(call);
Assert.AreEqual($"Het migreren van een projectbestand met versie '{fromVersion}' naar versie '{incorrectVersion}' is niet ondersteund.", exception.Message);
- mockRepository.VerifyAll();
+ _ = versionedFile.Received().Location;
+ versionedFile.Received().GetVersion();
}
[Test]
@@ -330,12 +303,10 @@
string toLocation = TestHelper.GetScratchPadPath(nameof(Migrate_ValidMigration_CreatesNewVersion));
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- versionedFile.Stub(vf => vf.Location).Return(fromLocation);
- versionedFile.Expect(vf => vf.GetVersion()).Return(fromVersion);
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
+ versionedFile.Location.Returns(fromLocation);
+ versionedFile.GetVersion().Returns(fromVersion);
var migrator = new SimpleVersionedFileMigrator(comparer)
{
@@ -356,7 +327,8 @@
Assert.IsTrue(File.Exists(toLocation), $"File at location {toLocation} has not been created");
using (new FileDisposeHelper(toLocation)) {}
- mockRepository.VerifyAll();
+ _ = versionedFile.Received().Location;
+ versionedFile.Received().GetVersion();
}
[Test]
@@ -369,11 +341,9 @@
string toLocation = TestHelper.GetScratchPadPath(nameof(Migrate_ValidChainingMigration_CreatesNewVersion));
- var mockRepository = new MockRepository();
- var versionedFile = mockRepository.Stub();
- versionedFile.Stub(vf => vf.Location).Return(fromLocation);
- versionedFile.Expect(vf => vf.GetVersion()).Return(fromVersion);
- mockRepository.ReplayAll();
+ var versionedFile = Substitute.For();
+ versionedFile.Location.Returns(fromLocation);
+ versionedFile.GetVersion().Returns(fromVersion);
var migrator = new SimpleVersionedFileMigrator(new SimpleVersionComparer())
{
@@ -396,7 +366,8 @@
Assert.IsTrue(File.Exists(toLocation), $"File at location {toLocation} has not been created");
File.Delete(toLocation);
- mockRepository.VerifyAll();
+ _ = versionedFile.Received().Location;
+ versionedFile.Received().GetVersion();
}
[Test]
@@ -409,12 +380,10 @@
string toLocation = TestHelper.GetScratchPadPath(nameof(Migrate_ValidMigrationFileInUse_ThrowsCriticalMigrationException));
- var mockRepository = new MockRepository();
- var comparer = mockRepository.Stub();
- var versionedFile = mockRepository.Stub();
- versionedFile.Stub(vf => vf.Location).Return(fromLocation);
- versionedFile.Expect(vf => vf.GetVersion()).Return(fromVersion);
- mockRepository.ReplayAll();
+ var comparer = Substitute.For();
+ var versionedFile = Substitute.For();
+ versionedFile.Location.Returns(fromLocation);
+ versionedFile.GetVersion().Returns(fromVersion);
using (var fileDisposeHelper = new FileDisposeHelper(toLocation))
{
@@ -441,7 +410,8 @@
exception.Message);
}
- mockRepository.VerifyAll();
+ _ = versionedFile.Received().Location;
+ versionedFile.Received().GetVersion();
}
private class SimpleVersionComparer : IComparer
Index: Riskeer/Migration/test/Riskeer.Migration.Test/ProjectMigratorTest.cs
===================================================================
diff -u -r9339a780307cdb21ebe38cbd3aa8811e2c98d980 -re401a63b704142abd9fe4050de03c6f661d2670b
--- Riskeer/Migration/test/Riskeer.Migration.Test/ProjectMigratorTest.cs (.../ProjectMigratorTest.cs) (revision 9339a780307cdb21ebe38cbd3aa8811e2c98d980)
+++ Riskeer/Migration/test/Riskeer.Migration.Test/ProjectMigratorTest.cs (.../ProjectMigratorTest.cs) (revision e401a63b704142abd9fe4050de03c6f661d2670b)
@@ -29,8 +29,8 @@
using Core.Common.Util;
using Core.Common.Util.TestUtil.Settings;
using Core.Gui.Helpers;
+using NSubstitute;
using NUnit.Framework;
-using Rhino.Mocks;
using Riskeer.Common.Util;
using Riskeer.Migration.Core;
using Riskeer.Migration.Core.TestUtil;
@@ -71,27 +71,20 @@
public void Constructor_ReturnsExpectedProperties()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
// Call
var migrator = new ProjectMigrator(inquiryHelper);
// Assert
Assert.IsInstanceOf(migrator);
-
- mocks.VerifyAll();
}
[Test]
public void ShouldMigrate_FilePathNull_ThrowsArgumentNullException()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
// Call
@@ -100,19 +93,14 @@
// Assert
var exception = Assert.Throws(Call);
Assert.AreEqual("filePath", exception.ParamName);
-
- mocks.VerifyAll();
}
[Test]
[TestCaseSource(typeof(InvalidPathHelper), nameof(InvalidPathHelper.InvalidPaths))]
public void ShouldMigrate_InvalidFilePath_ThrowsArgumentException(string invalidFilePath)
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
// Call
@@ -122,17 +110,13 @@
var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(
Call, "Bronprojectpad moet een geldig projectpad zijn.");
Assert.AreEqual("filePath", exception.ParamName);
-
- mocks.VerifyAll();
}
[Test]
public void ShouldMigrate_OutdatedProjectUnsupported_ReturnsNotSupportedAndGeneratesLogMessages()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
string sourceFilePath = ProjectMigrationTestHelper.GetOutdatedUnSupportedProjectFilePath();
var versionedFile = new ProjectVersionedFile(sourceFilePath);
@@ -148,8 +132,6 @@
var expectedMessage = $"Het migreren van een projectbestand met versie '{fileVersion}' naar versie '{currentDatabaseVersion}' is niet ondersteund.";
TestHelper.AssertLogMessageIsGenerated(Call, expectedMessage);
Assert.AreEqual(MigrationRequired.NotSupported, shouldMigrate);
-
- mocks.VerifyAll();
}
[Test]
@@ -161,10 +143,8 @@
string question = "Het project dat u wilt openen is opgeslagen in het formaat van een eerdere versie van Riskeer of Ringtoets." +
$"{Environment.NewLine}{Environment.NewLine}" +
$"Weet u zeker dat u het bestand wilt migreren naar het formaat van uw huidige Riskeerversie ({currentDatabaseVersion})?";
- var mocks = new MockRepository();
- var inquiryHelper = mocks.StrictMock();
- inquiryHelper.Expect(h => h.InquireContinuation(question)).Return(confirmContinuation);
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
+ inquiryHelper.InquireContinuation(question).Returns(confirmContinuation);
string sourceFilePath = ProjectMigrationTestHelper.GetOutdatedSupportedProjectFilePath();
@@ -186,17 +166,13 @@
MigrationRequired expectedResult = confirmContinuation ? MigrationRequired.Yes : MigrationRequired.Aborted;
Assert.AreEqual(expectedResult, shouldMigrate);
-
- mocks.VerifyAll();
}
[Test]
public void ShouldMigrate_LatestProjectVersion_ReturnsFalse()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
string sourceFilePath = ProjectMigrationTestHelper.GetLatestProjectFilePath();
@@ -207,17 +183,13 @@
// Assert
Assert.AreEqual(MigrationRequired.No, shouldMigrate);
- mocks.VerifyAll();
}
[Test]
public void DetermineMigrationLocation_OriginalFilePathNull_ThrowArgumentNullException()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
// Call
@@ -226,19 +198,14 @@
// Assert
var exception = Assert.Throws(Call);
Assert.AreEqual("originalFilePath", exception.ParamName);
-
- mocks.VerifyAll();
}
[Test]
[TestCaseSource(typeof(InvalidPathHelper), nameof(InvalidPathHelper.InvalidPaths))]
public void DetermineMigrationLocation_InvalidOriginalFilePath_ThrowsArgumentException(string invalidFilePath)
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
// Call
@@ -248,8 +215,6 @@
var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(
Call, "Bronprojectpad moet een geldig projectpad zijn.");
Assert.AreEqual("originalFilePath", exception.ParamName);
-
- mocks.VerifyAll();
}
[Test]
@@ -267,11 +232,9 @@
string expectedReturnPath = TestHelper.GetScratchPadPath("Im_a_file_path_to_the_migrated_file.risk");
- var mocks = new MockRepository();
- var inquiryHelper = mocks.StrictMock();
- inquiryHelper.Expect(h => h.GetTargetFileLocation(expectedFileFilter.Filter, expectedSuggestedFileName))
- .Return(expectedReturnPath);
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
+ inquiryHelper.GetTargetFileLocation(expectedFileFilter.Filter, expectedSuggestedFileName)
+ .Returns(expectedReturnPath);
var migrator = new ProjectMigrator(inquiryHelper);
@@ -280,7 +243,7 @@
// Assert
Assert.AreEqual(expectedReturnPath, targetFilePath);
- mocks.VerifyAll();
+ inquiryHelper.Received().GetTargetFileLocation(expectedFileFilter.Filter, expectedSuggestedFileName);
}
[Test]
@@ -296,11 +259,9 @@
string versionWithDashes = ProjectVersionHelper.GetCurrentDatabaseVersion().Replace('.', '-');
var expectedSuggestedFileName = $"{originalFileName}_{versionWithDashes}";
- var mocks = new MockRepository();
- var inquiryHelper = mocks.StrictMock();
- inquiryHelper.Expect(h => h.GetTargetFileLocation(expectedFileFilter.Filter, expectedSuggestedFileName))
- .Return(null);
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
+ inquiryHelper.GetTargetFileLocation(expectedFileFilter.Filter, expectedSuggestedFileName)
+ .Returns((string) null);
var migrator = new ProjectMigrator(inquiryHelper);
var targetFilePath = "arbitraryPath";
@@ -315,17 +276,14 @@
TestHelper.AssertLogMessageWithLevelIsGenerated(Call, expectedLogMessage, 1);
Assert.IsNull(targetFilePath);
- mocks.VerifyAll();
+ inquiryHelper.Received().GetTargetFileLocation(expectedFileFilter.Filter, expectedSuggestedFileName);
}
[Test]
public void Migrate_SourcePathNull_ThrowsArgumentNullException()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
string targetFileName = $"{nameof(ProjectMigratorTest)}." +
@@ -344,10 +302,7 @@
public void Migrate_TargetPathNull_ThrowsArgumentNullException()
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
string sourceFilePath = ProjectMigrationTestHelper.GetOutdatedSupportedProjectFilePath();
@@ -365,10 +320,7 @@
public void Migrate_InvalidSourceFilePath_ThrowsArgumentException(string invalidFilePath)
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
string targetFileName = $"{nameof(ProjectMigratorTest)}." +
@@ -382,19 +334,14 @@
var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(
Call, "Bronprojectpad moet een geldig projectpad zijn.");
Assert.AreEqual("sourceFilePath", exception.ParamName);
-
- mocks.VerifyAll();
}
[Test]
[TestCaseSource(typeof(InvalidPathHelper), nameof(InvalidPathHelper.InvalidPaths))]
public void Migrate_InvalidTargetFilePath_ThrowsArgumentException(string invalidFilePath)
{
// Setup
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
-
+ var inquiryHelper = Substitute.For();
var migrator = new ProjectMigrator(inquiryHelper);
string sourceFilePath = ProjectMigrationTestHelper.GetOutdatedSupportedProjectFilePath();
@@ -406,8 +353,6 @@
var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(
Call, "Doelprojectpad moet een geldig projectpad zijn.");
Assert.AreEqual("targetFilePath", exception.ParamName);
-
- mocks.VerifyAll();
}
[Test]
@@ -420,9 +365,7 @@
$"{nameof(GivenMigratorAndSupportedFile_WhenValidTargetLocationGiven_ThenFileSuccessfullyMigrates)}.rtd";
string targetFilePath = Path.Combine(TestHelper.GetScratchPadPath(), testDirectory, targetFile);
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
var logDirectory = $"{nameof(GivenMigratorAndSupportedFile_WhenValidTargetLocationGiven_ThenFileSuccessfullyMigrates)}_log";
using (new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), logDirectory))
@@ -629,8 +572,6 @@
string logPath = Path.Combine(TestHelper.GetScratchPadPath(), logDirectory, "RiskeerMigrationLog.sqlite");
Assert.IsFalse(File.Exists(logPath));
-
- mocks.VerifyAll();
}
[Test]
@@ -642,9 +583,7 @@
$"{nameof(Migrate_MigrationLogDatabaseInUse_MigrationFailsAndLogsError)}.rtd";
string targetFilePath = Path.Combine(TestHelper.GetScratchPadPath(), testDirectory, targetFile);
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
var logDirectory = $"{nameof(Migrate_MigrationLogDatabaseInUse_MigrationFailsAndLogsError)}_log";
@@ -674,8 +613,6 @@
Assert.IsTrue(File.Exists(logPath));
}
-
- mocks.VerifyAll();
}
[Test]
@@ -687,9 +624,7 @@
$"{nameof(Migrate_UnableToSaveAtTargetFilePath_MigrationFailsAndLogsError)}.rtd";
string targetFilePath = Path.Combine(TestHelper.GetScratchPadPath(), testDirectory, targetFile);
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
var logDirectory = $"{nameof(Migrate_UnableToSaveAtTargetFilePath_MigrationFailsAndLogsError)}_log";
using (new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), logDirectory))
@@ -720,8 +655,6 @@
string logPath = Path.Combine(TestHelper.GetScratchPadPath(), logDirectory, "RiskeerMigrationLog.sqlite");
Assert.IsFalse(File.Exists(logPath));
}
-
- mocks.VerifyAll();
}
[Test]
@@ -733,9 +666,7 @@
$"{nameof(Migrate_UnsupportedSourceFileVersion_MigrationFailsAndLogsError)}";
string targetFilePath = Path.Combine(TestHelper.GetScratchPadPath(), testDirectory, targetFile);
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
var logDirectory = $"{nameof(Migrate_UnsupportedSourceFileVersion_MigrationFailsAndLogsError)}_log";
using (new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), logDirectory))
@@ -763,8 +694,6 @@
string logPath = Path.Combine(TestHelper.GetScratchPadPath(logDirectory), "RiskeerMigrationLog.sqlite");
Assert.IsFalse(File.Exists(logPath));
}
-
- mocks.VerifyAll();
}
[Test]
@@ -773,9 +702,7 @@
// Setup
string sourceFilePath = ProjectMigrationTestHelper.GetOutdatedSupportedProjectFilePath();
- var mocks = new MockRepository();
- var inquiryHelper = mocks.Stub();
- mocks.ReplayAll();
+ var inquiryHelper = Substitute.For();
var logDirectory = $"{nameof(Migrate_TargetFileSameAsSourceFile_MigrationFailsAndLogsError)}_log";
using (new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), logDirectory))
@@ -803,8 +730,6 @@
string logPath = Path.Combine(TestHelper.GetScratchPadPath(), logDirectory, "RiskeerMigrationLog.sqlite");
Assert.IsFalse(File.Exists(logPath));
}
-
- mocks.VerifyAll();
}
}
}
\ No newline at end of file
Index: Riskeer/Migration/test/Riskeer.Migration.Test/Riskeer.Migration.Test.csproj
===================================================================
diff -u -r5f408923a88c6207e2191d52faaebb856e0e2e7e -re401a63b704142abd9fe4050de03c6f661d2670b
--- Riskeer/Migration/test/Riskeer.Migration.Test/Riskeer.Migration.Test.csproj (.../Riskeer.Migration.Test.csproj) (revision 5f408923a88c6207e2191d52faaebb856e0e2e7e)
+++ Riskeer/Migration/test/Riskeer.Migration.Test/Riskeer.Migration.Test.csproj (.../Riskeer.Migration.Test.csproj) (revision e401a63b704142abd9fe4050de03c6f661d2670b)
@@ -25,8 +25,11 @@
3.8.1
-
- 3.6.1
+
+ 4.4.0
+
+ 1.0.16
+
\ No newline at end of file