Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSeries/TimeSeriesProcessorTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSeries/TimeSeriesProcessorTest.cs (.../TimeSeriesProcessorTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSeries/TimeSeriesProcessorTest.cs (.../TimeSeriesProcessorTest.cs) (revision 4638) @@ -75,7 +75,7 @@ processor.Process(); // asserts - Assert.IsNotNull(processor.OutputTimeSeriesCollection); + Assert.That(processor.OutputTimeSeriesCollection, Is.Not.Null); Assert.That(processor.OutputTimeSeriesCollection.Series.Count, Is.EqualTo(1)); Assert.That(processor.OutputTimeSeriesCollection.Series[0].Entries.Count, Is.EqualTo(2)); Assert.That(processor.OutputTimeSeriesCollection.Series[0].LocationId, Is.EqualTo(expectedLocationID)); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/FeatureImporterTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/FeatureImporterTest.cs (.../FeatureImporterTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/FeatureImporterTest.cs (.../FeatureImporterTest.cs) (revision 4638) @@ -37,8 +37,8 @@ IFeatureImporter importer = new FeatureImporter(repository, reader); importer.Import(); - Assert.IsNotNull(repository.Features); - Assert.IsTrue(repository.Features.Any()); + Assert.That(repository.Features, Is.Not.Null); + Assert.That(repository.Features.Any(), Is.True); } #region Setup Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardJobImporterTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardJobImporterTest.cs (.../WaterBoardJobImporterTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardJobImporterTest.cs (.../WaterBoardJobImporterTest.cs) (revision 4638) @@ -64,7 +64,7 @@ // Check if waterlevels assigned WaterBoardJobImporter.ImportWaterlevels(waterBoardJob, timeSerieCollection); - Assert.IsFalse(waterBoardJob.AreAllDikeLocationsWaterLevelTimeSeriesAssigned(), "Check if waterlevels assigned"); + Assert.That(waterBoardJob.AreAllDikeLocationsWaterLevelTimeSeriesAssigned(), Is.False, "Check if waterlevels assigned"); } [Test] @@ -78,7 +78,7 @@ // Check if waterlevels assigned WaterBoardJobImporter.ImportWaterlevels(waterBoardJob, timeSerieCollection); - Assert.IsTrue(waterBoardJob.AreAllDikeLocationsWaterLevelTimeSeriesAssigned(), "Check if waterlevels assigned"); + Assert.That(waterBoardJob.AreAllDikeLocationsWaterLevelTimeSeriesAssigned(), Is.True, "Check if waterlevels assigned"); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/DamProjectVersionXmlHandlerTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/DamProjectVersionXmlHandlerTests.cs (.../DamProjectVersionXmlHandlerTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/DamProjectVersionXmlHandlerTests.cs (.../DamProjectVersionXmlHandlerTests.cs) (revision 4638) @@ -46,7 +46,7 @@ bool result = target.CanHandle(typeof(DamProject), propertyName); // assert - Assert.IsFalse(result); + Assert.That(result, Is.False); } [Test] @@ -55,7 +55,7 @@ // call bool result = target.CanHandle(null, null); // assert - Assert.IsFalse(result); + Assert.That(result, Is.False); } [Test] @@ -65,7 +65,7 @@ bool result = target.CanHandle(typeof(DamProject)); // assert - Assert.IsFalse(result); + Assert.That(result, Is.False); } [Test] @@ -75,7 +75,7 @@ bool result = target.CanHandle(null); // assert - Assert.IsFalse(result); + Assert.That(result, Is.False); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/UpliftFactorToBetaCalculatorTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/UpliftFactorToBetaCalculatorTest.cs (.../UpliftFactorToBetaCalculatorTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/UpliftFactorToBetaCalculatorTest.cs (.../UpliftFactorToBetaCalculatorTest.cs) (revision 4638) @@ -35,15 +35,15 @@ public void UpliftFactorsBelowLowerBoundaryComputedCorrectly() { Assert.That(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(0.4), Is.EqualTo(CBetaMin).Within(CTolerance)); - Assert.IsTrue(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(0.2) < CBetaMin); - Assert.IsTrue(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(0.0) < CBetaMin); + Assert.That(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(0.2), Is.LessThan(CBetaMin)); + Assert.That(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(0.0), Is.LessThan(CBetaMin)); } [Test] public void UpliftFactorsAboveUpperBoundaryComputedCorrectly() { Assert.That(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(2.0), Is.EqualTo(CBetaMax).Within(CTolerance)); - Assert.IsTrue(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(3.0) > CBetaMax); + Assert.That(UpliftFactorToBetaCalculator.ComputeBetaFromUpliftFactor(3.0), Is.GreaterThan(CBetaMax)); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PointTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PointTest.cs (.../PointTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PointTest.cs (.../PointTest.cs) (revision 4638) @@ -37,7 +37,7 @@ Z = 23.563 }; GeometryPoint point2 = point1; - Assert.IsTrue(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.True); } [Test] @@ -55,7 +55,7 @@ Y = 14.22, Z = 23.563 }; - Assert.IsTrue(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.True); } [Test] @@ -73,7 +73,7 @@ Y = 14.22, Z = 23.563 }; - Assert.IsTrue(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.True); } [Test] @@ -91,7 +91,7 @@ Y = 14.23, Z = 23.562 }; - Assert.IsFalse(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.False); } [Test] @@ -105,7 +105,7 @@ { X = 1.002 }; - Assert.IsTrue(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.True); } [Test] @@ -119,7 +119,7 @@ { Y = 14.22 }; - Assert.IsTrue(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.True); } [Test] @@ -133,7 +133,7 @@ { Z = 23.563 }; - Assert.IsTrue(point1.LocationEquals(point2)); + Assert.That(point1.LocationEquals(point2), Is.True); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/FeatueRepositoryExtensionsTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/FeatueRepositoryExtensionsTest.cs (.../FeatueRepositoryExtensionsTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/FeatueRepositoryExtensionsTest.cs (.../FeatueRepositoryExtensionsTest.cs) (revision 4638) @@ -67,11 +67,10 @@ mocks.ReplayAll(); IEnumerable> results = rep1.GetIntersectionPoints(rep2); - Assert.IsNotNull(results); + Assert.That(results, Is.Not.Null); Assert.That(results.Count(), Is.EqualTo(2)); - Assert.IsTrue(results.Any(r => r.Key == 1)); - Assert.IsTrue(results.Any(r => r.Key == 0)); - + Assert.That(results.Any(r => r.Key == 1), Is.True); + Assert.That(results.Any(r => r.Key == 0), Is.True); IntersectionResult result = results.GetResultsHavingCount(1).Single(); Assert.That(geom1.Id, Is.EqualTo(result.Source.Id)); Assert.That(dikeGeom.Id, Is.EqualTo(result.Target.Id)); @@ -111,9 +110,9 @@ IEnumerable> results = rep1.GetIntersectionPoints(rep2); - Assert.IsNotNull(results); + Assert.That(results, Is.Not.Null); Assert.That(results.Count(), Is.EqualTo(1)); - Assert.IsTrue(results.Any(r => r.Key == 1)); + Assert.That(results.Any(r => r.Key == 1), Is.True); Assert.That(results.GetResultsHavingCount(1).Count(), Is.EqualTo(2)); IntersectionResult result = results.ElementAt(0).First(); @@ -147,7 +146,7 @@ mocks.ReplayAll(); IEnumerable> results = rep1.GetIntersectionPoints(rep2); - Assert.IsNotNull(results); + Assert.That(results, Is.Not.Null); Assert.That(results.Count(), Is.EqualTo(1)); Assert.That(results.GetResultsHavingCount(2).Count(), Is.EqualTo(1)); IntersectionResult result = results.ElementAt(0).First(); @@ -179,7 +178,7 @@ mocks.ReplayAll(); IEnumerable> results = rep1.GetIntersectionPoints(rep2); - Assert.IsNotNull(results); + Assert.That(results, Is.Not.Null); Assert.That(results.Count(), Is.EqualTo(1)); Assert.That(results.GetResultsHavingCount(0).Count(), Is.EqualTo(1)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvImporterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvImporterTest.cs (.../CsvImporterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvImporterTest.cs (.../CsvImporterTest.cs) (revision 4638) @@ -141,7 +141,7 @@ { Dike dike = waterBoard.Dikes[0]; - Assert.IsNotNull(dike); + Assert.That(dike, Is.Not.Null); Assert.That(dike.SoilProfiles.Count, Is.EqualTo(2), "SoilProfiles.Count"); @@ -161,7 +161,7 @@ Assert.That(dike.Locations[0].DampingFactorPL3, Is.EqualTo(0.31)); Assert.That(dike.Locations[0].DampingFactorPL4, Is.EqualTo(0.41)); Assert.That(dike.SurfaceLines2[0].CharacteristicPoints.Count(cp => cp.CharacteristicPointType != CharacteristicPointType.None), Is.EqualTo(13)); - Assert.IsNotNull(dike.SurfaceLines2[0].CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.BottomDitchPolderSide)); + Assert.That(dike.SurfaceLines2[0].CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.BottomDitchPolderSide), Is.Not.Null); } } @@ -222,7 +222,7 @@ WaterBoard waterBoard = ImportDirector.Construct(importFolder, null); Dike dike = waterBoard.Dikes[0]; - Assert.IsNotNull(dike); + Assert.That(dike, Is.Not.Null); } /// Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterIrisTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterIrisTests.cs (.../DataPluginImporterIrisTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterIrisTests.cs (.../DataPluginImporterIrisTests.cs) (revision 4638) @@ -68,7 +68,7 @@ dataPluginImporter.ImportDataForDikeRings(null); IList surfaceLinePoints = dataPluginImporter.GetSurfaceLinePoints(dikeRingId, surfaceline02_4Id); - Assert.IsTrue(surfaceLinePoints.Count > 0); + Assert.That(surfaceLinePoints.Count, Is.GreaterThan(0)); Assert.That(surfaceLinePoints[0].X, Is.EqualTo(198341.355).Within(cToleranceCoordinate)); Assert.That(surfaceLinePoints[0].Y, Is.EqualTo(503761.972).Within(cToleranceCoordinate)); Assert.That(surfaceLinePoints[0].Z, Is.EqualTo(0.92).Within(cToleranceCoordinate)); @@ -79,7 +79,7 @@ // Check specific characteristic points of 1 surfaceline IEnumerable surfaceLineCharacteristicPoints = dataPluginImporter.GetSurfaceLineCharacteristicPoints(dikeRingId, surfaceline02_4Id); - Assert.IsTrue(surfaceLineCharacteristicPoints.Count() > 0); + Assert.That(surfaceLineCharacteristicPoints.Count(), Is.GreaterThan(0)); DpCharacteristicPoint pointSurfaceLevelOutside = surfaceLineCharacteristicPoints.Where(x => x.Id.Equals("DikeTopAtPolder")).FirstOrDefault(); Assert.That(pointSurfaceLevelOutside.X, Is.EqualTo(198390.4194).Within(cToleranceCoordinate)); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorRepositoryTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorRepositoryTest.cs (.../SensorRepositoryTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorRepositoryTest.cs (.../SensorRepositoryTest.cs) (revision 4638) @@ -41,8 +41,8 @@ Sensor sensor = repository.AddNew(); // assert - Assert.IsNotNull(sensor); - Assert.IsFalse(sensor.IsTransient(), "The sensor ID is transient. This should not be the case when added to the repository"); + Assert.That(sensor, Is.Not.Null); + Assert.That(sensor.IsTransient(), Is.False, "The sensor ID is transient. This should not be the case when added to the repository"); Assert.That(repository.Sensors.Count(), Is.EqualTo(1)); } } @@ -126,9 +126,9 @@ SensorRepository newRepo = SensorRepository.Deserialize(xml); // assert - Assert.IsNotEmpty(xml); + Assert.That(xml, Is.Not.Empty); Assert.That(newRepo.Sensors.Count(), Is.EqualTo(repository.Sensors.Count())); - Assert.IsTrue(repository.Sensors.Any(s => s.Name == testSensorXyz && s.ID == 1 && s.PLLineMappings.Any(p => p == PLLineType.PL1))); + Assert.That(repository.Sensors.Any(s => s.Name == testSensorXyz && s.ID == 1 && s.PLLineMappings.Any(p => p == PLLineType.PL1)), Is.True); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterBackgroundTests.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterBackgroundTests.cs (.../DataPluginImporterBackgroundTests.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterBackgroundTests.cs (.../DataPluginImporterBackgroundTests.cs) (revision 4638) @@ -46,8 +46,8 @@ { importer.ImportDataForDikeRings(null); IEnumerable idlist = importer.MapGeometryIdList; - Assert.IsNotNull(idlist); - Assert.IsTrue(idlist.Any()); + Assert.That(idlist, Is.Not.Null); + Assert.That(idlist.Any(), Is.True); } [Test] @@ -58,7 +58,7 @@ { importer.ImportDataForDikeRings(null); IEnumerable idlist = importer.MapGeometryIdList; - Assert.IsNotNull(importer.GetMapGeometry(idlist.ElementAt(0))); + Assert.That(importer.GetMapGeometry(idlist.ElementAt(0)), Is.Not.Null); } [Test] @@ -69,7 +69,7 @@ { importer.ImportDataForDikeRings(null); IEnumerable idlist = importer.MapGeometryIdList; - Assert.IsNotNull(importer.GetMapGeometryAttributes(idlist.ElementAt(0))); + Assert.That(importer.GetMapGeometryAttributes(idlist.ElementAt(0)), Is.Not.Null); } #region Setup @@ -80,7 +80,7 @@ mocks = new MockRepository(); string testDataFolder = Path.Combine(Directory.GetCurrentDirectory(), @"TestData\ShapeFiles\Gemeenten.shp"); var testFile = new ShapeFileLocation(testDataFolder); - Assert.IsTrue(testFile.IsValid); + Assert.That(testFile.IsValid, Is.True); dataSources = new List { Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/License/LicenseTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/License/LicenseTest.cs (.../LicenseTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/License/LicenseTest.cs (.../LicenseTest.cs) (revision 4638) @@ -36,7 +36,7 @@ // Only major version is relevant DamLicense.CheckoutLicense(dAuthFeature, "19.1.1.1"); - Assert.IsTrue(DamLicense.DamLicenseType == DamLicenseType.LFM); + Assert.That(DamLicense.DamLicenseType == DamLicenseType.LFM, Is.True); DamLicense.CheckinLicense(); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLinesTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLinesTest.cs (.../PLLinesTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLinesTest.cs (.../PLLinesTest.cs) (revision 4638) @@ -41,7 +41,7 @@ var plLine = new PLLine(); plLine.Points.Add(new PLLinePoint(1.0, 2.0)); plLines.Lines[PLLineType.PL1] = plLine; - Assert.IsTrue(plLines.Lines[PLLineType.PL1].Points[0].LocationEquals(new PLLinePoint(1.0, 2.0))); + Assert.That(plLines.Lines[PLLineType.PL1].Points[0].LocationEquals(new PLLinePoint(1.0, 2.0)), Is.True); } [Test] @@ -51,7 +51,7 @@ var plLine = new PLLine(); plLine.Points.Add(new PLLinePoint(3.0, 4.0)); plLines.Lines[PLLineType.PL4] = plLine; - Assert.IsTrue(plLines.Lines[PLLineType.PL4].Points[0].LocationEquals(new PLLinePoint(3.0, 4.0))); + Assert.That(plLines.Lines[PLLineType.PL4].Points[0].LocationEquals(new PLLinePoint(3.0, 4.0)), Is.True); } [Test] @@ -60,7 +60,7 @@ var plLines = new PLLines(); foreach (PLLineType plLineType in Enum.GetValues(typeof(PLLineType))) { - Assert.IsNotNull(plLines.Lines[plLineType]); + Assert.That(plLines.Lines[plLineType], Is.Not.Null); } } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Forms/DamSpatialEditorDecoratorTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Forms/DamSpatialEditorDecoratorTest.cs (.../DamSpatialEditorDecoratorTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Forms/DamSpatialEditorDecoratorTest.cs (.../DamSpatialEditorDecoratorTest.cs) (revision 4638) @@ -150,7 +150,7 @@ // Check if the event was fired and whether the shapes now contain the characteristic point // that was set. - Assert.IsTrue(shapeCreatedFired); + Assert.That(shapeCreatedFired, Is.True); Assert.That(editor.Shapes.Select(sh => sh.DataObject), Has.Member(characteristicPoint)); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/ShapeFileExporterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/ShapeFileExporterTest.cs (.../ShapeFileExporterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/ShapeFileExporterTest.cs (.../ShapeFileExporterTest.cs) (revision 4638) @@ -64,7 +64,7 @@ // Reading data back to verify the export IFeatureRepository retrievedRepository = FeatureRepository.CreateFromShapeFile(fileLocation); - Assert.IsNotNull(retrievedRepository); + Assert.That(retrievedRepository, Is.Not.Null); IFeature retrievedFeature = retrievedRepository.Features.ElementAt(0); Assert.That(retrievedFeature.Attributes[attrName], Is.EqualTo(1.7)); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/UISupport/ConfigurationManagerTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/UISupport/ConfigurationManagerTest.cs (.../ConfigurationManagerTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/UISupport/ConfigurationManagerTest.cs (.../ConfigurationManagerTest.cs) (revision 4638) @@ -43,9 +43,9 @@ Assert.That(failureMechanisms.Count, Is.EqualTo(3), "DamClassicStability: Incorrect number of failuremechanisms for deterministic calculation"); foreach (object failureMechanism in failureMechanisms) { - Assert.IsTrue(failureMechanism.Equals(FailureMechanismSystemType.Piping) || - failureMechanism.Equals(FailureMechanismSystemType.StabilityInside) || - failureMechanism.Equals(FailureMechanismSystemType.StabilityOutside)); + Assert.That(failureMechanism.Equals(FailureMechanismSystemType.Piping) || + failureMechanism.Equals(FailureMechanismSystemType.StabilityInside) || + failureMechanism.Equals(FailureMechanismSystemType.StabilityOutside), Is.True); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/AuthorizationTestBase.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/AuthorizationTestBase.cs (.../AuthorizationTestBase.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/AuthorizationTestBase.cs (.../AuthorizationTestBase.cs) (revision 4638) @@ -49,9 +49,9 @@ { using (var aw = new DAuthClient(false, true)) { - Assert.IsFalse(aw.CheckOut("NotFound", "1.0")); + Assert.That(aw.CheckOut("NotFound", "1.0"), Is.False); string errorMessage = aw.GetLastErrorMessage(); - Assert.IsTrue(errorMessage.Contains(LicenseNotFoundMessage)); + Assert.That(errorMessage, Does.Contain(LicenseNotFoundMessage)); } } @@ -63,16 +63,14 @@ string feature = GetFeature(); foreach (string supportedFeatureVersion in GetSupportedFeatureVersions()) { - Assert.IsTrue(aw.CheckOut(feature, supportedFeatureVersion), - string.Format("{0} - {1} not accepted.", feature, supportedFeatureVersion)); + Assert.That(aw.CheckOut(feature, supportedFeatureVersion), Is.True, $"{feature} - {supportedFeatureVersion} not accepted."); } foreach (string unsupportedFeatureVersion in GetUnsupportedFeatureVersions()) { - Assert.IsFalse(aw.CheckOut(feature, unsupportedFeatureVersion), - string.Format("{0} - {1} accepted while it shouldn't.", feature, unsupportedFeatureVersion)); + Assert.That(aw.CheckOut(feature, unsupportedFeatureVersion), Is.False, $"{feature} - {unsupportedFeatureVersion} accepted while it shouldn't."); string errorMessage = aw.GetLastErrorMessage(); - Assert.IsTrue(errorMessage.Contains(LicenseNotFoundMessage)); + Assert.That(errorMessage, Does.Contain(LicenseNotFoundMessage)); } } } @@ -82,8 +80,8 @@ { using (var aw = new DAuthClient(false, true)) { - Assert.IsTrue(aw.CheckOut(GetFeature(), GetSupportedFeatureVersions().First())); - Assert.IsTrue(aw.CheckIn(GetFeature())); + Assert.That(aw.CheckOut(GetFeature(), GetSupportedFeatureVersions().First()), Is.True); + Assert.That(aw.CheckIn(GetFeature()), Is.True); } } @@ -93,7 +91,7 @@ using (var aw = new DAuthClient(false, true)) { var awres = ""; - Assert.IsTrue(aw.GetVendor(GetFeature(), ref awres)); + Assert.That(aw.GetVendor(GetFeature(), ref awres), Is.True); Assert.That(awres, Is.EqualTo("Deltares")); } } @@ -104,7 +102,7 @@ using (var aw = new DAuthClient(false, true)) { var awres = ""; - Assert.IsTrue(aw.GetDistributor(GetFeature(), ref awres)); + Assert.That(aw.GetDistributor(GetFeature(), ref awres), Is.True); Assert.That(awres, Is.EqualTo("Deltares")); } } @@ -115,7 +113,7 @@ using (var aw = new DAuthClient(false, true)) { String awres = null; - Assert.IsTrue(aw.GetNotice(GetFeature(), ref awres)); + Assert.That(aw.GetNotice(GetFeature(), ref awres), Is.True); Assert.That(awres, Is.EqualTo("This product is licensed to Stichting Deltares.")); } } @@ -126,7 +124,7 @@ using (var aw = new DAuthClient(false, true)) { String awres = null; - Assert.IsTrue(aw.GetUsername(GetFeature(), ref awres)); + Assert.That(aw.GetUsername(GetFeature(), ref awres), Is.True); Assert.That(awres, Is.EqualTo("Stichting Deltares")); } } @@ -139,11 +137,11 @@ int firstCount = -1; aw.GetCount(GetFeature(), ref firstCount); - Assert.IsTrue(aw.CheckOut(GetFeature(), GetSupportedFeatureVersions().First())); + Assert.That(aw.CheckOut(GetFeature(), GetSupportedFeatureVersions().First()), Is.True); int secondCount = -1; aw.GetCount(GetFeature(), ref secondCount); Assert.That(secondCount, Is.EqualTo(firstCount + 1)); - Assert.IsTrue(aw.CheckIn(GetFeature())); + Assert.That(aw.CheckIn(GetFeature()), Is.True); aw.GetCount(GetFeature(), ref secondCount); Assert.That(secondCount, Is.EqualTo(firstCount)); } @@ -168,12 +166,11 @@ String[] currentUsers = null; string feature = GetFeature(); - Assert.IsTrue(aw.CheckOut(feature, GetSupportedFeatureVersions().First())); - Assert.IsTrue(aw.GetCurrentUsers(feature, ref currentUsers)); - Assert.IsNotEmpty(currentUsers); - Assert.IsTrue(currentUsers.Any(u => u == Environment.UserName)); - Assert.IsTrue(aw.CheckIn(feature)); - } + Assert.That(aw.CheckOut(feature, GetSupportedFeatureVersions().First()), Is.True); + Assert.That(aw.GetCurrentUsers(feature, ref currentUsers), Is.True); + Assert.That(currentUsers, Is.Not.Empty); + Assert.That(currentUsers.Any(u => u == Environment.UserName), Is.True); + Assert.That(aw.CheckIn(feature), Is.True); } } [Test] @@ -183,13 +180,13 @@ { int count = -1; string feature = GetFeature(); - Assert.IsTrue(aw.GetUsedLicenses(feature, Environment.UserName, ref count)); + Assert.That(aw.GetUsedLicenses(feature, Environment.UserName, ref count), Is.True); Assert.That(count, Is.EqualTo(0)); - Assert.IsTrue(aw.CheckOut(feature, GetSupportedFeatureVersions().First())); - Assert.IsTrue(aw.GetUsedLicenses(feature, Environment.UserName, ref count)); + Assert.That(aw.CheckOut(feature, GetSupportedFeatureVersions().First()), Is.True); + Assert.That(aw.GetUsedLicenses(feature, Environment.UserName, ref count), Is.True); Assert.That(count, Is.EqualTo(1)); - Assert.IsTrue(aw.CheckIn(feature)); + Assert.That(aw.CheckIn(feature), Is.True); } } @@ -199,7 +196,7 @@ using (var aw = new DAuthClient(false, true)) { var count = 0; - Assert.IsTrue(aw.GetAvailableLicenses(GetFeature(), ref count)); + Assert.That(aw.GetAvailableLicenses(GetFeature(), ref count), Is.True); Assert.That(count, Is.EqualTo(500)); } } @@ -210,10 +207,10 @@ using (var aw = new DAuthClient(false, true)) { String[] features = null; - Assert.IsTrue(aw.GetAvailableFeatures(ref features)); - Assert.IsNotEmpty(features); - string feature = GetFeature(); - Assert.IsTrue(features.Any(f => f == feature)); + Assert.That(aw.GetAvailableFeatures(ref features), Is.True); + Assert.That(features, Is.Not.Empty); + string feature = GetFeature(); + Assert.That(features.Any(f => f == feature), Is.True); } } @@ -223,8 +220,8 @@ using (var aw = new DAuthClient(false, true)) { var isServer = false; - Assert.IsTrue(aw.IsServer(GetFeature(), ref isServer)); - Assert.IsTrue(isServer); + Assert.That(aw.IsServer(GetFeature(), ref isServer), Is.True); + Assert.That(isServer, Is.True); } } @@ -241,13 +238,13 @@ stopwatch.Start(); for (var i = 0; i < 10; i++) { - Assert.IsTrue(aw.CheckOut(feature, version)); - Assert.IsTrue(aw.CheckIn(feature)); + Assert.That(aw.CheckOut(feature, version), Is.True); + Assert.That(aw.CheckIn(feature), Is.True); Console.Error.WriteLine("Round :" + i); } stopwatch.Stop(); - Assert.Less(stopwatch.Elapsed, new TimeSpan(0, 0, 0, 3)); + Assert.That(stopwatch.Elapsed, Is.LessThan(new TimeSpan(0, 0, 0, 3))); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeTest.cs (.../DikeTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeTest.cs (.../DikeTest.cs) (revision 4638) @@ -137,13 +137,13 @@ [Test] public void TestDikeIntegrity() { - Assert.IsNotNull(dike); + Assert.That(dike, Is.Not.Null); Assert.That(dike.Name, Is.EqualTo("Dike")); //Assert.IsNotNull(this.dike.Segments); - Assert.IsNotNull(dike.Locations); - Assert.IsNotNull(dike.SurfaceLines2); - Assert.IsNotNull(dike.SoilProfiles); + Assert.That(dike.Locations, Is.Not.Null); + Assert.That(dike.SurfaceLines2, Is.Not.Null); + Assert.That(dike.SoilProfiles, Is.Not.Null); } // [Test] @@ -160,7 +160,7 @@ [Test] public void TestDikeLocations() { - Assert.IsNotNull(location1); + Assert.That(location1, Is.Not.Null); Assert.That(dike.Locations.Count, Is.EqualTo(1)); Assert.That(dike.Locations[0], Is.EqualTo(location1)); @@ -170,8 +170,8 @@ [Test] public void TestDikeSurfaceLines() { - Assert.IsNotNull(surfaceLine1); - Assert.IsNotNull(surfaceLine1.Geometry.Points); + Assert.That(surfaceLine1, Is.Not.Null); + Assert.That(surfaceLine1.Geometry.Points, Is.Not.Null); Assert.That(dike.SurfaceLines2.Count, Is.EqualTo(1)); Assert.That(dike.SurfaceLines2[0], Is.EqualTo(surfaceLine1)); @@ -181,7 +181,7 @@ [Test] public void TestDikeSoilProfiles() { - Assert.IsNotNull(soilProfile); + Assert.That(soilProfile, Is.Not.Null); Assert.That(dike.SoilProfiles.Count, Is.EqualTo(1)); Assert.That(dike.SoilProfiles[0], Is.EqualTo(soilProfile)); @@ -191,14 +191,14 @@ [Test] public void TestDikeLocationSegments() { - Assert.IsNotNull(location1.Segment); + Assert.That(location1.Segment, Is.Not.Null); Assert.That(location1.Segment, Is.EqualTo(segment1)); } [Test] public void TestDikeLocationSurfaceLines() { - Assert.IsNotNull(location1.SurfaceLine2); + Assert.That(location1.SurfaceLine2, Is.Not.Null); Assert.That(location1.SurfaceLine2, Is.EqualTo(surfaceLine1)); } @@ -227,7 +227,7 @@ Assert.That(surfaceLine1.GetCharacteristicPoints(points[0]).Count(cpt => cpt != CharacteristicPointType.None), Is.EqualTo(0)); Assert.That(surfaceLine1.GetCharacteristicPoints(points[1]).First(), Is.EqualTo(CharacteristicPointType.DikeToeAtRiver)); - Assert.IsTrue(surfaceLine1.HasDike()); + Assert.That(surfaceLine1.HasDike(), Is.True); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PolyLineTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PolyLineTest.cs (.../PolyLineTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PolyLineTest.cs (.../PolyLineTest.cs) (revision 4638) @@ -39,15 +39,15 @@ public void LineWithoutPointsShouldNotExist() { var polyLine = new PolyLine(); - Assert.IsFalse(polyLine.Exists()); + Assert.That(polyLine.Exists(), Is.False); } [Test] public void LineWithOnePointShouldNotExist() { var polyLine = new PolyLine(); polyLine.Points.Add(new GeometryPoint()); - Assert.IsFalse(polyLine.Exists()); + Assert.That(polyLine.Exists(), Is.False); } [Test] @@ -59,35 +59,35 @@ { X = 1.0 }); - Assert.IsTrue(polyLine.Exists()); + Assert.That(polyLine.Exists(), Is.True); } [Test] public void CheckIfLineWithAscendingXIsEvaluatedCorrectlyAsAscending() { PolyLine polyLine = CreateStrictAscendingPolyLine(); - Assert.IsTrue(polyLine.IsXAscending()); + Assert.That(polyLine.IsXAscending(), Is.True); } [Test] public void CheckIfLineWithNotStrictAscendingXIsEvaluatedCorrectlyAsAscending() { PolyLine polyLine = CreateNotStrictAscendingPolyLine(); - Assert.IsTrue(polyLine.IsXAscending()); + Assert.That(polyLine.IsXAscending(), Is.True); } [Test] public void CheckIfLineWithNotStrictAscendingXIsEvaluatedCorrectlyAsNotStrictAscending() { PolyLine polyLine = CreateNotStrictAscendingPolyLine(); - Assert.IsFalse(polyLine.IsXStrictAscending()); + Assert.That(polyLine.IsXStrictAscending(), Is.False); } [Test] public void CheckIfLineWithNotAscendingXIsEvaluatedCorrectlyAsNotAscending() { PolyLine polyLine = CreateNotAscendingPolyLine(); - Assert.IsFalse(polyLine.IsXAscending()); + Assert.That(polyLine.IsXAscending(), Is.False); } [Test] @@ -135,7 +135,7 @@ { PolyLine polyLine1 = CreateStrictAscendingPolyLine(); PolyLine polyLine2 = CreateNotStrictAscendingPolyLine(); - Assert.IsFalse(polyLine1.Equals(polyLine2)); + Assert.That(polyLine1.Equals(polyLine2), Is.False); } /// @@ -159,7 +159,7 @@ { PolyLine polyLine1 = CreateStrictAscendingPolyLine(); PolyLine polyLine2 = CreateStrictAscendingPolyLine(); - Assert.IsTrue(polyLine1.Equals(polyLine2)); + Assert.That(polyLine1.Equals(polyLine2), Is.True); } /// @@ -175,7 +175,7 @@ EndPoint = new GeometryPoint(5, 0, -1) }; IList intersectionPoints = polyLine1.IntersectionPointsXzWithLineXz(line); - Assert.IsTrue(intersectionPoints.Count == 1); + Assert.That(intersectionPoints, Has.Count.EqualTo(1)); Assert.That(intersectionPoints[0].X, Is.EqualTo(1.0).Within(GeometryPoint.Precision)); Assert.That(intersectionPoints[0].Z, Is.EqualTo(-1.0).Within(GeometryPoint.Precision)); } @@ -190,7 +190,7 @@ EndPoint = new GeometryPoint(-3, 0, -1) }; IList intersectionPoints = polyLine1.IntersectionPointsXzWithLineXz(line); - Assert.IsTrue(intersectionPoints.Count == 0); + Assert.That(intersectionPoints, Is.Empty); } [Test] @@ -203,7 +203,7 @@ EndPoint = new GeometryPoint(15, 0, -1) }; IList intersectionPoints = polyLine1.IntersectionPointsXzWithLineXz(line); - Assert.IsTrue(intersectionPoints.Count == 2); + Assert.That(intersectionPoints, Has.Count.EqualTo(2)); Assert.That(intersectionPoints[0].X, Is.EqualTo(1.0).Within(GeometryPoint.Precision)); Assert.That(intersectionPoints[0].Z, Is.EqualTo(-1.0).Within(GeometryPoint.Precision)); Assert.That(intersectionPoints[1].X, Is.EqualTo(11.0).Within(GeometryPoint.Precision)); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/ShapeFileReaderTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/ShapeFileReaderTest.cs (.../ShapeFileReaderTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/ShapeFileReaderTest.cs (.../ShapeFileReaderTest.cs) (revision 4638) @@ -38,18 +38,18 @@ reader.IgnoreAttributeData = false; // default IEnumerable geoms = reader.Read(); - Assert.IsNotNull(geoms); - Assert.IsTrue(geoms.Count() > 0); + Assert.That(geoms, Is.Not.Null); + Assert.That(geoms.Count(), Is.GreaterThan(0)); foreach (IFeature geom in geoms) { - Assert.IsNotNull(geom.Geometry); - Assert.IsNotNull(geom.WktFormat); - Assert.IsNotNull(geom.Attributes); - Assert.IsTrue(geom.Attributes.Count > 0); - Assert.IsNotNull(geom.Attributes.GetNames()); - Assert.IsTrue(geom.Attributes.GetNames().Count() > 0); - Assert.IsNotNull(geom.Attributes.GetValues()); - Assert.IsTrue(geom.Attributes.GetValues().Count() > 0); + Assert.That(geom.Geometry, Is.Not.Null); + Assert.That(geom.WktFormat, Is.Not.Null); + Assert.That(geom.Attributes, Is.Not.Null); + Assert.That(geom.Attributes.Count, Is.GreaterThan(0)); + Assert.That(geom.Attributes.GetNames(), Is.Not.Null); + Assert.That(geom.Attributes.GetNames().Count(), Is.GreaterThan(0)); + Assert.That(geom.Attributes.GetValues(), Is.Not.Null); + Assert.That(geom.Attributes.GetValues().Count(), Is.GreaterThan(0)); } } @@ -58,13 +58,13 @@ { reader.IgnoreAttributeData = true; IEnumerable geoms = reader.Read(); - Assert.IsNotNull(geoms); - Assert.IsTrue(geoms.Count() > 0); + Assert.That(geoms, Is.Not.Null); + Assert.That(geoms.Count(), Is.GreaterThan(0)); foreach (IFeature geom in geoms) { - Assert.IsNotNull(geom.Geometry); - Assert.IsNotNull(geom.WktFormat); - Assert.IsNotNull(geom.Attributes); + Assert.That(geom.Geometry, Is.Not.Null); + Assert.That(geom.WktFormat, Is.Not.Null); + Assert.That(geom.Attributes, Is.Not.Null); Assert.That(geom.Attributes.Count, Is.EqualTo(0)); } } @@ -77,13 +77,13 @@ { reader.IgnoreAttributeData = true; IEnumerable geoms = reader.Read(); - Assert.IsNotNull(geoms); - Assert.IsTrue(geoms.Count() > 0); + Assert.That(geoms, Is.Not.Null); + Assert.That(geoms.Count(), Is.GreaterThan(0)); foreach (IFeature geom in geoms) { - Assert.IsNotNull(geom.Geometry); - Assert.IsNotNull(geom.WktFormat); - Assert.IsNotNull(geom.Attributes); + Assert.That(geom.Geometry, Is.Not.Null); + Assert.That(geom.WktFormat, Is.Not.Null); + Assert.That(geom.Attributes, Is.Not.Null); Assert.That(geom.Attributes.Count, Is.EqualTo(0)); } }; Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLineTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLineTest.cs (.../PLLineTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLineTest.cs (.../PLLineTest.cs) (revision 4638) @@ -41,16 +41,16 @@ { var plLine = new PLLine(); - Assert.IsNotNull(plLine); + Assert.That(plLine, Is.Not.Null); } [Test] public void TestPointEqualsWithTolerance() { var plLinePoint1 = new PLLinePoint(1.1, 2.1); var plLinePoint2 = new PLLinePoint(1.1, 2.100001); - Assert.IsTrue(plLinePoint2.LocationEquals(plLinePoint1, 0.0001)); - Assert.IsFalse(plLinePoint2.LocationEquals(plLinePoint1, 0.0000001)); + Assert.That(plLinePoint2.LocationEquals(plLinePoint1, 0.0001), Is.True); + Assert.That(plLinePoint2.LocationEquals(plLinePoint1, 0.0000001), Is.False); } [Test] @@ -117,22 +117,22 @@ }); var pointAbove = new GeometryPoint(1, 0, 1); - Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointAbove) == PLLinePointPositionXzType.AbovePLLine); + Assert.That(plLine.PositionXzOfPointRelatedToPLLine(pointAbove) == PLLinePointPositionXzType.AbovePLLine, Is.True); var pointBelow = new GeometryPoint(1, 0, -1); - Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointBelow) == PLLinePointPositionXzType.BelowPLLine); + Assert.That(plLine.PositionXzOfPointRelatedToPLLine(pointBelow) == PLLinePointPositionXzType.BelowPLLine, Is.True); var pointOn = new GeometryPoint(1, 0, 0); - Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointOn) == PLLinePointPositionXzType.OnPLLine); + Assert.That(plLine.PositionXzOfPointRelatedToPLLine(pointOn) == PLLinePointPositionXzType.OnPLLine, Is.True); var pointAboveBeyond = new GeometryPoint(100, 0, 1); - Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointAboveBeyond) == PLLinePointPositionXzType.BeyondPLLine); + Assert.That(plLine.PositionXzOfPointRelatedToPLLine(pointAboveBeyond) == PLLinePointPositionXzType.BeyondPLLine, Is.True); var pointBelowBeyond = new GeometryPoint(100, 0, -1); - Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointBelowBeyond) == PLLinePointPositionXzType.BeyondPLLine); + Assert.That(plLine.PositionXzOfPointRelatedToPLLine(pointBelowBeyond) == PLLinePointPositionXzType.BeyondPLLine, Is.True); var pointOnBeyond = new GeometryPoint(100, 0, 0); - Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointOnBeyond) == PLLinePointPositionXzType.BeyondPLLine); + Assert.That(plLine.PositionXzOfPointRelatedToPLLine(pointOnBeyond) == PLLinePointPositionXzType.BeyondPLLine, Is.True); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LoadCompatiblityTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LoadCompatiblityTest.cs (.../LoadCompatiblityTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LoadCompatiblityTest.cs (.../LoadCompatiblityTest.cs) (revision 4638) @@ -99,7 +99,7 @@ foreach (Location location in projectData.Locations) { // surfaceline2 present with characteristic points ? - Assert.NotNull(location.SurfaceLine2); + Assert.That(location.SurfaceLine2, Is.Not.Null); Assert.That(location.SurfaceLine2.Name, Is.EqualTo(location.Name)); Assert.That(location.SurfaceLine2.CharacteristicPoints.GeometryMustContainPoint, Is.EqualTo(true)); Assert.That(location.SurfaceLine2.HasDike(), Is.EqualTo(true)); @@ -612,12 +612,12 @@ { const double accuracy = 0.01; // quick check for surfaceline2 conversion - Assert.NotNull(actualLocation.SurfaceLine2); + Assert.That(actualLocation.SurfaceLine2, Is.Not.Null); Assert.That(actualLocation.SurfaceLine2.Name, Is.EqualTo("TPL_Hempolder_0100")); Assert.That(actualLocation.SurfaceLine2.CharacteristicPoints.GeometryMustContainPoint, Is.EqualTo(true)); Assert.That(actualLocation.SurfaceLine2.HasDike(), Is.EqualTo(true)); CharacteristicPoint dikeToeAtRiver = actualLocation.SurfaceLine2.CharacteristicPoints.FirstOrDefault(p => p.CharacteristicPointType == CharacteristicPointType.DikeToeAtRiver); - Assert.NotNull(dikeToeAtRiver); + Assert.That(dikeToeAtRiver, Is.Not.Null); Assert.That(dikeToeAtRiver.X, Is.EqualTo(111222.28).Within(accuracy)); Assert.That(dikeToeAtRiver.Y, Is.EqualTo(507206.24).Within(accuracy)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Importers/LineAttributeImporterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Importers/LineAttributeImporterTest.cs (.../LineAttributeImporterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Importers/LineAttributeImporterTest.cs (.../LineAttributeImporterTest.cs) (revision 4638) @@ -327,7 +327,7 @@ importer.Import(); - Assert.IsTrue(importer.Errors.OfType().Count() == 1, "The NotSupported error was not added to the error list for logging when no intersections are found. "); + Assert.That(importer.Errors.OfType().Count(), Is.EqualTo(1), "The NotSupported error was not added to the error list for logging when no intersections are found. "); } #region Fixture Setup/Teardown Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorLocationTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorLocationTests.cs (.../SensorLocationTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorLocationTests.cs (.../SensorLocationTests.cs) (revision 4638) @@ -63,7 +63,7 @@ { var factory = new SensorFactory(); SensorLocation sensorLocation = factory.CreateSensorLocation(location); - Assert.IsTrue(sensorLocation.IsValid(), "The initialized test sensor location is not valid"); + Assert.That(sensorLocation.IsValid(), Is.True, "The initialized test sensor location is not valid"); return sensorLocation; } @@ -107,7 +107,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -121,7 +121,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -135,7 +135,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -149,7 +149,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -163,7 +163,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -177,7 +177,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -191,7 +191,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -205,7 +205,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -219,7 +219,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -233,7 +233,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -247,7 +247,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -261,7 +261,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -275,7 +275,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -289,7 +289,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -303,7 +303,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -317,7 +317,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -331,7 +331,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -345,7 +345,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -359,7 +359,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -373,7 +373,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -387,7 +387,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -401,7 +401,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -415,7 +415,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -429,7 +429,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -456,7 +456,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } } @@ -471,7 +471,7 @@ bool actual = sensorLocation.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } #endregion @@ -575,7 +575,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowDikeToeAtPolder, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -623,7 +623,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowDikeToeAtPolder, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -646,7 +646,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowDikeTopAtPolder, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -693,7 +693,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowDikeTopAtPolder, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -716,7 +716,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowDikeTopAtRiver, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -763,7 +763,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowDikeTopAtRiver, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -786,7 +786,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowShoulderBaseInside, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -834,7 +834,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1PlLineOffsetBelowShoulderBaseInside, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -857,7 +857,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1WaterLevelAtPolder, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -929,7 +929,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl1WaterLevelAtRiver, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -1000,7 +1000,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl3, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] @@ -1071,7 +1071,7 @@ double? actualValue = sensorLocation.GetValue(x => x.SourceTypePl4, sensorValues, sensor); // assert - Assert.IsNull(actualValue); + Assert.That(actualValue, Is.Null); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvImporterTestsNew.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvImporterTestsNew.cs (.../CsvImporterTestsNew.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvImporterTestsNew.cs (.../CsvImporterTestsNew.cs) (revision 4638) @@ -567,7 +567,7 @@ CreateScenariosFileWithIllegalValues(testFilePath); var csvImporterScenarios = new CsvImporterScenarios(testFilePath); IList scenarioRecords = csvImporterScenarios.ImportedItems; - Assert.IsEmpty(scenarioRecords); + Assert.That(scenarioRecords, Is.Empty); Assert.That(csvImporterScenarios.ErrorMessages.Count, Is.EqualTo(2)); } @@ -687,7 +687,7 @@ Assert.That(csvImporterSegments.ImportedItems.Count, Is.EqualTo(7672)); TimeSpan maxTime = TimeSpan.FromSeconds(6); // This is the time on the buildserver; local time was 2 seconds; // enlarged from 4 to 6 sec because code coverage was turned on on build server - Assert.Less(elapsed, maxTime); + Assert.That(elapsed, Is.LessThan(maxTime)); }); } @@ -829,7 +829,7 @@ CreateSoilsFileWithIllegalValues(testFilePath); var csvImporterSoils = new CsvImporterSoils(testFilePath); IList scenarioRecords = csvImporterSoils.ImportedItems; - Assert.IsEmpty(scenarioRecords); + Assert.That(scenarioRecords, Is.Empty); Assert.That(csvImporterSoils.ErrorMessages.Count, Is.EqualTo(3)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardJobTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardJobTest.cs (.../WaterBoardJobTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardJobTest.cs (.../WaterBoardJobTest.cs) (revision 4638) @@ -56,7 +56,7 @@ WaterBoardJob waterBoardJob = FactoryForWaterBoard.CreateWaterBoardJobWithOneLocationWithoutWaterLevelTimeSeries(); disposables.AddRange(FactoryForWaterBoard.GetDisposableObjectsFromWaterBoardJob(waterBoardJob)); - Assert.IsFalse(waterBoardJob.AreAllDikeLocationsWaterLevelTimeSeriesAssigned(), "Check if all waterlevels not assigned"); + Assert.That(waterBoardJob.AreAllDikeLocationsWaterLevelTimeSeriesAssigned(), Is.False, "Check if all waterlevels not assigned"); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterTests.cs (.../DataPluginImporterTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterTests.cs (.../DataPluginImporterTests.cs) (revision 4638) @@ -88,7 +88,7 @@ //var destDataSources = dataPluginImporter.DataSources.ToList(); List destDataSources = dataPluginImporter.DataSources.ToList(); Assert.That(destDataSources.Count(), Is.EqualTo(srcDataSources.Count)); - Assert.IsTrue(srcDataSources[0].Equals(destDataSources.FirstOrDefault())); + Assert.That(srcDataSources[0].Equals(destDataSources.FirstOrDefault()), Is.True); } [Test] @@ -144,16 +144,14 @@ string scenarioIdOne = dataPluginImporter.GetScenarioList(dikeRingId, Location1Id).FirstOrDefault(); NameValueParameter[] scenarioDetailsOne = dataPluginImporter.GetScenarioDetails(dikeRingId, Location1Id, scenarioIdOne).ToArray(); - Assert.IsNotEmpty(scenarioDetailsOne); + Assert.That(scenarioDetailsOne, Is.Not.Empty); NameValueParameter headPl2ValueOne = scenarioDetailsOne.SingleOrDefault(x => x.ParameterName.Equals("HeadPL2")); - Assert.IsNotNull(headPl2ValueOne); Assert.That(headPl2ValueOne.ParameterValue, Is.EqualTo("-5.37")); string scenarioIdTwo = dataPluginImporter.GetScenarioList(dikeRingId, Location2Id).FirstOrDefault(); NameValueParameter[] scenarioDetailsTwo = dataPluginImporter.GetScenarioDetails(dikeRingId, Location2Id, scenarioIdTwo).ToArray(); - Assert.IsNotEmpty(scenarioDetailsTwo); + Assert.That(scenarioDetailsTwo, Is.Not.Empty); NameValueParameter headPl2ValueTwo = scenarioDetailsTwo.SingleOrDefault(x => x.ParameterName.Equals("HeadPL2")); - Assert.IsNotNull(headPl2ValueTwo); Assert.That(headPl2ValueTwo.ParameterValue, Is.EqualTo("-5.37")); } @@ -176,7 +174,7 @@ string scenarioId = dataPluginImporter.GetScenarioList(dikeRingId, Location1Id).FirstOrDefault(); IEnumerable scenarioDetails = dataPluginImporter.GetScenarioDetails(dikeRingId, Location1Id, scenarioId); NameValueParameter[] nameValueParameters = scenarioDetails as NameValueParameter[] ?? scenarioDetails.ToArray(); - Assert.IsTrue(nameValueParameters.Any()); + Assert.That(nameValueParameters.Any(), Is.True); Assert.That(nameValueParameters.FirstOrDefault(x => x.ParameterName.Equals("HeadPL3")).ParameterValue, Is.EqualTo("-99")); scenarioDetails = dataPluginImporter.GetScenarioDetails(dikeRingId, Location2Id, scenarioId); @@ -202,7 +200,7 @@ string scenarioId = dataPluginImporter.GetScenarioList(dikeRingId, Location1Id).FirstOrDefault(); IEnumerable scenarioDetails = dataPluginImporter.GetScenarioDetails(dikeRingId, Location1Id, scenarioId); NameValueParameter[] nameValueParameters = scenarioDetails as NameValueParameter[] ?? scenarioDetails.ToArray(); - Assert.IsTrue(nameValueParameters.Any()); + Assert.That(nameValueParameters.Any(), Is.True); Assert.That(nameValueParameters.FirstOrDefault(x => x.ParameterName.Equals("HeadPL3")).ParameterValue, Is.EqualTo("-3.651")); scenarioDetails = dataPluginImporter.GetScenarioDetails(dikeRingId, Location2Id, scenarioId); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/ShapeFileCreatorTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/ShapeFileCreatorTest.cs (.../ShapeFileCreatorTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Services/ShapeFileCreatorTest.cs (.../ShapeFileCreatorTest.cs) (revision 4638) @@ -81,8 +81,8 @@ var shapeFile = new ShapeFileLocation(shpFilePath); IFeatureRepository retrievedRepository = FeatureRepository.CreateFromShapeFile(shapeFile); - Assert.IsNotNull(retrievedRepository); - Assert.IsTrue(retrievedRepository.Count == 1); + Assert.That(retrievedRepository, Is.Not.Null); + Assert.That(retrievedRepository.Count, Is.EqualTo(1)); Assert.That(repository.Features.ElementAt(0).Geometry.GeometryType, Is.EqualTo("LineString")); } @@ -98,10 +98,10 @@ var shapeFile = new ShapeFileLocation(shpFilePath); IFeatureRepository retrievedRepository = FeatureRepository.CreateFromShapeFile(shapeFile); - Assert.IsNotNull(retrievedRepository); - Assert.IsTrue(retrievedRepository.Count == 2); - Assert.IsTrue(repository.Features.Any(f => f.Geometry.GeometryType == "LineString")); - Assert.IsTrue(repository.Features.Any(f => f.Geometry.GeometryType == "MultiLineString")); + Assert.That(retrievedRepository, Is.Not.Null); + Assert.That(retrievedRepository.Count, Is.EqualTo(2)); + Assert.That(repository.Features.Any(f => f.Geometry.GeometryType == "LineString"), Is.True); + Assert.That(repository.Features.Any(f => f.Geometry.GeometryType == "MultiLineString"), Is.True); } [Test] @@ -115,8 +115,8 @@ var shapeFile = new ShapeFileLocation(shpFilePath); IFeatureRepository retrievedRepository = FeatureRepository.CreateFromShapeFile(shapeFile); - Assert.IsNotNull(retrievedRepository); - Assert.IsTrue(retrievedRepository.Count == 1); + Assert.That(retrievedRepository, Is.Not.Null); + Assert.That(retrievedRepository.Count, Is.EqualTo(1)); Assert.That(repository.Features.ElementAt(0).Geometry.GeometryType, Is.EqualTo("GeometryPoint")); } @@ -139,9 +139,9 @@ private void AssertThatMandatoryFilesExist() { - Assert.IsTrue(File.Exists(shpFilePath), string.Format("{0} does not exist", shpFile)); - Assert.IsTrue(File.Exists(dbfFilePath), string.Format("{0} does not exist", dbfFile)); - Assert.IsTrue(File.Exists(shxFilePath), string.Format("{0} does not exist", shxFile)); + Assert.That(File.Exists(shpFilePath), Is.True, $"{shpFile} does not exist"); + Assert.That(File.Exists(dbfFilePath), Is.True, $"{dbfFile} does not exist"); + Assert.That(File.Exists(shxFilePath), Is.True, $"{shxFile} does not exist"); } #region Setup Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamCalculationBenchmarkTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamCalculationBenchmarkTest.cs (.../DamCalculationBenchmarkTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.BenchmarkTests/DamCalculationBenchmarkTest.cs (.../DamCalculationBenchmarkTest.cs) (revision 4638) @@ -113,7 +113,7 @@ RemoveCalculationDirectoriesForProject(cFolderName); List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.That(allCalculationResults[0].IsUplift.Value, Is.True); Assert.That(allCalculationResults[0].Pl3MinUplift.Value, Is.EqualTo(1.024).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, Is.EqualTo(49.100).Within(tolerance3Decimals)); @@ -131,11 +131,10 @@ RemoveCalculationDirectoriesForProject(cFolderName); List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.That(allCalculationResults[0].IsUplift.Value, Is.True); Assert.That(allCalculationResults[0].Pl3MinUplift.Value, Is.EqualTo(0.906).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3HeadAdjusted.Value, Is.EqualTo(-1.289).Within(tolerance3Decimals)); - Assert.That(allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, Is.EqualTo(49.100).Within(tolerance3Decimals)); - } + Assert.That(allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, Is.EqualTo(49.100).Within(tolerance3Decimals)); } /// /// Performs test BM04Opdrijven03 situation with a labile equilibirum 1D @@ -149,7 +148,7 @@ RemoveCalculationDirectoriesForProject(cFolderName); List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.That(allCalculationResults[0].IsUplift.Value, Is.True); Assert.That(allCalculationResults[0].Pl3MinUplift.Value, Is.EqualTo(1.000).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3HeadAdjusted.Value, Is.EqualTo(-1.289).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, Is.EqualTo(49.100).Within(tolerance3Decimals)); @@ -167,7 +166,7 @@ RemoveCalculationDirectoriesForProject(cFolderName); List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.That(allCalculationResults[0].IsUplift.Value, Is.True); Assert.That(allCalculationResults[0].Pl3MinUplift.Value, Is.EqualTo(0.969).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3HeadAdjusted.Value, Is.EqualTo(-1.638).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3LocalLocationXMinUplift.Value, Is.EqualTo(49.100).Within(tolerance3Decimals)); @@ -186,7 +185,7 @@ List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.Bishop, 1); bool? isUplift = allCalculationResults[0].IsUplift; - Assert.IsFalse(isUplift != null && isUplift.Value); + Assert.That(isUplift, Is.False); Assert.That(allCalculationResults[0].Pl3MinUplift, Is.EqualTo(null)); Assert.That(allCalculationResults[0].Pl3LocalLocationXMinUplift, Is.EqualTo(null)); } @@ -203,7 +202,7 @@ RemoveCalculationDirectoriesForProject(cFolderName); List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.That(allCalculationResults[0].IsUplift.Value, Is.True); // Values at bottom ditch dikeside Assert.That(allCalculationResults[0].Pl3MinUplift.Value, Is.EqualTo(0.820).Within(tolerance3Decimals)); Assert.That(allCalculationResults[0].Pl3HeadAdjusted.Value, Is.EqualTo(-1.289).Within(tolerance3Decimals)); @@ -308,7 +307,7 @@ List allCalculationResults = ComputeStabilityInsideProject(cFolderName, MStabModelType.UpliftVan, 1); RemoveCalculationDirectoriesForProject(cFolderName); - Assert.IsTrue(allCalculationResults[0].IsUplift.Value); + Assert.That(allCalculationResults[0].IsUplift.Value, Is.True); Assert.That(allCalculationResults[0].StabilitySafetyFactor.Value, Is.EqualTo(0.767).Within(tolerance3Decimals)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/GeometryFileTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/GeometryFileTest.cs (.../GeometryFileTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/GeometryFileTest.cs (.../GeometryFileTest.cs) (revision 4638) @@ -78,17 +78,17 @@ public void FileReturnsFalseIfNotExists() { var file = new MockFile(string.Empty, "test.tst"); - Assert.IsFalse(file.Exists); + Assert.That(file.Exists, Is.False); file = new MockFile("test.tst"); - Assert.IsFalse(file.Exists); + Assert.That(file.Exists, Is.False); } [Test] public void FileReturnsTrueIfFileExists() { var file = new MockFile(existingFile); - Assert.IsTrue(file.Exists); + Assert.That(file.Exists, Is.True); } [Test] @@ -112,7 +112,7 @@ { string location = Directory.GetCurrentDirectory(); var file = new MockFile(location, existingFile); - Assert.IsTrue(file.IsValid); + Assert.That(file.IsValid, Is.True); } #region Mock Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Domain/CoverageFunctionTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Domain/CoverageFunctionTest.cs (.../CoverageFunctionTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Domain/CoverageFunctionTest.cs (.../CoverageFunctionTest.cs) (revision 4638) @@ -103,11 +103,11 @@ Func func = rep.GetCoverageFunc(); var actual = (string) func(attribute.ToUpper(), 1, 1); - Assert.IsNotNull(actual); + Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); actual = (string) func(attribute.ToLower(), 1, 1); - Assert.IsNotNull(actual); + Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); mocks.ReplayAll(); @@ -220,7 +220,6 @@ Func func = repository.GetCoverageFunc(); var actual = (double) func(attribute, 0, 0); - Assert.IsNotNull(actual); Assert.That(actual, Is.EqualTo(expected).Within(0.0001)); } @@ -256,7 +255,7 @@ Func func = repository.GetCoverageFunc(); var actual = (string) func(attribute, 0, 0); - Assert.IsNotNull(actual); + Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); } @@ -289,15 +288,12 @@ Func func = repository.GetCoverageFunc(); var actual = (double) func(attribute, 1, 1); - Assert.IsNotNull(actual); Assert.That(actual, Is.EqualTo(expected)); actual = (double) func(attribute, 1, 2); - Assert.IsNotNull(actual); Assert.That(actual, Is.EqualTo(expected)); actual = (double) func(attribute, 1, 1.5); - Assert.IsNotNull(actual); Assert.That(actual, Is.EqualTo(expected)); } @@ -332,7 +328,6 @@ Func func = repository.GetCoverageFunc(attribute); var actual = (double) func(0, 0); - Assert.IsNotNull(actual); Assert.That(actual, Is.EqualTo(expected).Within(0.0001)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginDataSourceXmlSerializerTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginDataSourceXmlSerializerTests.cs (.../DataPluginDataSourceXmlSerializerTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginDataSourceXmlSerializerTests.cs (.../DataPluginDataSourceXmlSerializerTests.cs) (revision 4638) @@ -69,8 +69,8 @@ Assert.That(dataSourceContainerDest.DataSourceList.Count, Is.EqualTo(dataSourceContainerSrc.DataSourceList.Count)); Assert.That(dataSourceContainerDest.DataSourceList[0].DataSourceType, Is.EqualTo(dataSourceContainerSrc.DataSourceList[0].DataSourceType)); Assert.That(dataSourceContainerDest.DataSourceList[0].DataLocation, Is.EqualTo(dataSourceContainerSrc.DataSourceList[0].DataLocation)); - Assert.IsNotNull(dataSourceContainerDest.DataAttributes); - Assert.IsTrue(dataSourceContainerDest.DataAttributes.Count == 1); + Assert.That(dataSourceContainerDest.DataAttributes, Is.Not.Null); + Assert.That(dataSourceContainerDest.DataAttributes.Count, Is.EqualTo(1)); Assert.That(dataSourceContainerDest.DataAttributes.ElementAt(0).AttributeName, Is.EqualTo(dataSourceContainerSrc.DataAttributes.ElementAt(0).AttributeName)); } @@ -83,10 +83,7 @@ { AttributeName = attributeName }); - Assert.IsTrue(DataSourceContainer.Validate(container, new[] - { - attributeName - }).Count() == 0); + Assert.That(DataSourceContainer.Validate(container, new[] { attributeName }).Count(), Is.EqualTo(0)); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Specifications.Tests/SpecifcationTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Specifications.Tests/SpecifcationTest.cs (.../SpecifcationTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Specifications.Tests/SpecifcationTest.cs (.../SpecifcationTest.cs) (revision 4638) @@ -78,12 +78,12 @@ // just test to see if id equals 3. The model id is 2 so // the rule will not be satisfied var modelId = new ModelUniqueIdSpecification(3); - Assert.IsFalse(modelId.IsSatisfiedBy(m)); + Assert.That(modelId.IsSatisfiedBy(m), Is.False); // Changing the id to 3 and re-evaluate the rule // Now it will be satisfied by the candidate m.Id = 3; - Assert.IsTrue(modelId.IsSatisfiedBy(m)); + Assert.That(modelId.IsSatisfiedBy(m), Is.True); } /// @@ -115,7 +115,7 @@ Layer[] validLayers = c.Layers.GetBySpecification(new LayerHasValidTopBottomValues()).ToArray(); - Assert.IsTrue(validLayers != null && validLayers.Length == 2); + Assert.That(validLayers, Has.Length.EqualTo(2)); // Change the state of the first layer and test again for validation validLayers[0].Top = 1; @@ -138,7 +138,7 @@ // GammaWet hase spec Minimum 20 and GammaDry has spec Maximum -1 IEnumerable vr = s.Validate(); - Assert.IsTrue(vr != null && vr.Count() == 2); + Assert.That(vr, Is.Not.Null.And.Count.EqualTo(2)); } /// @@ -160,7 +160,7 @@ IEnumerable vr = l.Validate(); // check - Assert.IsTrue(vr.Any()); // <- should have at least one broken validation rule + Assert.That(vr, Is.Not.Null.And.Not.Empty); // <- should have at least one broken validation rule Assert.That((new LayerHasValidTopBottomValues()).Description, Is.EqualTo(vr.ElementAt(0).Text)); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeJobTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeJobTest.cs (.../DikeJobTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeJobTest.cs (.../DikeJobTest.cs) (revision 4638) @@ -60,7 +60,7 @@ { if (damJob.GetType() == typeof(DikeJob)) { - Assert.IsFalse(((DikeJob) damJob).AreAllLocationWaterLevelTimeSeriesAssigned(), "Check if all waterlevels not assigned"); + Assert.That(((DikeJob) damJob).AreAllLocationWaterLevelTimeSeriesAssigned(), Is.False, "Check if all waterlevels not assigned"); } } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/CombineImportedDataTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/CombineImportedDataTest.cs (.../CombineImportedDataTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/CombineImportedDataTest.cs (.../CombineImportedDataTest.cs) (revision 4638) @@ -161,7 +161,7 @@ // Check time needed to read TimeSpan maxTime = TimeSpan.FromSeconds(80); // This is the time on the buildserver; local time was 25 seconds - Assert.Less(elapsed, maxTime, "maximum time of {0} exceeded: {1}", maxTime, elapsed); + Assert.That(elapsed, Is.LessThan(maxTime), string.Format("maximum time of {0} exceeded: {1}", maxTime, elapsed)); } }); } @@ -219,13 +219,13 @@ // Check soil data Soil soil = damProjectData.WaterBoard.Dikes[0].SoilList.Soils.FirstOrDefault(s => s.Name == "CCC"); - Assert.IsTrue(soil != null); + Assert.That(soil, Is.Not.Null); Assert.That(soil.ShearStrengthModel, Is.EqualTo(ShearStrengthModel.StressTable)); Assert.That(soil.StressTable.Name, Is.EqualTo("CurveKlei")); // Check location specific data Location location = damProjectData.WaterBoard.Dikes[0].Locations.FirstOrDefault(s => s.Name.Equals("25-2-2-A-1-A")); - Assert.IsTrue(location != null); + Assert.That(location, Is.Not.Null); Assert.That(location.Name, Is.EqualTo("25-2-2-A-1-A")); //Assert.AreEqual("25-2-2-A-1-A", location.SurfaceLine.Name); //Assert.AreEqual("106", location.Segment.Name); @@ -265,8 +265,8 @@ 1.08, 1.45 }).AsCollection); - Assert.IsTrue(scenarios.All(sc => Math.Abs(sc.PolderLevel + 0.25) < tolerance)); - Assert.IsTrue(scenarios.All(sc => Math.Abs(sc.HeadPl2.Value - 0.8727) < tolerance)); + Assert.That(scenarios.All(sc => Math.Abs(sc.PolderLevel + 0.25) < tolerance), Is.True); + Assert.That(scenarios.All(sc => Math.Abs(sc.HeadPl2.Value - 0.8727) < tolerance), Is.True); } } @@ -276,7 +276,7 @@ SurfaceLine2 surfaceLine = CreateValidSurfaceLine(); var combineImportedData = new CombineImportedData(); bool doNotCoincide = combineImportedData.CheckCharacteristicPointsForCoincidingLocations(surfaceLine, out _, out _); - Assert.IsTrue(doNotCoincide); + Assert.That(doNotCoincide, Is.True); } [Test] @@ -287,7 +287,7 @@ CharacteristicPointType point1; CharacteristicPointType point2; bool doNotCoincide = combineImportedData.CheckCharacteristicPointsForCoincidingLocations(surfaceLine, out point1, out point2); - Assert.IsFalse(doNotCoincide); + Assert.That(doNotCoincide, Is.False); Assert.That(point1, Is.EqualTo(CharacteristicPointType.DikeTopAtPolder)); Assert.That(point2, Is.EqualTo(CharacteristicPointType.ShoulderBaseInside)); } @@ -298,7 +298,7 @@ SurfaceLine2 surfaceLine = CreateValidSurfaceLineTrafficLoad(); var combineImportedData = new CombineImportedData(); bool doNotCoincide = combineImportedData.CheckCharacteristicPointsForCoincidingLocations(surfaceLine, out _, out _); - Assert.IsTrue(doNotCoincide); + Assert.That(doNotCoincide, Is.True); } [Test] @@ -308,10 +308,10 @@ var combineImportedData = new CombineImportedData(); combineImportedData.ErrorMessages.Clear(); bool doNotCoincide = combineImportedData.CheckOnCoincidingPoints(surfaceLine); - Assert.IsFalse(doNotCoincide); + Assert.That(doNotCoincide, Is.False); Assert.That(combineImportedData.ErrorMessages.Count, Is.EqualTo(1)); - Assert.IsTrue(combineImportedData.ErrorMessages[0].Message.Contains(CharacteristicPointType.DikeTopAtPolder.ToString())); - Assert.IsTrue(combineImportedData.ErrorMessages[0].Message.Contains(CharacteristicPointType.ShoulderBaseInside.ToString())); + Assert.That(combineImportedData.ErrorMessages[0].Message.Contains(CharacteristicPointType.DikeTopAtPolder.ToString()), Is.True); + Assert.That(combineImportedData.ErrorMessages[0].Message.Contains(CharacteristicPointType.ShoulderBaseInside.ToString()), Is.True); } private SurfaceLine2 CreateValidSurfaceLine() Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry.cs (.../Geometry.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry.cs (.../Geometry.cs) (revision 4638) @@ -35,7 +35,7 @@ public void CanCreateGeometryFormWkt() { var geom = Feature.Create(geomWktTestString); - Assert.IsNotNull(geom); + Assert.That(geom, Is.Not.Null); Assert.That(geom.WktFormat, Is.EqualTo(geomWktTestString)); } @@ -44,18 +44,17 @@ { const string geomWkt = "POINT (0 0)"; var geom = Feature.Create(geomWkt); - Assert.IsNotNull(geom); + Assert.That(geom, Is.Not.Null); Assert.That(geom.WktFormat, Is.EqualTo(geomWkt)); - Assert.IsInstanceOf(typeof(Point), geom.Geometry); + Assert.That(geom.Geometry, Is.InstanceOf()); } [Test] public void GeometryHasAnValidIdentity() { const string geomWkt = "POINT (0 0)"; var geom = Feature.Create(geomWkt); - Assert.IsNotNull(geom); - Assert.IsNotNull(geom.Id); + Assert.That(geom, Is.Not.Null); Assert.That(geom.Id, Is.Not.EqualTo(Guid.Empty)); } @@ -64,7 +63,7 @@ { const string geomWkt = "POINT (0 0)"; var geom = Feature.Create(geomWkt); - Assert.IsNotNull(geom); + Assert.That(geom, Is.Not.Null); const string testvalue = "testvalue"; geom.AddAttribute("test", testvalue); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry2DDataTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry2DDataTests.cs (.../Geometry2DDataTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry2DDataTests.cs (.../Geometry2DDataTests.cs) (revision 4638) @@ -57,11 +57,11 @@ }); Geometry2DLayer layerActual = geometry2DData.GetLayer(0); - Assert.IsTrue(geometry2DBoundaryLine0.Equals(layerActual.boundaryLine)); - Assert.IsFalse(layerActual.boundaryLine.Equals(new Geometry2DBoundaryLine())); + Assert.That(geometry2DBoundaryLine0.Equals(layerActual.boundaryLine), Is.True); + Assert.That(layerActual.boundaryLine.Equals(new Geometry2DBoundaryLine()), Is.False); layerActual = geometry2DData.GetLayer(1); - Assert.IsTrue(geometry2DBoundaryLine1.Equals(layerActual.boundaryLine)); + Assert.That(geometry2DBoundaryLine1.Equals(layerActual.boundaryLine), Is.True); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSeriesAssemblerTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSeriesAssemblerTest.cs (.../TimeSeriesAssemblerTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSeriesAssemblerTest.cs (.../TimeSeriesAssemblerTest.cs) (revision 4638) @@ -275,15 +275,15 @@ Assert.That(Double.Parse(headerElement.Element(tns + TimeSeriesAssembler.XmlMissValElementName).Value, CultureInfo.InvariantCulture), Is.EqualTo(109.17)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlLongNameElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlStationNameElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlUnitsElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlSourceOrganisationElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlSourceSystemElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlFileDescriptionElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlCreationDateElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlCreationTimeElementName)); - Assert.IsNull(headerElement.Element(tns + TimeSeriesAssembler.XmlRegionElementName)); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlLongNameElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlStationNameElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlUnitsElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlSourceOrganisationElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlSourceSystemElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlFileDescriptionElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlCreationDateElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlCreationTimeElementName), Is.Null); + Assert.That(headerElement.Element(tns + TimeSeriesAssembler.XmlRegionElementName), Is.Null); // Entries (1) entryElements = serieElements[1].Elements(tns + TimeSeriesAssembler.XmlEntryElementName).ToArray(); @@ -316,7 +316,7 @@ Assert.That(entryElements[5].AttributeAs(TimeSeriesAssembler.XmlFlagAttributeName), Is.EqualTo(2)); // Comment (1) - Assert.IsNull(serieElements[1].Element(tns + TimeSeriesAssembler.XMLCommentElementName)); + Assert.That(serieElements[1].Element(tns + TimeSeriesAssembler.XMLCommentElementName), Is.Null); } [Test] @@ -335,7 +335,7 @@ // Do the thing: create TimeSeries from XML element TimeSerieCollection timeSerieCollection = assembler.CreateDomainObject(testDoc); - Assert.IsNotNull(timeSerieCollection); + Assert.That(timeSerieCollection, Is.Not.Null); // TimeSeries itself Assert.That(timeSerieCollection.Version, Is.EqualTo("1.2"), "Version"); @@ -357,14 +357,14 @@ Assert.That(timeSerie.StartDateTime.ToString("yyyy-MM-dd HH:mm:ss"), Is.EqualTo("2009-06-17 08:00:00")); Assert.That(timeSerie.EndDateTime.ToString("yyyy-MM-dd HH:mm:ss"), Is.EqualTo("2009-06-18 08:00:00")); Assert.That(timeSerie.MissVal, Is.EqualTo(-999.0)); - Assert.IsNull(timeSerie.LongName); + Assert.That(timeSerie.LongName, Is.Null); Assert.That(timeSerie.StationName, Is.EqualTo("point 1")); Assert.That(timeSerie.Units, Is.EqualTo("m")); - Assert.IsNull(timeSerie.SourceOrganisation); - Assert.IsNull(timeSerie.SourceSystem); - Assert.IsNull(timeSerie.FileDescription); - Assert.IsNull(timeSerie.CreationDateTime); - Assert.IsNull(timeSerie.Region); + Assert.That(timeSerie.SourceOrganisation, Is.Null); + Assert.That(timeSerie.SourceSystem, Is.Null); + Assert.That(timeSerie.FileDescription, Is.Null); + Assert.That(timeSerie.CreationDateTime, Is.Null); + Assert.That(timeSerie.Region, Is.Null); // Number of entries Assert.That(timeSerie.Entries.Count, Is.EqualTo(25), "Number of entries"); @@ -374,7 +374,7 @@ Assert.That(timeSerie.Entries[0].Flag, Is.EqualTo(0)); // Comment - Assert.IsNull(timeSerie.Comment); + Assert.That(timeSerie.Comment, Is.Null); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/build/Test.targets =================================================================== diff -u -r4607 -r4638 --- DamClients/DamUI/trunk/src/build/Test.targets (.../Test.targets) (revision 4607) +++ DamClients/DamUI/trunk/src/build/Test.targets (.../Test.targets) (revision 4638) @@ -9,14 +9,12 @@ - 3.13.3 + 4.1.0 - 4.4.2 + 4.6.0 - - 17.5.0 - + 4.5.4 Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorTest.cs (.../SensorTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorTest.cs (.../SensorTest.cs) (revision 4638) @@ -38,7 +38,7 @@ bool actual = sensor.IsValid(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -51,7 +51,7 @@ bool actual = sensor.IsTransient(); // assert - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -67,7 +67,7 @@ bool actual = sensor.IsTransient(); // assert - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } /// @@ -111,7 +111,7 @@ Assert.That(sensor2.YRd, Is.EqualTo(sensor1.YRd)); foreach (PLLineType plLineType in sensor1.PLLineMappings) { - Assert.Contains(plLineType, sensor2.PLLineMappings); + Assert.That(sensor2.PLLineMappings, Contains.Item(plLineType)); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorImportFromExcelSheetTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorImportFromExcelSheetTest.cs (.../SensorImportFromExcelSheetTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/SensorImportFromExcelSheetTest.cs (.../SensorImportFromExcelSheetTest.cs) (revision 4638) @@ -46,7 +46,7 @@ const string sensorDataFileName = @"TestData\Sensors\Sensordata.xls"; const string excelFile = sensorDataFileName; - Assert.IsTrue(File.Exists(excelFile)); + Assert.That(File.Exists(excelFile), Is.True); var dike = new Dike(); dike.Locations.Add(new Location @@ -99,7 +99,7 @@ }).ToList(); foreach (Sensor sensor in sensorData.Sensors) { - Assert.IsTrue(sensorIds.Contains(sensor.ID), String.Format("Sensor Id {0} not part of expected list", sensor.ID)); + Assert.That(sensorIds.Contains(sensor.ID), Is.True, String.Format("Sensor Id {0} not part of expected list", sensor.ID)); } Assert.That(sensorData.SourceTypePl1PlLineOffsetBelowDikeTopAtPolder, Is.EqualTo(DataSourceTypeSensors.Ignore)); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Domain/FeatureTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Domain/FeatureTest.cs (.../FeatureTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Maps.Tests/Domain/FeatureTest.cs (.../FeatureTest.cs) (revision 4638) @@ -37,13 +37,13 @@ { const string geometryWkt = "POINT (0.1 0.2)"; feature = Feature.Create(geometryWkt); - Assert.IsNotNull(feature); + Assert.That(feature, Is.Not.Null); Assert.That(feature.WktFormat, Is.EqualTo(geometryWkt)); feature = Feature.Create(geometryWkt); - Assert.IsNotNull(feature); + Assert.That(feature, Is.Not.Null); Assert.That(feature.WktFormat, Is.EqualTo(geometryWkt)); - Assert.IsInstanceOf(typeof(Point), feature.Geometry); + Assert.That(feature.Geometry, Is.InstanceOf()); } [Test] @@ -79,9 +79,9 @@ { const string geometryWkt = "MULTIPOINT (0.0 0.1,0.2 0.3)"; feature = Feature.Create(geometryWkt); - Assert.IsNotNull(feature); + Assert.That(feature, Is.Not.Null); Assert.That(feature.WktFormat, Is.EqualTo(geometryWkt)); - Assert.IsInstanceOf(typeof(MultiPoint), feature.Geometry); + Assert.That(feature.Geometry, Is.InstanceOf()); }; CultureHelper.InvokeWithDutchCulture(test); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CoordinateSystemConverterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CoordinateSystemConverterTest.cs (.../CoordinateSystemConverterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CoordinateSystemConverterTest.cs (.../CoordinateSystemConverterTest.cs) (revision 4638) @@ -48,15 +48,15 @@ // Convert to global GeometryPoint firstPoint = surfaceLine.Geometry.Points[0]; coordinateSystemConverter.ConvertGlobalXYZToLocalXZ(firstPoint); - Assert.IsTrue(firstPoint.LocationEquals(new GeometryPoint(0.0000, 0.0000, 0.0000)), "First point not converted correctly to local"); + Assert.That(firstPoint.LocationEquals(new GeometryPoint(0.0000, 0.0000, 0.0000)), Is.True, "First point not converted correctly to local"); GeometryPoint lastPoint = surfaceLine.Geometry.Points[surfaceLine.Geometry.Count - 1]; coordinateSystemConverter.ConvertGlobalXYZToLocalXZ(lastPoint); - Assert.IsTrue(lastPoint.LocationEquals(new GeometryPoint(111.8034, 0.0000, 10.0000)), "Last point not converted correctly to local"); + Assert.That(lastPoint.LocationEquals(new GeometryPoint(111.8034, 0.0000, 10.0000)), Is.True, "Last point not converted correctly to local"); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(firstPoint); - Assert.IsTrue(firstPoint.LocationEquals(referenceSurfaceline.Geometry.Points[0]), "First point not converted correctly to global"); + Assert.That(firstPoint.LocationEquals(referenceSurfaceline.Geometry.Points[0]), Is.True, "First point not converted correctly to global"); coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(lastPoint); - Assert.IsTrue(lastPoint.LocationEquals(referenceSurfaceline.Geometry.Points[referenceSurfaceline.Geometry.Count - 1]), "Last point not converted correctly to global"); + Assert.That(lastPoint.LocationEquals(referenceSurfaceline.Geometry.Points[referenceSurfaceline.Geometry.Count - 1]), Is.True, "Last point not converted correctly to global"); } } @@ -97,7 +97,7 @@ CheckResultingLocalSurfaceLine(surfaceLine); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(surfaceLine.Geometry); - Assert.IsTrue(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry)); + Assert.That(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry), Is.True); } } @@ -113,7 +113,7 @@ CheckResultingLocalSurfaceLine(surfaceLine); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(surfaceLine.Geometry); - Assert.IsTrue(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry)); + Assert.That(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry), Is.True); } } @@ -129,7 +129,7 @@ CheckResultingLocalSurfaceLine(surfaceLine); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(surfaceLine.Geometry); - Assert.IsTrue(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry)); + Assert.That(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry), Is.True); } } @@ -145,7 +145,7 @@ CheckResultingLocalSurfaceLine(surfaceLine); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(surfaceLine.Geometry); - Assert.IsTrue(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry)); + Assert.That(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry), Is.True); } } @@ -161,7 +161,7 @@ CheckResultingLocalSurfaceLine(surfaceLine); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(surfaceLine.Geometry); - Assert.IsTrue(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry)); + Assert.That(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry), Is.True); } } @@ -177,7 +177,7 @@ CheckResultingLocalSurfaceLine(surfaceLine); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(surfaceLine.Geometry); - Assert.IsTrue(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry)); + Assert.That(expectedGlobalSurfaceLine.Geometry.Equals(surfaceLine.Geometry), Is.True); } } @@ -193,7 +193,7 @@ CheckResultingLocalPL1Line(pl1Line); // Convert to local coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(pl1Line); - Assert.IsTrue(expectedGlobalPL1Line.Equals(pl1Line)); + Assert.That(expectedGlobalPL1Line.Equals(pl1Line), Is.True); } /// @@ -344,14 +344,14 @@ { using (SurfaceLine2 expectedLocalSurfaceLine = CreateResultingLocalSurfaceLine()) { - Assert.IsTrue(expectedLocalSurfaceLine.Geometry.Equals(localSurfaceLine.Geometry)); + Assert.That(expectedLocalSurfaceLine.Geometry.Equals(localSurfaceLine.Geometry), Is.True); } } private void CheckResultingLocalPL1Line(PL1Line localPL1Line) { PL1Line expectedLocalPL1Line = CreateResultingLocalPL1Line(); - Assert.IsTrue(expectedLocalPL1Line.Equals(localPL1Line)); + Assert.That(expectedLocalPL1Line.Equals(localPL1Line), Is.True); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvExporterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvExporterTest.cs (.../CsvExporterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvExporterTest.cs (.../CsvExporterTest.cs) (revision 4638) @@ -74,7 +74,7 @@ using (StreamReader reader = File.OpenText(FileName)) { string fileContent = reader.ReadToEnd(); - Assert.IsFalse(fileContent.Contains((writtenContent))); + Assert.That(fileContent.Contains(writtenContent), Is.False); } } @@ -124,7 +124,7 @@ using (StreamReader reader = File.OpenText(FileName)) { string fileContent = reader.ReadToEnd(); - Assert.IsTrue(fileContent.Contains("ID;Naam")); + Assert.That(fileContent.Contains("ID;Naam"), Is.True); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/ExportTextFileTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/ExportTextFileTest.cs (.../ExportTextFileTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/ExportTextFileTest.cs (.../ExportTextFileTest.cs) (revision 4638) @@ -40,7 +40,7 @@ }; exporter.Export(); - Assert.IsTrue(File.Exists("testfile.txt")); + Assert.That(File.Exists("testfile.txt"), Is.True); Assert.That(File.ReadAllText("testfile.txt"), Is.EqualTo(testData)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/GroupTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/GroupTest.cs (.../GroupTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Sensors/GroupTest.cs (.../GroupTest.cs) (revision 4638) @@ -72,8 +72,7 @@ //Assert.AreEqual(group2.Selection.Count(), group2.SensorRelativeLocations.Count()); foreach (Sensor sensor in group1.Selection) { - Assert.IsTrue(group2.Selection.Any( - s => s.Name == sensor.Name && s.ID == sensor.ID && s.Depth.AlmostEquals(sensor.Depth))); + Assert.That(group2.Selection.Any(s => s.Name == sensor.Name && s.ID == sensor.ID && s.Depth.AlmostEquals(sensor.Depth)), Is.True); //Assert.IsTrue(group2.SensorRelativeLocations.Any(s => s.Key == sensor)); } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterCsvTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterCsvTests.cs (.../DataPluginImporterCsvTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterCsvTests.cs (.../DataPluginImporterCsvTests.cs) (revision 4638) @@ -80,7 +80,7 @@ Assert.That(locationInfo.Name, Is.EqualTo(location18_6Id)); IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, location18_6Id); - Assert.IsTrue(locationDetails.Any()); + Assert.That(locationDetails.Any(), Is.True); Assert.That(locationDetails.FirstOrDefault(x => x.ParameterName.Equals("SurfaceLineId")).ParameterValue, Is.EqualTo("dijkring10_dwp18_6")); Assert.That(locationDetails.FirstOrDefault(x => x.ParameterName.Equals("SegmentId")).ParameterValue, Is.EqualTo("segment_dijkring10_dwp18_6")); Assert.That(locationDetails.FirstOrDefault(x => x.ParameterName.Equals("XRd")).ParameterValue, Is.EqualTo("192584.1")); @@ -124,7 +124,7 @@ // Check begin- and endpoint of 1 surfaceline IList surfaceLinePoints = dataPluginImporter.GetSurfaceLinePoints(dikeRingId, surfaceline40_0Id); - Assert.IsTrue(surfaceLinePoints.Count() > 0); + Assert.That(surfaceLinePoints.Count(), Is.GreaterThan(0)); Assert.That(surfaceLinePoints[0].X, Is.EqualTo(0.0).Within(cToleranceCoordinate)); Assert.That(surfaceLinePoints[0].Y, Is.EqualTo(0.0).Within(cToleranceCoordinate)); Assert.That(surfaceLinePoints[0].Z, Is.EqualTo(-0.48).Within(cToleranceCoordinate)); @@ -136,15 +136,15 @@ // Check specific characteristic points of 1 surfaceline IEnumerable surfaceLineCharacteristicPoints = dataPluginImporter.GetSurfaceLineCharacteristicPoints(dikeRingId, surfaceline40_0Id); Assert.That(surfaceLineIdList.Count(), Is.EqualTo(13)); - Assert.IsTrue(surfaceLineCharacteristicPoints.Count() > 0); + Assert.That(surfaceLineCharacteristicPoints.Count(), Is.GreaterThan(0)); DpCharacteristicPoint pointSurfaceLevelOutside = surfaceLineCharacteristicPoints.Where(x => x.Id.Equals("SurfaceLevelInside")).FirstOrDefault(); Assert.That(pointSurfaceLevelOutside.X, Is.EqualTo(71.25).Within(cToleranceCoordinate)); Assert.That(pointSurfaceLevelOutside.Y, Is.EqualTo(0.0).Within(cToleranceCoordinate)); Assert.That(pointSurfaceLevelOutside.Z, Is.EqualTo(-0.36).Within(cToleranceCoordinate)); DpCharacteristicPoint pointDitchPolderSide = surfaceLineCharacteristicPoints.Where(x => x.Id.Equals("DitchPolderSide")).FirstOrDefault(); - Assert.IsNull(pointDitchPolderSide.Id); + Assert.That(pointDitchPolderSide.Id, Is.Null); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Importers/LocationPropertyImporterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Importers/LocationPropertyImporterTest.cs (.../LocationPropertyImporterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Importers/LocationPropertyImporterTest.cs (.../LocationPropertyImporterTest.cs) (revision 4638) @@ -60,8 +60,8 @@ [Test] public void IsPropertyAttribute_UsingLocationID_ReturnsFalse() { - Assert.IsFalse(LocationShapeFileAttributeMap.IsPropertyAttribute(LocationShapeFileAttributeMap.LocationAttributeId)); - Assert.IsFalse(LocationShapeFileAttributeMap.IsPropertyAttribute("Location_Id")); + Assert.That(LocationShapeFileAttributeMap.IsPropertyAttribute(LocationShapeFileAttributeMap.LocationAttributeId), Is.False); + Assert.That(LocationShapeFileAttributeMap.IsPropertyAttribute("Location_Id"), Is.False); } [Test] @@ -558,7 +558,7 @@ mockImporter.RegisterAttributeMapping(LocationShapeFileAttributeMap.PenetrationLengthAttributeId); mockImporter.Import(null); - Assert.IsTrue(mockImporter.ImportErrors.OfType().Count() == 1, "The error list should contain an AttributeMissingException"); + Assert.That(mockImporter.ImportErrors.OfType().Count() == 1, Is.True, "The error list should contain an AttributeMissingException"); mocks.VerifyAll(); } @@ -642,7 +642,7 @@ mockImporter.RegisterCrossSectionAttribute(crossSectionMapping.Name, crossSectionMapping.File); mockImporter.Import(null); - Assert.IsTrue(mockImporter.ImportErrors.OfType().Count() == 1, "The error list should contain an AttributeMissingException"); + Assert.That(mockImporter.ImportErrors.OfType().Count(), Is.EqualTo(1), "The error list should contain an AttributeMissingException"); mocks.VerifyAll(); } @@ -692,7 +692,7 @@ throw importer.ImportErrors.OfType().First(); } - Assert.IsTrue(importer.ImportErrors.OfType().Count() == 1); + Assert.That(importer.ImportErrors.OfType().Count(), Is.EqualTo(1)); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/GaugePLLineTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/GaugePLLineTest.cs (.../GaugePLLineTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/GaugePLLineTest.cs (.../GaugePLLineTest.cs) (revision 4638) @@ -38,7 +38,7 @@ { var gaugePLLine = new GaugePLLine(PLLineType.PL1); - Assert.IsNotNull(gaugePLLine); + Assert.That(gaugePLLine, Is.Not.Null); } [Test] @@ -68,7 +68,7 @@ Assert.That(gaugePLLine.PLLineType, Is.EqualTo(PLLineType.PL3)); Assert.That(gaugePLLine.Points.Count, Is.EqualTo(2)); - Assert.IsTrue(gaugePLLine.Points[1].LocationEquals(gaugePLLine.Points[0], 0.0001)); + Assert.That(gaugePLLine.Points[1].LocationEquals(gaugePLLine.Points[0], 0.0001), Is.True); Assert.That(gaugePLLine.Points[0].GaugeIDX, Is.EqualTo(gauge1.Name)); Assert.That(gaugePLLine.Points[0].GaugeIDZ, Is.EqualTo(gauge2.Name)); Assert.That(gaugePLLine.Points[1].GaugeIDX, Is.EqualTo(gauge3.Name)); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs (.../FillXmlInputFromDamUiTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs (.../FillXmlInputFromDamUiTests.cs) (revision 4638) @@ -192,10 +192,10 @@ })); DamEngine.Io.XmlInput.Segment segmentWith1DProfile = input.Segments.Single(s => string.Equals(s.Name, selectedSegmentOneName)); - Assert.IsTrue(segmentWith1DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile1D))); + Assert.That(segmentWith1DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile1D)), Is.True); DamEngine.Io.XmlInput.Segment segmentWith2DProfile = input.Segments.Single(s => string.Equals(s.Name, selectedSegmentTwoName)); - Assert.IsTrue(segmentWith2DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D))); + Assert.That(segmentWith2DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D)), Is.True); Assert.That(input.SoilProfiles1D.Select(profile => profile.Name), Is.EquivalentTo(new[] { @@ -290,7 +290,7 @@ IEnumerable segmentWith2DProfile = input.Segments.Where(s => string.Equals(s.Name, selectedSegmentOneName) || string.Equals(s.Name, selectedSegmentTwoName)); IEnumerable probabilities = segmentWith2DProfile.SelectMany(p => p.SoilGeometryProbability); - Assert.IsTrue(probabilities.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D))); + Assert.That(probabilities.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D)), Is.True); Assert.That(input.SoilProfiles2D.Select(profile => profile.Name), Is.EquivalentTo(new[] { @@ -367,7 +367,7 @@ IEnumerable segmentWith2DProfile = input.Segments.Where(s => string.Equals(s.Name, selectedSegmentOneName) || string.Equals(s.Name, selectedSegmentTwoName)); IEnumerable probabilities = segmentWith2DProfile.SelectMany(p => p.SoilGeometryProbability); - Assert.IsTrue(probabilities.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D))); + Assert.That(probabilities.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D)), Is.True); Assert.That(input.SoilProfiles2D.Select(profile => profile.Name), Is.EquivalentTo(new[] { @@ -463,7 +463,7 @@ })); DamEngine.Io.XmlInput.Segment segmentWith2DProfile = input.Segments.Single(s => string.Equals(s.Name, selectedSegmentOneName)); - Assert.IsTrue(segmentWith2DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D))); + Assert.That(segmentWith2DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D)), Is.True); Assert.That(LogManager.Messages, Has.Count.EqualTo(1)); Assert.That(LogManager.Messages[0].Message, @@ -556,7 +556,7 @@ })); DamEngine.Io.XmlInput.Segment segmentWith2DProfile = input.Segments.Single(s => string.Equals(s.Name, selectedSegmentOneName)); - Assert.IsTrue(segmentWith2DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D))); + Assert.That(segmentWith2DProfile.SoilGeometryProbability.All(prob => prob.SoilProfileType == ConversionHelper.ConvertToInputSoilProfileType(SoilProfileType.SoilProfile2D)), Is.True); Assert.That(LogManager.Messages, Has.Count.EqualTo(2)); Assert.That(LogManager.Messages[0].Message, @@ -677,26 +677,26 @@ foreach (Soil actualSoil in actualSoilList.Soils) { Soil expectedSoil = expectedSoilList.GetSoilByName(actualSoil.Name); - Assert.IsTrue(actualSoil.AbovePhreaticLevel.Equals(expectedSoil.AbovePhreaticLevel), string.Format(errorMessage, "AbovePhreaticLevel")); - Assert.IsTrue(actualSoil.BelowPhreaticLevel.Equals(expectedSoil.BelowPhreaticLevel), string.Format(errorMessage, "BelowPhreaticLevel")); - Assert.IsTrue(actualSoil.DryUnitWeight.Equals(expectedSoil.DryUnitWeight), string.Format(errorMessage, "DryUnitWeight")); - Assert.IsTrue(actualSoil.BeddingAngle.Equals(expectedSoil.BeddingAngle), string.Format(errorMessage, "BeddingAngle")); - Assert.IsTrue(actualSoil.DiameterD70.Equals(expectedSoil.DiameterD70), string.Format(errorMessage, "DiameterD70")); - Assert.IsTrue(actualSoil.DiameterD70.Equals(expectedSoil.DiameterD70), string.Format(errorMessage, "DiameterD70")); - Assert.IsTrue(actualSoil.DiameterD90.Equals(expectedSoil.DiameterD90), string.Format(errorMessage, "DiameterD90")); - Assert.IsTrue(actualSoil.DiameterD90.Equals(expectedSoil.DiameterD90), string.Format(errorMessage, "DiameterD90")); - Assert.IsTrue(actualSoil.PermeabKx.Equals(expectedSoil.PermeabKx), string.Format(errorMessage, "PermeabKx")); - Assert.IsTrue(actualSoil.WhitesConstant.Equals(expectedSoil.WhitesConstant), string.Format(errorMessage, "WhitesConstant")); - Assert.IsTrue(actualSoil.ShearStrengthModel.Equals(expectedSoil.ShearStrengthModel), string.Format(errorMessage, "ShearStrengthModel")); - Assert.IsTrue(actualSoil.UseDefaultShearStrengthModel.Equals(expectedSoil.UseDefaultShearStrengthModel), string.Format(errorMessage, "UseDefaultShearStrengthModel")); - Assert.IsTrue(actualSoil.Cohesion.Equals(expectedSoil.Cohesion), string.Format(errorMessage, "Cohesion")); - Assert.IsTrue(actualSoil.FrictionAngle.Equals(expectedSoil.FrictionAngle), string.Format(errorMessage, "FrictionAngle")); - Assert.IsTrue(actualSoil.OCR.Equals(expectedSoil.OCR), string.Format(errorMessage, "OCR")); - Assert.IsTrue(actualSoil.RestSlope.Equals(expectedSoil.RestSlope), string.Format(errorMessage, "RestSlope")); - Assert.IsTrue(actualSoil.DilatancyType.Equals(expectedSoil.DilatancyType), string.Format(errorMessage, "DilatancyType")); - Assert.IsTrue(actualSoil.StrengthIncreaseExponent.Equals(expectedSoil.StrengthIncreaseExponent), string.Format(errorMessage, "StrengthIncreaseExponent")); - Assert.IsTrue(actualSoil.RRatio.Equals(expectedSoil.RRatio), string.Format(errorMessage, "RRatio")); - Assert.IsTrue(actualSoil.RatioCuPc.Equals(expectedSoil.RatioCuPc), string.Format(errorMessage, "RatioCuPc")); + Assert.That(actualSoil.AbovePhreaticLevel.Equals(expectedSoil.AbovePhreaticLevel), Is.True, string.Format(errorMessage, "AbovePhreaticLevel")); + Assert.That(actualSoil.BelowPhreaticLevel.Equals(expectedSoil.BelowPhreaticLevel), Is.True, string.Format(errorMessage, "BelowPhreaticLevel")); + Assert.That(actualSoil.DryUnitWeight.Equals(expectedSoil.DryUnitWeight), Is.True, string.Format(errorMessage, "DryUnitWeight")); + Assert.That(actualSoil.BeddingAngle.Equals(expectedSoil.BeddingAngle), Is.True, string.Format(errorMessage, "BeddingAngle")); + Assert.That(actualSoil.DiameterD70.Equals(expectedSoil.DiameterD70), Is.True, string.Format(errorMessage, "DiameterD70")); + Assert.That(actualSoil.DiameterD70.Equals(expectedSoil.DiameterD70), Is.True, string.Format(errorMessage, "DiameterD70")); + Assert.That(actualSoil.DiameterD90.Equals(expectedSoil.DiameterD90), Is.True, string.Format(errorMessage, "DiameterD90")); + Assert.That(actualSoil.DiameterD90.Equals(expectedSoil.DiameterD90), Is.True, string.Format(errorMessage, "DiameterD90")); + Assert.That(actualSoil.PermeabKx.Equals(expectedSoil.PermeabKx), Is.True, string.Format(errorMessage, "PermeabKx")); + Assert.That(actualSoil.WhitesConstant.Equals(expectedSoil.WhitesConstant), Is.True, string.Format(errorMessage, "WhitesConstant")); + Assert.That(actualSoil.ShearStrengthModel.Equals(expectedSoil.ShearStrengthModel), Is.True, string.Format(errorMessage, "ShearStrengthModel")); + Assert.That(actualSoil.UseDefaultShearStrengthModel.Equals(expectedSoil.UseDefaultShearStrengthModel), Is.True, string.Format(errorMessage, "UseDefaultShearStrengthModel")); + Assert.That(actualSoil.Cohesion.Equals(expectedSoil.Cohesion), string.Format(errorMessage, "Cohesion")); + Assert.That(actualSoil.FrictionAngle.Equals(expectedSoil.FrictionAngle), Is.True, string.Format(errorMessage, "FrictionAngle")); + Assert.That(actualSoil.OCR.Equals(expectedSoil.OCR), Is.True, string.Format(errorMessage, "OCR")); + Assert.That(actualSoil.RestSlope.Equals(expectedSoil.RestSlope), Is.True, string.Format(errorMessage, "RestSlope")); + Assert.That(actualSoil.DilatancyType.Equals(expectedSoil.DilatancyType), Is.True, string.Format(errorMessage, "DilatancyType")); + Assert.That(actualSoil.StrengthIncreaseExponent.Equals(expectedSoil.StrengthIncreaseExponent), Is.True, string.Format(errorMessage, "StrengthIncreaseExponent")); + Assert.That(actualSoil.RRatio.Equals(expectedSoil.RRatio), Is.True, string.Format(errorMessage, "RRatio")); + Assert.That(actualSoil.RatioCuPc.Equals(expectedSoil.RatioCuPc), Is.True, string.Format(errorMessage, "RatioCuPc")); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/FailureMechanismeParamatersMStabXmlHandlerTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/FailureMechanismeParamatersMStabXmlHandlerTest.cs (.../FailureMechanismeParamatersMStabXmlHandlerTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/IO/FailureMechanismeParamatersMStabXmlHandlerTest.cs (.../FailureMechanismeParamatersMStabXmlHandlerTest.cs) (revision 4638) @@ -48,7 +48,7 @@ bool result = target.CanHandle(typeof(FailureMechanismeParamatersMStab), propertyName); // assert - Assert.IsTrue(result); + Assert.That(result, Is.True); } [Test] @@ -61,7 +61,7 @@ bool result = target.CanHandle(type, property); // assert - Assert.IsFalse(result); + Assert.That(result, Is.False); } [Test] @@ -90,7 +90,7 @@ target.HandleObject(failureMechanism, new SoilProfile()); // assert - Assert.IsTrue(canHandle); + Assert.That(canHandle, Is.True); Assert.That(failureMechanism.SurfaceLine, Is.EqualTo(surfaceLine2)); } @@ -102,15 +102,15 @@ string locationSurfaceLineProperty = failureMechanism.GetMemberName(x => x.SurfaceLine); var surfaceLine = new SurfaceLine(); - Assert.IsNull(failureMechanism.SurfaceLine); + Assert.That(failureMechanism.SurfaceLine, Is.Null); // call bool canHandle = target.CanHandle(failureMechanism.GetType(), locationSurfaceLineProperty); target.HandleObject(failureMechanism, surfaceLine); // assert - Assert.IsTrue(canHandle); - Assert.NotNull(failureMechanism.SurfaceLine); + Assert.That(canHandle, Is.True); + Assert.That(failureMechanism.SurfaceLine, Is.Not.Null); } } } \ No newline at end of file Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvExportCharacteristicPointsTest.cs =================================================================== diff -u -r4539 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvExportCharacteristicPointsTest.cs (.../CsvExportCharacteristicPointsTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/CsvExportCharacteristicPointsTest.cs (.../CsvExportCharacteristicPointsTest.cs) (revision 4638) @@ -82,7 +82,7 @@ GeometryPoint point = orgSurfaceLine.CharacteristicPoints.GetGeometryPoint(characteristicPoint.Type); if (point != null) { - Assert.IsTrue(point.LocationEquals(new GeometryPoint(characteristicPoint.X, characteristicPoint.Y, characteristicPoint.Z)), String.Format("Characteristic point '{0}' not equal", characteristicPoint.Type.ToString())); + Assert.That(point.LocationEquals(new GeometryPoint(characteristicPoint.X, characteristicPoint.Y, characteristicPoint.Z)), Is.True, String.Format("Characteristic point '{0}' not equal", characteristicPoint.Type.ToString())); } } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeCoordinateSystemConverterTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeCoordinateSystemConverterTest.cs (.../DikeCoordinateSystemConverterTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DikeCoordinateSystemConverterTest.cs (.../DikeCoordinateSystemConverterTest.cs) (revision 4638) @@ -190,8 +190,8 @@ Assert.That(localSurfaceLine.Geometry.Points.Count, Is.EqualTo(expectedLocalSurfaceLine.Geometry.Count), String.Format("Surfaceline line {0}", localSurfaceLine.Name)); for (var pointIndex = 0; pointIndex < localSurfaceLine.Geometry.Points.Count; pointIndex++) { - Assert.IsTrue(localSurfaceLine.Geometry.Points[pointIndex].LocationEquals(expectedLocalSurfaceLine.Geometry.Points[pointIndex]), - String.Format("Surfaceline {0} GeometryPoint {1} converted incorrectly", localSurfaceLine.Name, pointIndex)); + Assert.That(localSurfaceLine.Geometry.Points[pointIndex].LocationEquals(expectedLocalSurfaceLine.Geometry.Points[pointIndex]), + Is.True, String.Format("Surfaceline {0} GeometryPoint {1} converted incorrectly", localSurfaceLine.Name, pointIndex)); } } } @@ -206,8 +206,8 @@ Assert.That(localPL1Line.Points.Count, Is.EqualTo(expectedLocalPL1Line.Points.Count), String.Format("PL1 line {0}", localPL1Line.Name)); for (var pointIndex = 0; pointIndex < localPL1Line.Points.Count; pointIndex++) { - Assert.IsTrue(localPL1Line.Points[pointIndex].LocationEquals(expectedLocalPL1Line.Points[pointIndex]), - String.Format("PL1 line {0} GeometryPoint {1} converted incorrectly", localPL1Line.Name, pointIndex)); + Assert.That(localPL1Line.Points[pointIndex].LocationEquals(expectedLocalPL1Line.Points[pointIndex]), + Is.True, String.Format("PL1 line {0} GeometryPoint {1} converted incorrectly", localPL1Line.Name, pointIndex)); } } Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardImporterTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardImporterTests.cs (.../WaterBoardImporterTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/WaterBoardImporterTests.cs (.../WaterBoardImporterTests.cs) (revision 4638) @@ -76,23 +76,23 @@ Segment segment = waterBoard.Segments.First(x => x.Name.Equals(segmentId)); Assert.That(segment.SoilProfileProbabilities[0].SoilGeometryName, Is.EqualTo("10Y_024_STBI.sti")); Assert.That(segment.SoilProfileProbabilities[0].Probability, Is.EqualTo(100.0).Within(cTolerance)); - Assert.IsTrue(segment.SoilProfileProbabilities[0].SegmentFailureMechanismType - .Equals(FailureMechanismSystemType.StabilityInside)); + Assert.That(segment.SoilProfileProbabilities[0].SegmentFailureMechanismType + .Equals(FailureMechanismSystemType.StabilityInside), Is.True); // Check segment with stability and piping segment = waterBoard.Segments.FirstOrDefault(x => x.Name.Equals("segment_dijkring10_dwp02_4")); Assert.That(segment.SoilProfileProbabilities[0].SoilGeometryName, Is.EqualTo("10Y_024_STBI.sti")); Assert.That(segment.SoilProfileProbabilities[0].Probability, Is.EqualTo(100.0).Within(cTolerance)); - Assert.IsTrue(segment.SoilProfileProbabilities[0].SegmentFailureMechanismType - .Equals(FailureMechanismSystemType.StabilityInside)); + Assert.That(segment.SoilProfileProbabilities[0].SegmentFailureMechanismType + .Equals(FailureMechanismSystemType.StabilityInside), Is.True); Assert.That(segment.SoilProfileProbabilities[1].SoilGeometryName, Is.EqualTo("10Y_024_STBI.sti")); Assert.That(segment.SoilProfileProbabilities[1].Probability, Is.EqualTo(100.0).Within(cTolerance)); - Assert.IsTrue(segment.SoilProfileProbabilities[1].SegmentFailureMechanismType - .Equals(FailureMechanismSystemType.Piping)); + Assert.That(segment.SoilProfileProbabilities[1].SegmentFailureMechanismType + .Equals(FailureMechanismSystemType.Piping), Is.True); // Check surfacelines Assert.That(dike.SurfaceLines2.Count, Is.EqualTo(13)); SurfaceLine2 surfaceline = dike.SurfaceLines2.First(x => x.Name.Equals(surfacelineId)); - Assert.IsTrue(surfaceline.Geometry.Points.Any()); + Assert.That(surfaceline.Geometry.Points.Any(), Is.True); Assert.That(surfaceline.Geometry.Points[0].X, Is.EqualTo(0.0).Within(cToleranceCoordinate)); Assert.That(surfaceline.Geometry.Points[0].Y, Is.EqualTo(0.0).Within(cToleranceCoordinate)); Assert.That(surfaceline.Geometry.Points[0].Z, Is.EqualTo(-0.48).Within(cToleranceCoordinate)); @@ -165,8 +165,8 @@ Segment segment = waterBoard.Segments.First(x => x.Name.Equals("106")); Assert.That(segment.SoilProfileProbabilities[0].SoilGeometryName, Is.EqualTo("25_2_1_bz_1")); Assert.That(segment.SoilProfileProbabilities[0].Probability, Is.EqualTo(35.0).Within(cTolerance)); - Assert.IsTrue(segment.SoilProfileProbabilities[0].SegmentFailureMechanismType - .Equals(FailureMechanismSystemType.StabilityInside)); + Assert.That(segment.SoilProfileProbabilities[0].SegmentFailureMechanismType + .Equals(FailureMechanismSystemType.StabilityInside), Is.True); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSerieCollectionTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSerieCollectionTest.cs (.../TimeSerieCollectionTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TimeSerieCollectionTest.cs (.../TimeSerieCollectionTest.cs) (revision 4638) @@ -89,29 +89,29 @@ public void TestCannotFindSeries() { TimeSerie timeSerie = timeSerieCollection.FindSerie("Bird speed", "LOC-36"); - Assert.IsNull(timeSerie, "Series found incorrectly"); + Assert.That(timeSerie, Is.Null, "Series found incorrectly"); } [Test] public void TestFindSeries() { TimeSerie timeSerie = timeSerieCollection.FindSerie("Cat speed", "LOC-04"); - Assert.IsTrue(timeSerie.ParameterId.Equals("Cat speed", StringComparison.InvariantCultureIgnoreCase)); - Assert.IsTrue(timeSerie.LocationId.Equals("LOC-04", StringComparison.InvariantCultureIgnoreCase)); + Assert.That(timeSerie.ParameterId.Equals("Cat speed", StringComparison.InvariantCultureIgnoreCase), Is.True); + Assert.That(timeSerie.LocationId.Equals("LOC-04", StringComparison.InvariantCultureIgnoreCase), Is.True); Assert.That(timeSerieCollection.Series.IndexOf(timeSerie), Is.EqualTo(0)); timeSerie = timeSerieCollection.FindSerie("Dog speed", "LOC-27"); - Assert.IsTrue(timeSerie.ParameterId.Equals("Dog speed", StringComparison.InvariantCultureIgnoreCase)); - Assert.IsTrue(timeSerie.LocationId.Equals("LOC-27", StringComparison.InvariantCultureIgnoreCase)); + Assert.That(timeSerie.ParameterId.Equals("Dog speed", StringComparison.InvariantCultureIgnoreCase), Is.True); + Assert.That(timeSerie.LocationId.Equals("LOC-27", StringComparison.InvariantCultureIgnoreCase), Is.True); Assert.That(timeSerieCollection.Series.IndexOf(timeSerie), Is.EqualTo(3)); timeSerie = timeSerieCollection.FindSerie("OvertoppingRate", "LOC-27"); - Assert.IsTrue(timeSerie.ParameterId.Equals("OvertoppingRate", StringComparison.InvariantCultureIgnoreCase)); - Assert.IsTrue(timeSerie.LocationId.Equals("LOC-27", StringComparison.InvariantCultureIgnoreCase)); + Assert.That(timeSerie.ParameterId.Equals("OvertoppingRate", StringComparison.InvariantCultureIgnoreCase), Is.True); + Assert.That(timeSerie.LocationId.Equals("LOC-27", StringComparison.InvariantCultureIgnoreCase), Is.True); } [Test] Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.TestHelper/TestUtils/ObjectLeakMonitorTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.TestHelper/TestUtils/ObjectLeakMonitorTest.cs (.../ObjectLeakMonitorTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.TestHelper/TestUtils/ObjectLeakMonitorTest.cs (.../ObjectLeakMonitorTest.cs) (revision 4638) @@ -40,7 +40,7 @@ // assert var text = objectToMonitor.ToString(); // To ensure it stays in scope - Assert.IsTrue(isAlive, text); + Assert.That(isAlive, Is.True, text); } [Test] @@ -67,7 +67,7 @@ bool isAlive = monitor.ObjectIsAlive(); // assert - Assert.IsFalse(isAlive); + Assert.That(isAlive, Is.False); } private ObjectLeakMonitor CreateObjectAndAssignToObjectLeakMonitor() Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillDamUiFromXmlOutputTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillDamUiFromXmlOutputTests.cs (.../FillDamUiFromXmlOutputTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillDamUiFromXmlOutputTests.cs (.../FillDamUiFromXmlOutputTests.cs) (revision 4638) @@ -103,7 +103,7 @@ actualDamProjectData.DamProjectCalculationSpecification.CurrentSpecification = new DamFailureMechanismeCalculationSpecification(); actualDamProjectData = FillDamUiFromXmlOutput.AddOutputToDamProjectData(actualDamProjectData, output); - Assert.IsFalse(string.IsNullOrEmpty(actualDamProjectData.DesignCalculations.First().BaseFileName), + Assert.That(string.IsNullOrEmpty(actualDamProjectData.DesignCalculations.First().BaseFileName), Is.False, "BaseFileName should be reset"); } @@ -162,7 +162,7 @@ Assert.That(actualDamProjectData.DesignCalculations[0].SafetyFactor, Is.EqualTo(combinedDamProjectData.DesignCalculations[0].SafetyFactor)); Assert.That(actualDamProjectData.DesignCalculations[0].LocationName, Is.EqualTo(combinedDamProjectData.DesignCalculations[0].LocationName)); Assert.That(actualDamProjectData.DesignCalculations[0].StabilityModel, Is.EqualTo(combinedDamProjectData.DesignCalculations[0].StabilityModel)); - Assert.IsNotNull(actualDamProjectData.DesignCalculations[0].RedesignedSurfaceLine2); + Assert.That(actualDamProjectData.DesignCalculations[0].RedesignedSurfaceLine2, Is.Not.Null); } [Test] @@ -218,7 +218,7 @@ Assert.That(actualDamProjectData.DesignCalculations[0].CalculationResult, Is.EqualTo(combinedDamProjectData.DesignCalculations[0].CalculationResult)); Assert.That(actualDamProjectData.DesignCalculations[0].SafetyFactor, Is.EqualTo(combinedDamProjectData.DesignCalculations[0].SafetyFactor)); Assert.That(actualDamProjectData.DesignCalculations[0].LocationName, Is.EqualTo(combinedDamProjectData.DesignCalculations[0].LocationName)); - Assert.IsNotNull(actualDamProjectData.DesignCalculations[0].RedesignedSurfaceLine2); + Assert.That(actualDamProjectData.DesignCalculations[0].RedesignedSurfaceLine2, Is.Not.Null); } private static DamProjectData CreateDamProjectDataWithCalculationMessages() Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Forms/DamContextTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Forms/DamContextTest.cs (.../DamContextTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Forms/DamContextTest.cs (.../DamContextTest.cs) (revision 4638) @@ -41,7 +41,7 @@ IEnumerable filter = context.GetColumnNamedFilters(typeof(object)); // Assert - Assert.IsNull(filter); + Assert.That(filter, Is.Null); } [Test] @@ -88,7 +88,7 @@ IList filteredColumnNames = context.GetFilteredColumns(argumentType, filterValue); // Assert - Assert.IsNull(filteredColumnNames); + Assert.That(filteredColumnNames, Is.Null); } private static IEnumerable GetFilterOptions() Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterDataShapeFilesTests.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterDataShapeFilesTests.cs (.../DataPluginImporterDataShapeFilesTests.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DataPluginImporterDataShapeFilesTests.cs (.../DataPluginImporterDataShapeFilesTests.cs) (revision 4638) @@ -61,7 +61,7 @@ IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, Location275Id); NameValueParameter[] nameValueParameters = locationDetails as NameValueParameter[] ?? locationDetails.ToArray(); - Assert.IsTrue(nameValueParameters.Count() > 0); + Assert.That(nameValueParameters.Count(), Is.GreaterThan(0)); Assert.That(nameValueParameters.FirstOrDefault(x => x.ParameterName.Equals("TrafficLoad")).ParameterValue, Is.EqualTo("13")); } @@ -75,7 +75,7 @@ IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, Location275Id); NameValueParameter[] nameValueParameters = locationDetails as NameValueParameter[] ?? locationDetails.ToArray(); - Assert.IsTrue(nameValueParameters.Count() > 0); + Assert.That(nameValueParameters.Count(), Is.GreaterThan(0)); Assert.That(nameValueParameters.FirstOrDefault(x => x.ParameterName.Equals("TL_DegreeOfConsolidation")).ParameterValue, Is.EqualTo("0.123")); } @@ -89,7 +89,7 @@ IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, Location1Id); NameValueParameter[] nameValueParameters = locationDetails as NameValueParameter[] ?? locationDetails.ToArray(); - Assert.IsTrue(nameValueParameters.Count() > 0); + Assert.That(nameValueParameters.Count(), Is.GreaterThan(0)); Assert.That(nameValueParameters.FirstOrDefault(x => x.ParameterName.Equals("TL_DegreeOfConsolidation")).ParameterValue, Is.EqualTo("0.33")); locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, Location22Id); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/ScenarioTest.cs =================================================================== diff -u -r4625 -r4638 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/ScenarioTest.cs (.../ScenarioTest.cs) (revision 4625) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/ScenarioTest.cs (.../ScenarioTest.cs) (revision 4638) @@ -39,11 +39,11 @@ var scenario = new Scenario(); // Assert - Assert.IsInstanceOf(scenario); - Assert.IsInstanceOf(scenario); + Assert.That(scenario, Is.InstanceOf()); + Assert.That(scenario, Is.InstanceOf()); Assert.That(scenario.PolderLevel, Is.EqualTo(0)); - Assert.IsNull(scenario.HeadPl2); + Assert.That(scenario.HeadPl2, Is.Null); } [Test] @@ -61,7 +61,7 @@ // Then const string variableName = "PolderLevel"; - Assert.IsTrue(pairs.ContainsKey(variableName)); + Assert.That(pairs.ContainsKey(variableName), Is.True); string pairValue = pairs[variableName]; var expectedValue = scenario.PolderLevel.ToString(new NumberFormatInfo { @@ -103,14 +103,14 @@ }; // Precondition - Assert.IsNotNull(scenario.HeadPl2); + Assert.That(scenario.HeadPl2, Is.Not.Null); // When Dictionary pairs = scenario.GetParametersAsNameValuePairs(); // Then const string variableName = "HeadPL2"; - Assert.IsTrue(pairs.ContainsKey(variableName)); + Assert.That(pairs.ContainsKey(variableName), Is.True); string pairValue = pairs[variableName]; var expectedValue = scenario.HeadPl2.Value.ToString(new NumberFormatInfo { @@ -126,13 +126,13 @@ var scenario = new Scenario(); // Precondition - Assert.IsNull(scenario.HeadPl2); + Assert.That(scenario.HeadPl2, Is.Null); // When Dictionary pairs = scenario.GetParametersAsNameValuePairs(); // Then - Assert.IsFalse(pairs.ContainsKey("HeadPl2")); + Assert.That(pairs.ContainsKey("HeadPl2"), Is.False); } [Test] @@ -151,7 +151,7 @@ var scenario = new Scenario(); // Precondition - Assert.IsNull(scenario.HeadPl2); + Assert.That(scenario.HeadPl2, Is.Null); // Call scenario.SetParameterFromNameValuePair(headPL2Name, stringValue);