Index: src/Deltares.DSoilModel.Forms.Tests/DSoilModelGeometryEditorTests.cs
===================================================================
diff -u -r883 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/DSoilModelGeometryEditorTests.cs (.../DSoilModelGeometryEditorTests.cs) (revision 883)
+++ src/Deltares.DSoilModel.Forms.Tests/DSoilModelGeometryEditorTests.cs (.../DSoilModelGeometryEditorTests.cs) (revision 1080)
@@ -9,6 +9,7 @@
using Deltares.Standard.Forms.DExpress;
using Deltares.Standard.Language;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Forms.Tests
{
@@ -17,31 +18,55 @@
{
private DSoilModelGeometryEditor dsmGeometryEditor;
private MainForm mainForm;
+ private DSoilModelProject project;
private SpatialEditor spatialEditor;
private LanguageType oldLanguage;
- [SetUp]
+ [OneTimeSetUp]
public void SetUp()
{
oldLanguage = LocalizationManager.CurrentLanguage;
LocalizationManager.CurrentLanguage = LanguageType.Dutch;
+ // About.IgnoreAssemblyErrors = true;
+ // mainForm = new MainForm();
+ // project = new DSoilModelProject();
+ // dsmGeometryEditor = new DSoilModelGeometryEditor(mainForm)
+ // {
+ // Project = project
+ // };
+ // spatialEditor = dsmGeometryEditor.SpatialEditor;
+ }
+
+ [OneTimeTearDown]
+ public void TearDown()
+ {
+ LocalizationManager.CurrentLanguage = oldLanguage;
+ }
+
+ [SetUp]
+ public void SetUpPerTest()
+ {
About.IgnoreAssemblyErrors = true;
mainForm = new MainForm();
- var project = new DSoilModelProject();
+ project = new DSoilModelProject();
dsmGeometryEditor = new DSoilModelGeometryEditor(mainForm)
{
Project = project
};
spatialEditor = dsmGeometryEditor.SpatialEditor;
}
-
+
[TearDown]
- public void TearDown()
+ public void TearDownPerTest()
{
+ dsmGeometryEditor.Dispose();
dsmGeometryEditor = null;
- LocalizationManager.CurrentLanguage = oldLanguage;
+ project.Dispose();
+ project = null;
+ mainForm.Dispose();
+ mainForm = null;
}
-
+
private DSoilModelProject CreateProjectForSoilProfile2D(SoilProfile2D profile)
{
var p = new DSoilModelProject();
@@ -94,10 +119,10 @@
dsmGeometryEditor.ClearGeometryForSoilProfile1D(soilProfile1D);
- Assert.IsEmpty(dsmGeometryEditor.Project.BoringLookup1Ds);
- Assert.IsEmpty(dsmGeometryEditor.Project.CptLookup1Ds);
+ ClassicAssert.IsEmpty(dsmGeometryEditor.Project.BoringLookup1Ds);
+ ClassicAssert.IsEmpty(dsmGeometryEditor.Project.CptLookup1Ds);
- Assert.IsEmpty(soilProfile1D.Layers);
+ ClassicAssert.IsEmpty(soilProfile1D.Layers);
}
[Test]
@@ -108,23 +133,23 @@
dsmGeometryEditor.ClearGeometryForSoilProfile2D(soilProfile2D);
- Assert.IsEmpty(dsmGeometryEditor.Project.BoringLookup2Ds);
- Assert.IsEmpty(dsmGeometryEditor.Project.CptLookup2Ds);
- Assert.IsEmpty(dsmGeometryEditor.Project.SpecificMechanismPointLocations);
- Assert.IsEmpty(dsmGeometryEditor.Project.Soilprofile1DLookup2Ds);
+ ClassicAssert.IsEmpty(dsmGeometryEditor.Project.BoringLookup2Ds);
+ ClassicAssert.IsEmpty(dsmGeometryEditor.Project.CptLookup2Ds);
+ ClassicAssert.IsEmpty(dsmGeometryEditor.Project.SpecificMechanismPointLocations);
+ ClassicAssert.IsEmpty(dsmGeometryEditor.Project.Soilprofile1DLookup2Ds);
- Assert.IsNaN(soilProfile2D.CenterCrestLocation);
- Assert.IsEmpty(soilProfile2D.Geometry.Points);
- Assert.IsEmpty(soilProfile2D.PreconsolidationStresses);
- Assert.IsEmpty(soilProfile2D.Surfaces);
+ ClassicAssert.IsNaN(soilProfile2D.CenterCrestLocation);
+ ClassicAssert.IsEmpty(soilProfile2D.Geometry.Points);
+ ClassicAssert.IsEmpty(soilProfile2D.PreconsolidationStresses);
+ ClassicAssert.IsEmpty(soilProfile2D.Surfaces);
}
[TestCase(null)]
[TestCase("")]
[TestCase("Name")]
public void IsEnabledTest_AlwaysTrue(string propertyName)
{
- Assert.IsTrue(dsmGeometryEditor.IsEnabled(propertyName)); // always true
+ ClassicAssert.IsTrue(dsmGeometryEditor.IsEnabled(propertyName)); // always true
}
[TestCase(null, true)]
@@ -145,7 +170,7 @@
[TestCase("ExecuteClearSoilProfile2DCommand", false)]
public void IsVisibleTestWithNoData(string propertyName, bool expected)
{
- Assert.AreEqual(expected, dsmGeometryEditor.IsVisible(propertyName));
+ ClassicAssert.AreEqual(expected, dsmGeometryEditor.IsVisible(propertyName));
}
[Test]
@@ -154,7 +179,7 @@
dsmGeometryEditor.CreatePolyline = true;
var res = dsmGeometryEditor.CreatePolyline;
// expected = false as no curves are actually added.
- Assert.AreEqual(false, res);
+ ClassicAssert.AreEqual(false, res);
}
[Test]
@@ -163,18 +188,18 @@
dsmGeometryEditor.CreatePolyline = true;
var res = dsmGeometryEditor.CreatePointInLine;
// expected = false as no point is actually added.
- Assert.AreEqual(false, res);
+ ClassicAssert.AreEqual(false, res);
}
[Test]
public void TestAllowEdit()
{
dsmGeometryEditor.AllowEdit = true;
var res = dsmGeometryEditor.AllowEdit;
- Assert.AreEqual(true, res);
+ ClassicAssert.AreEqual(true, res);
dsmGeometryEditor.AllowEdit = false;
res = dsmGeometryEditor.AllowEdit;
- Assert.AreEqual(false, res);
+ ClassicAssert.AreEqual(false, res);
}
[Test]
@@ -184,14 +209,14 @@
mainForm.GeometryDockPanel.Text = emptyCaption;
dsmGeometryEditor.ShowSoilSegment(null, null);
// caption must remain as is
- Assert.AreEqual(emptyCaption, mainForm.GeometryDockPanel.Text);
+ ClassicAssert.AreEqual(emptyCaption, mainForm.GeometryDockPanel.Text);
var segment = new SoilSegment();
const string emptySegment = "Empty segment";
segment.Name = emptySegment;
dsmGeometryEditor.ShowSoilSegment(segment, null);
// caption must be Segment + name only
- Assert.AreEqual("Ondergrondsegment " + emptySegment, mainForm.GeometryDockPanel.Text);
+ ClassicAssert.AreEqual("Ondergrondsegment " + emptySegment, mainForm.GeometryDockPanel.Text);
}
[Test]
@@ -214,7 +239,7 @@
dsmGeometryEditor.ShowSoilSegment(segment, stochProf);
// caption must name1D
string caption = mainForm.GeometryDockPanel.Text;
- Assert.IsTrue(caption.Contains(name1D));
+ ClassicAssert.IsTrue(caption.Contains(name1D));
// Test for 2D profile
const string name2D = "Empty 2D";
@@ -223,23 +248,23 @@
dsmGeometryEditor.ShowSoilSegment(segment, stochProf);
// caption must contain name2D
caption = mainForm.GeometryDockPanel.Text;
- Assert.IsTrue(caption.Contains(name2D));
+ ClassicAssert.IsTrue(caption.Contains(name2D));
}
[Test]
public void TestInsertSpecificMechanismPointLocation()
{
// First without data
dsmGeometryEditor.InsertSpecificMechanismPointLocation();
- Assert.AreEqual(0, dsmGeometryEditor.Project.SpecificMechanismPointLocations.Count);
+ ClassicAssert.AreEqual(0, dsmGeometryEditor.Project.SpecificMechanismPointLocations.Count);
var soilProfile = CreateSoilProfile2D();
dsmGeometryEditor.Project = CreateProjectForSoilProfile2D(soilProfile);
dsmGeometryEditor.Project.SpecificMechanismPointLocations.Clear();
spatialEditor.EmptySelection = new EmptyShape(soilProfile);
// expected = 1 new location
dsmGeometryEditor.InsertSpecificMechanismPointLocation();
- Assert.AreEqual(1, dsmGeometryEditor.Project.SpecificMechanismPointLocations.Count);
+ ClassicAssert.AreEqual(1, dsmGeometryEditor.Project.SpecificMechanismPointLocations.Count);
}
[Test]
@@ -249,12 +274,12 @@
dsmGeometryEditor.AddCenterCrestLocationTo2DProfile();
var soilProfile = CreateSoilProfile2D();
dsmGeometryEditor.Project = CreateProjectForSoilProfile2D(soilProfile);
- Assert.AreEqual(0, dsmGeometryEditor.Project.SoilProfiles2D[0].CenterCrestLocation);
+ ClassicAssert.AreEqual(0, dsmGeometryEditor.Project.SoilProfiles2D[0].CenterCrestLocation);
spatialEditor.EmptySelection = new EmptyShape(soilProfile);
// expected Centercrest at center
dsmGeometryEditor.AddCenterCrestLocationTo2DProfile();
- Assert.AreEqual((soilProfile.Geometry.Right - soilProfile.Geometry.Left) * 0.5,
+ ClassicAssert.AreEqual((soilProfile.Geometry.Right - soilProfile.Geometry.Left) * 0.5,
dsmGeometryEditor.Project.SoilProfiles2D[0].CenterCrestLocation);
}
}
Index: src/Deltares.DSoilModel.Forms.Tests/DSoilModelPluginTests.cs
===================================================================
diff -u -r879 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/DSoilModelPluginTests.cs (.../DSoilModelPluginTests.cs) (revision 879)
+++ src/Deltares.DSoilModel.Forms.Tests/DSoilModelPluginTests.cs (.../DSoilModelPluginTests.cs) (revision 1080)
@@ -16,17 +16,18 @@
using Deltares.Standard.Forms.Maps;
using Deltares.Standard.TestUtils;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Forms.Tests
{
[TestFixture]
- [RequiresSTA]
+ [Apartment(ApartmentState.STA)]
internal class DSoilModelPluginTests
{
private MainForm mainForm;
private DSoilModelPlugin plugin;
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void SetUp()
{
BindSupport.ClearCaches();
@@ -49,7 +50,7 @@
}
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TearDown()
{
// Don't call form.Close() because it will raise SaveAs dialog
@@ -74,7 +75,7 @@
plugin.Assign(project);
});
// segments, cpts and borings are added (without the labels)
- Assert.AreEqual(3, plugin.MapEditor.MapEditor.MapControl.Layers.Count);
+ ClassicAssert.AreEqual(3, plugin.MapEditor.MapEditor.MapControl.Layers.Count);
}
[Test]
@@ -110,8 +111,8 @@
p.SoilSegments.Add(segment2);
p.SoilSegments.Add(segment3);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteBoring", boringUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteBoring", boringUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteBoring", boringUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteBoring", boringUsed));
}
[Test]
@@ -133,8 +134,8 @@
p.BoringLookup1Ds.Add(lookup1);
p.BoringLookup1Ds.Add(lookup2);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteBoring", boringUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteBoring", boringUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteBoring", boringUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteBoring", boringUsed));
}
[Test]
@@ -156,8 +157,8 @@
p.BoringLookup2Ds.Add(lookup1);
p.BoringLookup2Ds.Add(lookup2);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteBoring", boringUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteBoring", boringUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteBoring", boringUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteBoring", boringUsed));
}
[Test]
@@ -193,8 +194,8 @@
p.SoilSegments.Add(segment2);
p.SoilSegments.Add(segment3);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteCPT", cptUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteCPT", cptUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteCPT", cptUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteCPT", cptUsed));
}
[Test]
@@ -216,8 +217,8 @@
p.CptLookup1Ds.Add(lookup1);
p.CptLookup1Ds.Add(lookup2);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteCPT", cptUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteCPT", cptUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteCPT", cptUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteCPT", cptUsed));
}
[Test]
@@ -239,8 +240,8 @@
p.CptLookup2Ds.Add(lookup1);
p.CptLookup2Ds.Add(lookup2);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteCPT", cptUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteCPT", cptUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteCPT", cptUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteCPT", cptUsed));
}
[Test]
@@ -288,11 +289,11 @@
p.SoilSegments.Add(segment2);
p.SoilSegments.Add(segment3);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteSoilProfile", sp1dUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteSoilProfile", sp1dUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteSoilProfile", sp1dUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteSoilProfile", sp1dUsed));
- Assert.IsTrue(CanDelete(plugin, "CanDeleteSoilProfile", sp2dUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteSoilProfile", sp2dUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteSoilProfile", sp2dUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteSoilProfile", sp2dUsed));
}
[Test]
@@ -314,8 +315,8 @@
p.SoilSegments.Add(seg1);
p.SoilSegments.Add(seg2);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
}
[Test]
@@ -334,8 +335,8 @@
p.SoilProfiles1D.Add(sp1);
p.SoilProfiles1D.Add(sp2);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
}
[Test]
@@ -361,19 +362,19 @@
};
p.SoilProfiles2D.Add(sp);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
}
- [Test]
+ [Test, Ignore("Not relevant for now")]
[Category(Categories.WorkInProgress)]
public void CanDeleteSoilTest_Borings()
{
var p = new DSoilModelProject();
plugin.Project = p;
var fileName = Path.Combine(GetTestFilesPath(), "boring.xml");
// var fileName = Path.Combine(GetTestFilesPath(), "boring.gef");
- Assert.IsTrue(File.Exists(fileName));
+ ClassicAssert.IsTrue(File.Exists(fileName));
// p.ReadGefBoringFromFile(fileName);
var b = new Boring(File.ReadAllText(fileName), p.Soils);
@@ -389,30 +390,30 @@
var soilUnused = new Soil();
p.Soils.Add(soilUnused);
- Assert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
- Assert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
+ ClassicAssert.IsTrue(CanDelete(plugin, "CanDeleteSoil", soilUnused));
+ ClassicAssert.IsFalse(CanDelete(plugin, "CanDeleteSoil", soilUsed));
}
[Test]
public void HandleIsCreated()
{
- Assert.IsTrue(mainForm.IsHandleCreated);
+ ClassicAssert.IsTrue(mainForm.IsHandleCreated);
}
[Test]
public void TestSettingNewProject()
{
- Assert.IsNotNull(NewProject(plugin));
+ ClassicAssert.IsNotNull(NewProject(plugin));
}
[Test]
public void ValidateForEmptyProjectIsOk()
{
NewProject(plugin);
var results = RealTimeBackgroundValidator.ValidationResults;
- Assert.IsNotNull(results);
+ ClassicAssert.IsNotNull(results);
// empty project produces 0 errors if validated
- Assert.AreEqual(0, results.ToList().Count);
+ ClassicAssert.AreEqual(0, results.ToList().Count);
}
[Test]
@@ -421,26 +422,26 @@
// first segment of project.soil holds a 2d profile with all layers having no soils and 1 boring with 3 different soils
var orgProject = DSoilModelIO.OpenSoilDatabase(Path.Combine(GetTestFilesPath(), "Project.soil"));
plugin.Assign(orgProject);
- Assert.AreEqual(577, plugin.Project.Soils.Soils.Count);
- Assert.AreEqual(0, plugin.Project.SoilProfiles1D.Count);
- Assert.AreEqual(0, plugin.Project.CPTs.Count);
- Assert.AreEqual(26, plugin.Project.Borings.Count);
- Assert.AreEqual(0, plugin.Project.SurfaceLines.Count);
- Assert.AreEqual(36, plugin.Project.SoilProfiles2D.Count);
- Assert.AreEqual(27, plugin.Project.SoilSegments.Count);
+ ClassicAssert.AreEqual(577, plugin.Project.Soils.Soils.Count);
+ ClassicAssert.AreEqual(0, plugin.Project.SoilProfiles1D.Count);
+ ClassicAssert.AreEqual(0, plugin.Project.CPTs.Count);
+ ClassicAssert.AreEqual(26, plugin.Project.Borings.Count);
+ ClassicAssert.AreEqual(0, plugin.Project.SurfaceLines.Count);
+ ClassicAssert.AreEqual(36, plugin.Project.SoilProfiles2D.Count);
+ ClassicAssert.AreEqual(27, plugin.Project.SoilSegments.Count);
// make sure first segment is selected object
DataEventPublisher.SelectionChanged(plugin.Project.SoilSegments[0]);
// save the selected data to the new project
var savedProject = plugin.PrepareSaveAsProject();
// check saved dat for proper amount of data
- Assert.AreEqual(3, savedProject.Soils.Soils.Count);
- Assert.AreEqual(0, savedProject.SoilProfiles1D.Count);
- Assert.AreEqual(0, savedProject.CPTs.Count);
- Assert.AreEqual(1, savedProject.Borings.Count);
- Assert.AreEqual(0, savedProject.SurfaceLines.Count);
- Assert.AreEqual(1, savedProject.SoilProfiles2D.Count);
- Assert.AreEqual(1, savedProject.SoilSegments.Count);
+ ClassicAssert.AreEqual(3, savedProject.Soils.Soils.Count);
+ ClassicAssert.AreEqual(0, savedProject.SoilProfiles1D.Count);
+ ClassicAssert.AreEqual(0, savedProject.CPTs.Count);
+ ClassicAssert.AreEqual(1, savedProject.Borings.Count);
+ ClassicAssert.AreEqual(0, savedProject.SurfaceLines.Count);
+ ClassicAssert.AreEqual(1, savedProject.SoilProfiles2D.Count);
+ ClassicAssert.AreEqual(1, savedProject.SoilSegments.Count);
}
private DSoilModelProject NewProject(DSoilModelPlugin p)
Index: src/Deltares.DSoilModel.Forms.Tests/packages.config
===================================================================
diff -u -r239 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/packages.config (.../packages.config) (revision 239)
+++ src/Deltares.DSoilModel.Forms.Tests/packages.config (.../packages.config) (revision 1080)
@@ -1,4 +1,6 @@
-
+
+
+
\ No newline at end of file
Index: src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj
===================================================================
diff -u -r1034 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj (.../Deltares.DSoilModel.Forms.Tests.csproj) (revision 1034)
+++ src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj (.../Deltares.DSoilModel.Forms.Tests.csproj) (revision 1080)
@@ -1,5 +1,6 @@
+
Debug
@@ -125,13 +126,22 @@
False
..\..\lib\DotSpatial\DotSpatial.Symbology.dll
-
- ..\packages\NUnit.2.6.2\lib\nunit.framework.dll
- True
+
+
+ ..\packages\NUnit.4.1.0\lib\net462\nunit.framework.dll
+
+ ..\packages\NUnit.4.1.0\lib\net462\nunit.framework.legacy.dll
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
@@ -180,6 +190,12 @@
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.
+
+
+
-
+
+
+
\ No newline at end of file
Index: src/Deltares.DSoilModel.Forms.Tests/SpecificMechanismPointLocationControlTests.cs
===================================================================
diff -u -r883 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/SpecificMechanismPointLocationControlTests.cs (.../SpecificMechanismPointLocationControlTests.cs) (revision 883)
+++ src/Deltares.DSoilModel.Forms.Tests/SpecificMechanismPointLocationControlTests.cs (.../SpecificMechanismPointLocationControlTests.cs) (revision 1080)
@@ -1,12 +1,14 @@
-using Deltares.Geotechnics.IO;
+using System.Threading;
+using Deltares.Geotechnics.IO;
using Deltares.Geotechnics.Mechanisms;
using Deltares.Geotechnics.Soils;
using Deltares.Standard.Forms;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Forms.Tests
{
- [TestFixture, RequiresSTA]
+ [TestFixture, Apartment(ApartmentState.STA)]
class SpecificMechanismPointLocationControlTests : ControlTester
{
protected override IPropertyControl CreatePropertyControl()
@@ -39,16 +41,16 @@
public void TestSelectedObject()
{
var smpl = new SpecificMechanismPointLocation();
- Assert.AreNotSame(smpl, PropertyControl.SelectedObject);
+ ClassicAssert.AreNotSame(smpl, PropertyControl.SelectedObject);
PropertyControl.SelectedObject = smpl;
- Assert.AreSame(smpl, PropertyControl.SelectedObject);
+ ClassicAssert.AreSame(smpl, PropertyControl.SelectedObject);
}
[Test]
public void TestIsVisible()
{
- Assert.IsTrue(PropertyControl.IsVisible);
+ ClassicAssert.IsTrue(PropertyControl.IsVisible);
}
}
}
Index: src/Deltares.DSoilModel.Data.Tests/SosSoilProfilesImporterTests.cs
===================================================================
diff -u -r883 -r1080
--- src/Deltares.DSoilModel.Data.Tests/SosSoilProfilesImporterTests.cs (.../SosSoilProfilesImporterTests.cs) (revision 883)
+++ src/Deltares.DSoilModel.Data.Tests/SosSoilProfilesImporterTests.cs (.../SosSoilProfilesImporterTests.cs) (revision 1080)
@@ -24,6 +24,7 @@
using Deltares.Geotechnics.Soils;
using Deltares.Standard.Logging;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Data.Tests
{
@@ -46,17 +47,17 @@
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(10, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
- Assert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
- Assert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
- Assert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
- Assert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
- Assert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(10, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
+ ClassicAssert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
+ ClassicAssert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
+ ClassicAssert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
+ ClassicAssert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
+ ClassicAssert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
}
}
@@ -73,15 +74,15 @@
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(1, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
- Assert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
- Assert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
- Assert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
- Assert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(1, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
+ ClassicAssert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
+ ClassicAssert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
+ ClassicAssert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
+ ClassicAssert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
// Log contains 9 profile errors, 47 layer errors and 13 soil errors.
- Assert.AreEqual(69, LogManager.Messages.Count);
+ ClassicAssert.AreEqual(69, LogManager.Messages.Count);
}
}
@@ -98,31 +99,31 @@
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(3, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
- Assert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
- Assert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
- Assert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
- Assert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
- Assert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[0].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[0].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[1].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[2].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[4].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[5].Soil.SoilType);
+ ClassicAssert.AreEqual(3, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
+ ClassicAssert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
+ ClassicAssert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
+ ClassicAssert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
+ ClassicAssert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
+ ClassicAssert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[0].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[0].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[1].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[2].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[4].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[5].Soil.SoilType);
}
}
@@ -139,46 +140,43 @@
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(3, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
- Assert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
- Assert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
- Assert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
- Assert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
- Assert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[0].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[0].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[1].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[2].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[4].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[5].Soil.SoilType);
+ ClassicAssert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
+ ClassicAssert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
+ ClassicAssert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[0].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[0].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[1].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[1].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[2].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[4].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[5].Soil.SoilType);
- Assert.AreEqual(Color.Bisque, project.SoilProfiles1D[0].Layers[0].Soil.Color);
- Assert.AreEqual(Color.CadetBlue, project.SoilProfiles1D[0].Layers[1].Soil.Color);
- Assert.AreEqual(Color.Chocolate, project.SoilProfiles1D[0].Layers[2].Soil.Color);
- Assert.AreEqual(Color.Maroon, project.SoilProfiles1D[0].Layers[3].Soil.Color);
- Assert.AreEqual(Color.Linen, project.SoilProfiles1D[1].Layers[0].Soil.Color);
- Assert.AreEqual(Color.Orchid, project.SoilProfiles1D[1].Layers[1].Soil.Color);
- Assert.AreEqual(Color.Yellow, project.SoilProfiles1D[1].Layers[2].Soil.Color);
- Assert.AreEqual(Color.Red, project.SoilProfiles1D[1].Layers[3].Soil.Color);
- Assert.AreEqual(Color.Blue, project.SoilProfiles1D[2].Layers[0].Soil.Color);
- Assert.AreEqual(Color.Azure, project.SoilProfiles1D[2].Layers[1].Soil.Color);
- Assert.AreEqual(Color.Beige, project.SoilProfiles1D[2].Layers[2].Soil.Color);
- Assert.AreEqual(Color.Coral, project.SoilProfiles1D[2].Layers[3].Soil.Color);
- Assert.AreEqual(Color.Cyan, project.SoilProfiles1D[2].Layers[4].Soil.Color);
- Assert.AreEqual(Color.Red, project.SoilProfiles1D[2].Layers[5].Soil.Color);
+ ClassicAssert.AreEqual(Color.Bisque, project.SoilProfiles1D[0].Layers[0].Soil.Color);
+ ClassicAssert.AreEqual(Color.CadetBlue, project.SoilProfiles1D[0].Layers[1].Soil.Color);
+ ClassicAssert.AreEqual(Color.Chocolate, project.SoilProfiles1D[0].Layers[2].Soil.Color);
+ ClassicAssert.AreEqual(Color.Maroon, project.SoilProfiles1D[0].Layers[3].Soil.Color);
+ ClassicAssert.AreEqual(Color.Linen, project.SoilProfiles1D[1].Layers[0].Soil.Color);
+ ClassicAssert.AreEqual(Color.Orchid, project.SoilProfiles1D[1].Layers[1].Soil.Color);
+ ClassicAssert.AreEqual(Color.Yellow, project.SoilProfiles1D[1].Layers[2].Soil.Color);
+ ClassicAssert.AreEqual(Color.Red, project.SoilProfiles1D[1].Layers[3].Soil.Color);
+ ClassicAssert.AreEqual(Color.Blue, project.SoilProfiles1D[2].Layers[0].Soil.Color);
+ ClassicAssert.AreEqual(Color.Azure, project.SoilProfiles1D[2].Layers[1].Soil.Color);
+ ClassicAssert.AreEqual(Color.Beige, project.SoilProfiles1D[2].Layers[2].Soil.Color);
+ ClassicAssert.AreEqual(Color.Coral, project.SoilProfiles1D[2].Layers[3].Soil.Color);
+ ClassicAssert.AreEqual(Color.Cyan, project.SoilProfiles1D[2].Layers[4].Soil.Color);
+ ClassicAssert.AreEqual(Color.Red, project.SoilProfiles1D[2].Layers[5].Soil.Color);
}
}
@@ -195,55 +193,55 @@
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(3, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
- Assert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
- Assert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
- Assert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
- Assert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
- Assert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
- Assert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
- Assert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(3, project.SoilProfiles1D.Count, "The number of profiles read from the csv file is not right.");
+ ClassicAssert.AreEqual("Segment_11_1D1", project.SoilProfiles1D[0].Name);
+ ClassicAssert.AreEqual(4, project.SoilProfiles1D[0].LayerCount, "The number of layers in the first profile read from csv file is not right.");
+ ClassicAssert.AreEqual(1, project.SoilProfiles1D[0].Layers[0].TopLevel);
+ ClassicAssert.AreEqual(2.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-0.5, (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("", (project.SoilProfiles1D[0].Layers[0] as SosSoilLayer1D).RemarkTopLevel);
+ ClassicAssert.AreEqual(-9.5, project.SoilProfiles1D[0].Layers[2].TopLevel);
+ ClassicAssert.AreEqual(13.25, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MaximumTopLevel);
+ ClassicAssert.AreEqual(-9.5, (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).MinimumTopLevel);
+ ClassicAssert.AreEqual("Aan basis max. 25 cm basisveen", (project.SoilProfiles1D[0].Layers[2] as SosSoilLayer1D).RemarkTopLevel);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[0].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[0].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[0].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[0].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[0].Layers[3].Soil.SoilType);
//Double so equal to 0, 0
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[0].Soil.SoilType);
//Double so equal to 0, 1
- Assert.AreEqual(SoilType.Clay, project.SoilProfiles1D[1].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Clay, project.SoilProfiles1D[1].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[1].Layers[2].Soil.SoilType);
//Double so equal to 0, 4
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[1].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[0].Soil.SoilType);
- Assert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[1].Soil.SoilType);
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[2].Soil.SoilType);
- Assert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[2].Layers[3].Soil.SoilType);
- Assert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[4].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[1].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[0].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Sand, project.SoilProfiles1D[2].Layers[1].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[2].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Gravel, project.SoilProfiles1D[2].Layers[3].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Loam, project.SoilProfiles1D[2].Layers[4].Soil.SoilType);
//Double so equal to 0, 4
- Assert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[5].Soil.SoilType);
+ ClassicAssert.AreEqual(SoilType.Peat, project.SoilProfiles1D[2].Layers[5].Soil.SoilType);
- Assert.AreEqual(Color.Bisque, project.SoilProfiles1D[0].Layers[0].Soil.Color);
- Assert.AreEqual(Color.CadetBlue, project.SoilProfiles1D[0].Layers[1].Soil.Color);
- Assert.AreEqual(Color.Chocolate, project.SoilProfiles1D[0].Layers[2].Soil.Color);
- Assert.AreEqual(Color.Maroon, project.SoilProfiles1D[0].Layers[3].Soil.Color);
+ ClassicAssert.AreEqual(Color.Bisque, project.SoilProfiles1D[0].Layers[0].Soil.Color);
+ ClassicAssert.AreEqual(Color.CadetBlue, project.SoilProfiles1D[0].Layers[1].Soil.Color);
+ ClassicAssert.AreEqual(Color.Chocolate, project.SoilProfiles1D[0].Layers[2].Soil.Color);
+ ClassicAssert.AreEqual(Color.Maroon, project.SoilProfiles1D[0].Layers[3].Soil.Color);
//Double so equal to 0, 0
- Assert.AreEqual(Color.Bisque, project.SoilProfiles1D[1].Layers[0].Soil.Color);
+ ClassicAssert.AreEqual(Color.Bisque, project.SoilProfiles1D[1].Layers[0].Soil.Color);
//Double so equal to 0, 1
- Assert.AreEqual(Color.CadetBlue, project.SoilProfiles1D[1].Layers[1].Soil.Color);
- Assert.AreEqual(Color.Yellow, project.SoilProfiles1D[1].Layers[2].Soil.Color);
+ ClassicAssert.AreEqual(Color.CadetBlue, project.SoilProfiles1D[1].Layers[1].Soil.Color);
+ ClassicAssert.AreEqual(Color.Yellow, project.SoilProfiles1D[1].Layers[2].Soil.Color);
//Double so equal to 0, 4
- Assert.AreEqual(Color.Maroon, project.SoilProfiles1D[1].Layers[3].Soil.Color);
- Assert.AreEqual(Color.Blue, project.SoilProfiles1D[2].Layers[0].Soil.Color);
- Assert.AreEqual(Color.Azure, project.SoilProfiles1D[2].Layers[1].Soil.Color);
- Assert.AreEqual(Color.Beige, project.SoilProfiles1D[2].Layers[2].Soil.Color);
- Assert.AreEqual(Color.Coral, project.SoilProfiles1D[2].Layers[3].Soil.Color);
- Assert.AreEqual(Color.Cyan, project.SoilProfiles1D[2].Layers[4].Soil.Color);
+ ClassicAssert.AreEqual(Color.Maroon, project.SoilProfiles1D[1].Layers[3].Soil.Color);
+ ClassicAssert.AreEqual(Color.Blue, project.SoilProfiles1D[2].Layers[0].Soil.Color);
+ ClassicAssert.AreEqual(Color.Azure, project.SoilProfiles1D[2].Layers[1].Soil.Color);
+ ClassicAssert.AreEqual(Color.Beige, project.SoilProfiles1D[2].Layers[2].Soil.Color);
+ ClassicAssert.AreEqual(Color.Coral, project.SoilProfiles1D[2].Layers[3].Soil.Color);
+ ClassicAssert.AreEqual(Color.Cyan, project.SoilProfiles1D[2].Layers[4].Soil.Color);
//Double so equal to 0, 4
- Assert.AreEqual(Color.Maroon, project.SoilProfiles1D[2].Layers[5].Soil.Color);
+ ClassicAssert.AreEqual(Color.Maroon, project.SoilProfiles1D[2].Layers[5].Soil.Color);
}
}
@@ -259,8 +257,8 @@
using (var project = new DSoilModelProject())
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(5,LogManager.Messages.Count, "Expected five messages");
- Assert.AreNotEqual(0,project.SoilProfiles1D.Count, "Expected the profiles were read anyway");
+ ClassicAssert.AreEqual(5,LogManager.Messages.Count, "Expected five messages");
+ ClassicAssert.AreNotEqual(0,project.SoilProfiles1D.Count, "Expected the profiles were read anyway");
}
}
@@ -276,8 +274,8 @@
using (var project = new DSoilModelProject())
{
project.ReadSoilProfiles1DFromFile(csvFullFileName);
- Assert.AreEqual(2, LogManager.Messages.Count, "Expected two messages");
- Assert.AreEqual(0, project.SoilProfiles1D.Count, "Expected the profiles were not read");
+ ClassicAssert.AreEqual(2, LogManager.Messages.Count, "Expected two messages");
+ ClassicAssert.AreEqual(0, project.SoilProfiles1D.Count, "Expected the profiles were not read");
}
}
Index: src/Deltares.DSoilModel.Forms.Tests/CptControlTests.cs
===================================================================
diff -u -r883 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/CptControlTests.cs (.../CptControlTests.cs) (revision 883)
+++ src/Deltares.DSoilModel.Forms.Tests/CptControlTests.cs (.../CptControlTests.cs) (revision 1080)
@@ -1,11 +1,13 @@
-using Deltares.Geotechnics.ConePenetrationTest;
+using System.Threading;
+using Deltares.Geotechnics.ConePenetrationTest;
using Deltares.Geotechnics.Xsd;
using Deltares.Standard.Forms;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Forms.Tests
{
- [TestFixture, RequiresSTA]
+ [TestFixture, Apartment(ApartmentState.STA)]
class CptControlTests : ControlTester
{
protected override IPropertyControl CreatePropertyControl()
@@ -51,16 +53,16 @@
public void TestSelectedObject()
{
var cpt = new ConePenetrationTestData();
- Assert.AreNotSame(cpt, PropertyControl.SelectedObject);
+ ClassicAssert.AreNotSame(cpt, PropertyControl.SelectedObject);
PropertyControl.SelectedObject = cpt;
- Assert.AreSame(cpt, PropertyControl.SelectedObject);
+ ClassicAssert.AreSame(cpt, PropertyControl.SelectedObject);
}
[Test]
public void TestIsVisible()
{
- Assert.IsTrue(PropertyControl.IsVisible);
+ ClassicAssert.IsTrue(PropertyControl.IsVisible);
}
}
}
Index: src/Deltares.DSoilModel.Forms.Tests/SoilProfile1DLookup2DControlTest.cs
===================================================================
diff -u -r883 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/SoilProfile1DLookup2DControlTest.cs (.../SoilProfile1DLookup2DControlTest.cs) (revision 883)
+++ src/Deltares.DSoilModel.Forms.Tests/SoilProfile1DLookup2DControlTest.cs (.../SoilProfile1DLookup2DControlTest.cs) (revision 1080)
@@ -1,10 +1,12 @@
-using Deltares.Geotechnics.Soils;
+using System.Threading;
+using Deltares.Geotechnics.Soils;
using Deltares.Standard.Forms;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Forms.Tests
{
- [TestFixture, RequiresSTA]
+ [TestFixture, Apartment(ApartmentState.STA)]
public class SoilProfile1DLookup2DControlTest : ControlTester
{
protected override IPropertyControl CreatePropertyControl()
@@ -25,7 +27,7 @@
};
PropertyControl.SelectedObject = lookup;
- Assert.AreSame(lookup, PropertyControl.SelectedObject);
+ ClassicAssert.AreSame(lookup, PropertyControl.SelectedObject);
TestSpinEditVisibleEnabledValue(PropertyControl, "XEdit", true, true, lookup, x => x.Xlocal, 1.0);
TestLabelControlVisibleValue(PropertyControl, "XLabel", true, "Lokale x [-]");
@@ -37,17 +39,17 @@
{
var lookup = new SoilProfile1DLookup2D() { SoilProfile1D = new SoilProfile1D() };
PropertyControl.SelectedObject = lookup;
- Assert.AreSame(lookup, PropertyControl.SelectedObject);
+ ClassicAssert.AreSame(lookup, PropertyControl.SelectedObject);
var subcontrol = GetPrivateField(PropertyControl, "sosSoilProfile1DControl1");
- Assert.NotNull(subcontrol);
- Assert.AreSame(lookup.SoilProfile1D, subcontrol.SelectedObject);
+ ClassicAssert.NotNull(subcontrol);
+ ClassicAssert.AreSame(lookup.SoilProfile1D, subcontrol.SelectedObject);
}
[Test]
public void TestIsVisible()
{
- Assert.IsTrue(PropertyControl.IsVisible);
+ ClassicAssert.IsTrue(PropertyControl.IsVisible);
}
}
}
Index: src/Deltares.DSoilModel.Data.Tests/DSoilModelDataSourceRedirectorTests.cs
===================================================================
diff -u -r883 -r1080
--- src/Deltares.DSoilModel.Data.Tests/DSoilModelDataSourceRedirectorTests.cs (.../DSoilModelDataSourceRedirectorTests.cs) (revision 883)
+++ src/Deltares.DSoilModel.Data.Tests/DSoilModelDataSourceRedirectorTests.cs (.../DSoilModelDataSourceRedirectorTests.cs) (revision 1080)
@@ -27,6 +27,7 @@
using Deltares.Standard;
using Deltares.Standard.Reflection;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Data.Tests
{
@@ -48,7 +49,7 @@
public void StochastPropertiesTest(string propertyName)
{
var pi = PropertyInfoSupport.GetPropertyInfo(typeof (Stochast), propertyName);
- Assert.Contains(pi, DSoilModelDataSourceRedirector.StochastProperties);
+ ClassicAssert.Contains(pi, DSoilModelDataSourceRedirector.StochastProperties);
}
[TestCase("CohesionStochast")]
@@ -71,10 +72,10 @@
var dataSources = redirector.GetRedirectedDataSources(source, propertyName).ToList();
// As there are no datasources in the manager, source and property must not be redirected
- Assert.IsNotNull(dataSources);
- Assert.AreEqual(1, dataSources.Count);
- Assert.AreEqual(source, dataSources[0].Source);
- Assert.AreEqual(propertyName, dataSources[0].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual(1, dataSources.Count);
+ ClassicAssert.AreEqual(source, dataSources[0].Source);
+ ClassicAssert.AreEqual(propertyName, dataSources[0].Property);
// Add redirection info
var listdsi = new List();
@@ -89,28 +90,28 @@
dataSources = redirector.GetRedirectedDataSources(source, propertyName).ToList();
// source/property must now be found and return the subproperties of the stochast
- Assert.IsNotNull(dataSources);
- Assert.AreEqual(7, dataSources.Count);
- Assert.AreEqual("DistributionType", dataSources[0].Property);
- Assert.AreEqual("Mean", dataSources[1].Property);
- Assert.AreEqual("Deviation", dataSources[2].Property);
- Assert.AreEqual("Variation", dataSources[3].Property);
- Assert.AreEqual("DeviationType", dataSources[4].Property);
- Assert.AreEqual("Shift", dataSources[5].Property);
- Assert.AreEqual(propertyName, dataSources[6].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual(7, dataSources.Count);
+ ClassicAssert.AreEqual("DistributionType", dataSources[0].Property);
+ ClassicAssert.AreEqual("Mean", dataSources[1].Property);
+ ClassicAssert.AreEqual("Deviation", dataSources[2].Property);
+ ClassicAssert.AreEqual("Variation", dataSources[3].Property);
+ ClassicAssert.AreEqual("DeviationType", dataSources[4].Property);
+ ClassicAssert.AreEqual("Shift", dataSources[5].Property);
+ ClassicAssert.AreEqual(propertyName, dataSources[6].Property);
// Changing CurrentSource should not matter
DataSourceManager.CurrentSource = DataSourceSystemType.MGeobase;
dataSources = redirector.GetRedirectedDataSources(source, propertyName).ToList();
- Assert.IsNotNull(dataSources);
- Assert.AreEqual(7, dataSources.Count);
- Assert.AreEqual("DistributionType", dataSources[0].Property);
- Assert.AreEqual("Mean", dataSources[1].Property);
- Assert.AreEqual("Deviation", dataSources[2].Property);
- Assert.AreEqual("Variation", dataSources[3].Property);
- Assert.AreEqual("DeviationType", dataSources[4].Property);
- Assert.AreEqual("Shift", dataSources[5].Property);
- Assert.AreEqual(propertyName, dataSources[6].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual(7, dataSources.Count);
+ ClassicAssert.AreEqual("DistributionType", dataSources[0].Property);
+ ClassicAssert.AreEqual("Mean", dataSources[1].Property);
+ ClassicAssert.AreEqual("Deviation", dataSources[2].Property);
+ ClassicAssert.AreEqual("Variation", dataSources[3].Property);
+ ClassicAssert.AreEqual("DeviationType", dataSources[4].Property);
+ ClassicAssert.AreEqual("Shift", dataSources[5].Property);
+ ClassicAssert.AreEqual(propertyName, dataSources[6].Property);
}
[TestCase("Cohesion")]
@@ -134,10 +135,10 @@
var dataSources = redirector.GetRedirectedDataSources(source, propertyName).ToList();
// As there are no stochasts visible in a default soil without mechanisms, source and property must not be redirected
- Assert.IsNotNull(dataSources);
- Assert.AreEqual(1, dataSources.Count);
- Assert.AreEqual(source, dataSources[0].Source);
- Assert.AreEqual(propertyName, dataSources[0].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual(1, dataSources.Count);
+ ClassicAssert.AreEqual(source, dataSources[0].Source);
+ ClassicAssert.AreEqual(propertyName, dataSources[0].Property);
// Set mechanism for Soil so the stochasts become visible
Soil.Mechanisms = new[]
@@ -147,12 +148,12 @@
// Now the redirection must take place
dataSources = redirector.GetRedirectedDataSources(source, propertyName).ToList();
- Assert.IsNotNull(dataSources);
- Assert.AreEqual(2, dataSources.Count);
- Assert.AreEqual(stochast, dataSources[0].Source);
- Assert.AreEqual("ActualValue", dataSources[0].Property);
- Assert.AreEqual(source, dataSources[1].Source);
- Assert.AreEqual(propertyName, dataSources[1].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual(2, dataSources.Count);
+ ClassicAssert.AreEqual(stochast, dataSources[0].Source);
+ ClassicAssert.AreEqual("ActualValue", dataSources[0].Property);
+ ClassicAssert.AreEqual(source, dataSources[1].Source);
+ ClassicAssert.AreEqual(propertyName, dataSources[1].Property);
}
[TestCase("Variation")]
@@ -172,15 +173,15 @@
var dataSources = redirector.GetRedirectedDataSources(source.CohesionStochast, propertyName).ToList();
// property must be redirected to deviation
- Assert.IsNotNull(dataSources);
- Assert.AreEqual("Deviation", dataSources[0].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual("Deviation", dataSources[0].Property);
DataSourceManager.CurrentSource = DataSourceSystemType.Csv;
dataSources = redirector.GetRedirectedDataSources(source.CohesionStochast, propertyName).ToList();
// property must always be redirected as it is independend of the CurrentSource
- Assert.IsNotNull(dataSources);
- Assert.AreEqual("Deviation", dataSources[0].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual("Deviation", dataSources[0].Property);
}
[Test]
@@ -200,15 +201,15 @@
var dataSources = redirector.GetRedirectedDataSources(source.CohesionStochast, propertyName).ToList();
// property must be redirected to deviation
- Assert.IsNotNull(dataSources);
- Assert.AreEqual("DeviationType", dataSources[0].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual("DeviationType", dataSources[0].Property);
DataSourceManager.CurrentSource = DataSourceSystemType.Csv;
dataSources = redirector.GetRedirectedDataSources(source.CohesionStochast, propertyName).ToList();
// property must always be redirected as it is independend of the CurrentSource
- Assert.IsNotNull(dataSources);
- Assert.AreEqual("DeviationType", dataSources[0].Property);
+ ClassicAssert.IsNotNull(dataSources);
+ ClassicAssert.AreEqual("DeviationType", dataSources[0].Property);
}
}
}
Index: src/Deltares.DSoilModel.Forms.Tests/BoringControlTests.cs
===================================================================
diff -u -r955 -r1080
--- src/Deltares.DSoilModel.Forms.Tests/BoringControlTests.cs (.../BoringControlTests.cs) (revision 955)
+++ src/Deltares.DSoilModel.Forms.Tests/BoringControlTests.cs (.../BoringControlTests.cs) (revision 1080)
@@ -1,11 +1,13 @@
-using Deltares.Geotechnics;
+using System.Threading;
+using Deltares.Geotechnics;
using Deltares.Geotechnics.Soils;
using Deltares.Standard.Forms;
using NUnit.Framework;
+using NUnit.Framework.Legacy;
namespace Deltares.DSoilModel.Forms.Tests
{
- [TestFixture, RequiresSTA]
+ [TestFixture, Apartment(ApartmentState.STA)]
class BoringControlTests : ControlTester
{
protected override IPropertyControl CreatePropertyControl()
@@ -50,16 +52,16 @@
{
var b = new Boring();
- Assert.AreNotSame(b, PropertyControl.SelectedObject);
+ ClassicAssert.AreNotSame(b, PropertyControl.SelectedObject);
PropertyControl.SelectedObject = b;
- Assert.AreSame(b, PropertyControl.SelectedObject);
+ ClassicAssert.AreSame(b, PropertyControl.SelectedObject);
}
[Test]
public void TestIsVisible_AlwaysTrue()
{
- Assert.IsTrue(PropertyControl.IsVisible);
+ ClassicAssert.IsTrue(PropertyControl.IsVisible);
}
}
}