public void CreateConfigFileTest() { if (File.Exists(Setting.SettingFilePath)) { File.Delete(Setting.SettingFilePath); } //設定ファイル保存 Setting.Save("http://proxy.com:8080", "user", "password", new[] { "aa.com", "bb.cc.com" }); Assert.IsTrue(File.Exists(Setting.SettingFilePath)); //設定ファイル再読み込み Setting.Clear(); Setting.Reload(); Assert.AreEqual(2, Setting.SettingVersion); Assert.AreEqual("http://proxy.com:8080", Setting.ProxyServer); Assert.AreEqual("user", Setting.ProxyUser); Assert.AreEqual("password", Setting.ProxyPassword); Assert.AreEqual("aa.com", Setting.ProxyBypassList[0]); Assert.AreEqual("bb.cc.com", Setting.ProxyBypassList[1]); StringAssert.Contains(Setting.SettingFilePath, "relayCredentialsSetting.xml"); var w = new AuthProxyModule(); }
public void ProxyBypassTest() { Setting.Clear(); Setting.Reload(); var proxy = new AuthProxyModule(); Assert.IsTrue(proxy.IsBypassed(new Uri("http://aa.com"))); Assert.IsTrue(proxy.IsBypassed(new Uri("http://bb.cc.com"))); Assert.IsFalse(proxy.IsBypassed(new Uri("http://zz.aa.com"))); Assert.IsFalse(proxy.IsBypassed(new Uri("http://cc.com"))); Assert.IsFalse(proxy.IsBypassed(new Uri("http://ee.cc.com"))); }
public void XmlにBypassListなし() { Setting.Clear(); Setting.Reload(); Assert.AreEqual("http://proxy.com:8080", Setting.ProxyServer); Assert.AreEqual("user", Setting.ProxyUser); Assert.AreEqual("password", Setting.ProxyPassword); Assert.IsNull(Setting.ProxyBypassList); var proxy = new AuthProxyModule(); Assert.IsFalse(proxy.IsBypassed(new Uri("http://aa.com"))); }