public void Utf8Test(string path) { UTF8Encoding encoding = new UTF8Encoding(false, true); Assert.True(Curl.Initialize()); using (Curl curl = new Curl()) { Assert.Equal(File.ReadAllText(path, encoding), curl.GetText(new Uri(Path.GetFullPath(path)).AbsoluteUri, encoding)); } Curl.Deinitialize(); }
public void Ucs2BeBomTest(string path) { UnicodeEncoding encoding = new UnicodeEncoding(true, true, true); Assert.True(Curl.Initialize()); using (Curl curl = new Curl()) { curl.UseBom = true; Assert.Equal(File.ReadAllText(path, encoding), curl.GetText(new Uri(Path.GetFullPath(path)).AbsoluteUri, encoding)); } Curl.Deinitialize(); }
public void InvalidEncodingTest(string path) { UTF8Encoding encoding = new UTF8Encoding(false, true); Assert.True(Curl.Initialize()); Assert.Throws <DecoderFallbackException>(() => { using (Curl curl = new Curl()) { curl.GetText(new Uri(Path.GetFullPath(path)).AbsoluteUri, encoding); } }); Curl.Deinitialize(); }
public void Dispose() { Curl.Deinitialize(); }
public void InitializeTest() { Assert.True(Curl.Initialize()); Curl.Deinitialize(); }