public void Constructor_ExpectedValues() { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationEmptyCalculation.xml"); // Call var reader = new StabilityStoneCoverWaveConditionsCalculationConfigurationReader(filePath); // Assert Assert.IsInstanceOf <WaveConditionsCalculationConfigurationReader <StabilityStoneCoverWaveConditionsCalculationConfiguration> >(reader); }
public void Read_ValidConfigurationWithFullCalculation_ReturnExpectedReadWaveConditionsCalculation() { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationFullCalculation.xml"); var reader = new StabilityStoneCoverWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable <IConfigurationItem> readItems = reader.Read().ToArray(); // Assert var configuration = (StabilityStoneCoverWaveConditionsCalculationConfiguration)readItems.Single(); AssertConfiguration(configuration); Assert.AreEqual(0.1, configuration.TargetProbability); }
public void Read_ValidPreviousVersionConfigurationWithFullCalculation_ReturnExpectedReadCalculation(int versionNumber) { // Setup string filePath = Path.Combine(testDirectoryPath, $"version{versionNumber}ValidConfigurationFullCalculation.xml"); var reader = new StabilityStoneCoverWaveConditionsCalculationConfigurationReader(filePath); // Call IEnumerable <IConfigurationItem> readConfigurationItems = reader.Read().ToArray(); // Assert var configuration = (StabilityStoneCoverWaveConditionsCalculationConfiguration)readConfigurationItems.Single(); AssertConfiguration(configuration); Assert.IsNull(configuration.TargetProbability); }