ApplicationSettingsTests.When_Getting_Mandatory_String_Value.And_value_is_null_Then_empty_value_should_be_returned C# (CSharp) Method

And_value_is_null_Then_empty_value_should_be_returned() private method

        public void And_value_is_null_Then_empty_value_should_be_returned()
        {
            // The functionality is the same as using standard Configuration/ConfigurationManager.
            // If the value="" part is missing then empty string is returned. It would make
            // sense that it would return null but that is not the case

            var settings = new AppSettings(SimpleConfig.AbsolutePathToConfigFile);

            var value = settings.GetValue(SimpleConfig.NullStringValue);

            Assert.AreEqual(string.Empty, value);
        }