Exemple #1
0
        public void ConvertFromStringThrowsNotSupportedException()
        {
            // Arrange
            const string key = "convert me!";

            // Assert
            Assert.Throws <NotSupportedException>(
                () => ConfigurationUtility.ConvertFromString <NoConversionFromStringToThisClass>(key));
        }
Exemple #2
0
        public void ConvertFromStringConvertsToType <T>(T value)
        {
            // Arrange
            var valueString = value.ToString();

            // Act
            var result = ConfigurationUtility.ConvertFromString <T>(valueString);

            // Assert
            Assert.Equal(value, result);
        }