GetEncoding() public method

Gets the encoding (null if Detect) specified by the configuration.
public GetEncoding ( ) : Encoding
return System.Text.Encoding
        public void GetEncodingInvalidFormatTest()
        {
            EncodingConfiguration config = new EncodingConfiguration();
            config.CodePage = "SFDS";

            config.GetEncoding();
        }
        public void GetEncodingTest()
        {
            EncodingConfiguration config = new EncodingConfiguration();
            Encoding encoding = null;

            config.CodePage = "Default";
            encoding = config.GetEncoding();
            Assert.AreEqual(Encoding.Default.CodePage, encoding.CodePage, "Unexpected codepage.");
            config.CodePage = "default";
            encoding = config.GetEncoding();
            Assert.AreEqual(Encoding.Default.CodePage, encoding.CodePage, "Unexpected codepage.");

            config.CodePage = "65001";
            encoding = config.GetEncoding();
            Assert.AreEqual(65001, encoding.CodePage, "Unexpected codepage.");

            config.CodePage = "Detect";
            encoding = config.GetEncoding();
            Assert.IsNull(encoding, "Unexpected encoding.");
            config.CodePage = "detect";
            encoding = config.GetEncoding();
            Assert.IsNull(encoding, "Unexpected encoding.");
        }