public void ConvertTo_InvalidDestinationType_ThrowsNotSupportedException()
        {
            // Setup
            var random    = new Random(21);
            var converter = new ConfigurationDikeSoilScenarioTypeConverter();

            // Call
            TestDelegate call = () => converter.ConvertTo(random.NextEnumValue <ConfigurationDikeSoilScenario>(), typeof(object));

            // Assert
            Assert.Throws <NotSupportedException>(call);
        }
        public void ConvertTo_VariousCases_ReturnExpectedResult(ConfigurationDikeSoilScenario value,
                                                                object expectedResult)
        {
            // Setup
            var  converter     = new ConfigurationDikeSoilScenarioTypeConverter();
            Type convertToType = expectedResult.GetType();

            // Call
            object result = converter.ConvertTo(value, convertToType);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
        public void ConvertTo_InvalidConfigurationDikeSoilScenario_ThrowsInvalidEnumArgumentException(Type convertToType)
        {
            // Setup
            const ConfigurationDikeSoilScenario invalidValue = (ConfigurationDikeSoilScenario)9999;
            var converter = new ConfigurationDikeSoilScenarioTypeConverter();

            // Call
            TestDelegate call = () => converter.ConvertTo(invalidValue, convertToType);

            // Assert
            string expectedMessage = $"The value of argument 'value' ({invalidValue}) is invalid for Enum type '{nameof(ConfigurationDikeSoilScenario)}'.";
            string parameterName   = TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(call, expectedMessage).ParamName;

            Assert.AreEqual("value", parameterName);
        }