public void Create_WithWaternetsWithoutLines_ReturnsPersistableWaternetCollection() { // Setup var dailyWaternet = new MacroStabilityInwardsWaternet(new MacroStabilityInwardsPhreaticLine[0], new MacroStabilityInwardsWaternetLine[0]); var extremeWaternet = new MacroStabilityInwardsWaternet(new MacroStabilityInwardsPhreaticLine[0], new MacroStabilityInwardsWaternetLine[0]); var idFactory = new IdFactory(); var registry = new MacroStabilityInwardsExportRegistry(); // Call IEnumerable <PersistableWaternet> persistableWaternets = PersistableWaternetFactory.Create(dailyWaternet, extremeWaternet, new GeneralMacroStabilityInwardsInput(), idFactory, registry); // Assert PersistableDataModelTestHelper.AssertWaternets(new[] { dailyWaternet, extremeWaternet }, persistableWaternets); var stages = new[] { MacroStabilityInwardsExportStageType.Daily, MacroStabilityInwardsExportStageType.Extreme }; Assert.AreEqual(2, registry.Waternets.Count); for (var i = 0; i < stages.Length; i++) { Assert.AreEqual(registry.Waternets[stages[i]], persistableWaternets.ElementAt(i).Id); } }
public void Create_ExtremeWaternetNull_ThrowsArgumentNullException() { // Call void Call() => PersistableWaternetFactory.Create(new MacroStabilityInwardsWaternet(new MacroStabilityInwardsPhreaticLine[0], new MacroStabilityInwardsWaternetLine[0]), null, new GeneralMacroStabilityInwardsInput(), new IdFactory(), new MacroStabilityInwardsExportRegistry()); // Assert var exception = Assert.Throws <ArgumentNullException>(Call); Assert.AreEqual("extremeWaternet", exception.ParamName); }
public void Create_RegistryNull_ThrowsArgumentNullException() { // Setup var waternet = new MacroStabilityInwardsWaternet(new MacroStabilityInwardsPhreaticLine[0], new MacroStabilityInwardsWaternetLine[0]); // Call void Call() => PersistableWaternetFactory.Create(waternet, waternet, new GeneralMacroStabilityInwardsInput(), new IdFactory(), null); // Assert var exception = Assert.Throws <ArgumentNullException>(Call); Assert.AreEqual("registry", exception.ParamName); }