Index: Migration/Console/src/Migration.Console/Properties/AssemblyInfo.cs =================================================================== diff -u -r111d72b3e14a3dddfaacddbae3f06ae214049f91 -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Console/src/Migration.Console/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 111d72b3e14a3dddfaacddbae3f06ae214049f91) +++ Migration/Console/src/Migration.Console/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("RingtoetsMigrationTool")] -[assembly: AssemblyProduct("RingtoetsMigrationTool")] +[assembly: AssemblyTitle("Migration.Console")] +[assembly: AssemblyProduct("Migration.Console")] [assembly: Guid("2e2c9b96-e72a-4c10-aa54-a5381fe30b0d")] [assembly: InternalsVisibleTo("Migration.Console.Test")] \ No newline at end of file Index: Migration/Scripts/src/Migration.Scripts.Data/Migration.Scripts.Data.csproj =================================================================== diff -u -r214922706cd2559757df5b96982bd99cf0fe9cfa -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Scripts/src/Migration.Scripts.Data/Migration.Scripts.Data.csproj (.../Migration.Scripts.Data.csproj) (revision 214922706cd2559757df5b96982bd99cf0fe9cfa) +++ Migration/Scripts/src/Migration.Scripts.Data/Migration.Scripts.Data.csproj (.../Migration.Scripts.Data.csproj) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -58,7 +58,6 @@ - Fisheye: Tag dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 refers to a dead (removed) revision in file `Migration/Scripts/src/Migration.Scripts.Data/VersionedFile.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Migration/Scripts/test/Migration.Scripts.Data.Test/Migration.Scripts.Data.Test.csproj =================================================================== diff -u -r5e9874d26ba517fd2271c5319aebbc879d7d27f3 -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Scripts/test/Migration.Scripts.Data.Test/Migration.Scripts.Data.Test.csproj (.../Migration.Scripts.Data.Test.csproj) (revision 5e9874d26ba517fd2271c5319aebbc879d7d27f3) +++ Migration/Scripts/test/Migration.Scripts.Data.Test/Migration.Scripts.Data.Test.csproj (.../Migration.Scripts.Data.Test.csproj) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -43,6 +43,10 @@ ..\..\..\..\packages\NUnit.3.6.0\lib\net40\nunit.framework.dll True + + ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll + True + @@ -63,8 +67,8 @@ + - Index: Migration/Scripts/test/Migration.Scripts.Data.Test/MigrationScriptTest.cs =================================================================== diff -u -r5e9874d26ba517fd2271c5319aebbc879d7d27f3 -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Scripts/test/Migration.Scripts.Data.Test/MigrationScriptTest.cs (.../MigrationScriptTest.cs) (revision 5e9874d26ba517fd2271c5319aebbc879d7d27f3) +++ Migration/Scripts/test/Migration.Scripts.Data.Test/MigrationScriptTest.cs (.../MigrationScriptTest.cs) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -23,6 +23,7 @@ using System.IO; using Core.Common.TestUtil; using NUnit.Framework; +using Rhino.Mocks; namespace Migration.Scripts.Data.Test { @@ -92,10 +93,14 @@ public void Upgrade_ValidParameters_ExpectedProperties() { // Setup + var mockRepository = new MockRepository(); + var versionedFile = mockRepository.Stub(); + versionedFile.Expect(vf => vf.Location).Return("c:\\file.ext"); + mockRepository.ReplayAll(); + var createScript = new TestCreateScript("2", ";"); var upgradeScript = new UpgradeScript("1", "2", ";"); var migrationScript = new MigrationScript(createScript, upgradeScript); - var versionedFile = new VersionedFile("c:\\file.ext"); // Call IVersionedFile upgradedFile = migrationScript.Upgrade(versionedFile); @@ -104,6 +109,7 @@ Assert.IsNotNull(upgradedFile); Assert.IsTrue(File.Exists(upgradedFile.Location)); using (new FileDisposeHelper(upgradedFile.Location)) {} + mockRepository.VerifyAll(); } } } \ No newline at end of file Index: Migration/Scripts/test/Migration.Scripts.Data.Test/TestCreateScript.cs =================================================================== diff -u -r5e9874d26ba517fd2271c5319aebbc879d7d27f3 -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Scripts/test/Migration.Scripts.Data.Test/TestCreateScript.cs (.../TestCreateScript.cs) (revision 5e9874d26ba517fd2271c5319aebbc879d7d27f3) +++ Migration/Scripts/test/Migration.Scripts.Data.Test/TestCreateScript.cs (.../TestCreateScript.cs) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -30,7 +30,7 @@ protected override IVersionedFile GetEmptyVersionedFile(string location) { using (File.Create(location)) {} - return new VersionedFile(location); + return new TestVersionedFile(location); } } } \ No newline at end of file Index: Migration/Scripts/test/Migration.Scripts.Data.Test/TestVersionedFile.cs =================================================================== diff -u --- Migration/Scripts/test/Migration.Scripts.Data.Test/TestVersionedFile.cs (revision 0) +++ Migration/Scripts/test/Migration.Scripts.Data.Test/TestVersionedFile.cs (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -0,0 +1,36 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Migration.Scripts.Data.Test +{ + public class TestVersionedFile : IVersionedFile + { + public TestVersionedFile(string location) + { + Location = location; + } + public string Location { get; } + public string GetVersion() + { + return string.Empty; + } + } +} \ No newline at end of file Index: Migration/Scripts/test/Migration.Scripts.Data.Test/UpgradeScriptTest.cs =================================================================== diff -u -r7b09e29a12bb9207e3ed23dba4771007f7d948d5 -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Scripts/test/Migration.Scripts.Data.Test/UpgradeScriptTest.cs (.../UpgradeScriptTest.cs) (revision 7b09e29a12bb9207e3ed23dba4771007f7d948d5) +++ Migration/Scripts/test/Migration.Scripts.Data.Test/UpgradeScriptTest.cs (.../UpgradeScriptTest.cs) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -24,6 +24,7 @@ using System.IO; using Core.Common.TestUtil; using NUnit.Framework; +using Rhino.Mocks; namespace Migration.Scripts.Data.Test { @@ -102,57 +103,62 @@ public void Upgrade_SourceNull_ThrowsArgumentNullException() { // Setup + var mockRepository = new MockRepository(); + var targetVersionedFile = mockRepository.Stub(); + mockRepository.ReplayAll(); + const string fromVersion = "fromVersion"; const string toVersion = "toVersion"; const string query = ";"; var upgradeScript = new UpgradeScript(fromVersion, toVersion, query); - string filename = Path.GetRandomFileName(); - string filePath = TestHelper.GetTestDataPath(TestDataPath.Migration.Core.Storage, filename); - - var targetVersionedFile = new VersionedFile(filePath); - // Call TestDelegate call = () => upgradeScript.Upgrade(null, targetVersionedFile); // Assert string paramName = Assert.Throws(call).ParamName; Assert.AreEqual("source", paramName); + mockRepository.VerifyAll(); } [Test] public void Upgrade_TargetNull_ThrowsArgumentNullException() { // Setup + var mockRepository = new MockRepository(); + var sourceVersionedFile = mockRepository.Stub(); + mockRepository.ReplayAll(); + const string fromVersion = "fromVersion"; const string toVersion = "toVersion"; const string query = ";"; var upgradeScript = new UpgradeScript(fromVersion, toVersion, query); - string filename = Path.GetRandomFileName(); - string filePath = TestHelper.GetTestDataPath(TestDataPath.Migration.Core.Storage, filename); - - var sourceVersionedFile = new VersionedFile(filePath); - // Call TestDelegate call = () => upgradeScript.Upgrade(sourceVersionedFile, null); // Assert string paramName = Assert.Throws(call).ParamName; Assert.AreEqual("target", paramName); + mockRepository.VerifyAll(); } [Test] public void Upgrade_UpgradeFails_ThrowsSQLiteException() { // Setup - var upgradeScript = new UpgradeScript("1", "2", "THIS WILL FAIL"); - var sourceVersionedFile = new VersionedFile("c:\\file.ext"); - string filename = Path.GetRandomFileName(); string filePath = TestHelper.GetTestDataPath(TestDataPath.Migration.Core.Storage, filename); - var targetVersionedFile = new VersionedFile(filePath); + var mockRepository = new MockRepository(); + var sourceVersionedFile = mockRepository.Stub(); + sourceVersionedFile.Expect(tvf => tvf.Location).Return("c:\\file.ext"); + var targetVersionedFile = mockRepository.Stub(); + targetVersionedFile.Expect(tvf => tvf.Location).Return(filePath); + mockRepository.ReplayAll(); + + var upgradeScript = new UpgradeScript("1", "2", "THIS WILL FAIL"); + // Call TestDelegate call = () => upgradeScript.Upgrade(sourceVersionedFile, targetVersionedFile); @@ -161,28 +167,35 @@ { Assert.Throws(call); } + mockRepository.VerifyAll(); } [Test] public void Upgrade_ValidParameters_ExpectedProperties() { // Setup - var upgradeScript = new UpgradeScript("1", "2", ";"); - var sourceVersionedFile = new VersionedFile("c:\\file.ext"); - string filename = Path.GetRandomFileName(); string filePath = TestHelper.GetTestDataPath(TestDataPath.Migration.Core.Storage, filename); - var targetVersionedFile = new VersionedFile(filePath); + var mockRepository = new MockRepository(); + var sourceVersionedFile = mockRepository.Stub(); + sourceVersionedFile.Expect(tvf => tvf.Location).Return("c:\\file.ext"); + var targetVersionedFile = mockRepository.Stub(); + targetVersionedFile.Expect(tvf => tvf.Location).Return(filePath); + mockRepository.ReplayAll(); + + var upgradeScript = new UpgradeScript("1", "2", ";"); + // Call upgradeScript.Upgrade(sourceVersionedFile, targetVersionedFile); // Assert Assert.IsNotNull(targetVersionedFile); - using (new FileDisposeHelper(targetVersionedFile.Location)) + using (new FileDisposeHelper(filePath)) { - Assert.IsTrue(File.Exists(targetVersionedFile.Location)); + Assert.IsTrue(File.Exists(filePath)); } + mockRepository.VerifyAll(); } } } \ No newline at end of file Fisheye: Tag dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 refers to a dead (removed) revision in file `Migration/Scripts/test/Migration.Scripts.Data.Test/VersionedFileTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Migration/Scripts/test/Migration.Scripts.Data.Test/packages.config =================================================================== diff -u -r1c5aaabcb2b207179927b307cf683fb41af7aac7 -rdcce1c8c694a59962a2c0cdf4c4f71cacbff0e74 --- Migration/Scripts/test/Migration.Scripts.Data.Test/packages.config (.../packages.config) (revision 1c5aaabcb2b207179927b307cf683fb41af7aac7) +++ Migration/Scripts/test/Migration.Scripts.Data.Test/packages.config (.../packages.config) (revision dcce1c8c694a59962a2c0cdf4c4f71cacbff0e74) @@ -23,5 +23,6 @@ --> + \ No newline at end of file