public void ConvertTo_ForAllEnumValues_ReturnExpectedText(ConfigurationStabilityPointStructuresLoadSchematizationType value,
                                                                  string expectedText)
        {
            // Setup
            var converter = new ConfigurationStabilityPointStructuresLoadSchematizationTypeConverter();

            // Call
            object result = converter.ConvertTo(null, CultureInfo.CurrentCulture, value, typeof(string));

            // Assert
            Assert.AreEqual(expectedText, result);
        }
        public void ConvertTo_InvalidType_ThrowNotSupportedException()
        {
            // Setup
            var random       = new Random(21);
            var invalidValue = random.NextEnumValue <ConfigurationStabilityPointStructuresLoadSchematizationType>();
            var converter    = new ConfigurationStabilityPointStructuresLoadSchematizationTypeConverter();

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

            // Assert
            Assert.Throws <NotSupportedException>(call);
        }
        public void ConvertTo_ConfigurationStabilityPointStructuresLoadSchematizationType_ThrowInvalidEnumArgumentException(Type destinationType)
        {
            // Setup
            var converter = new ConfigurationStabilityPointStructuresLoadSchematizationTypeConverter();
            const ConfigurationStabilityPointStructuresLoadSchematizationType invalidValue = (ConfigurationStabilityPointStructuresLoadSchematizationType)99999;

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

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

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