Commit 677f7a7f authored by justcoding121's avatar justcoding121

update tests

parent 2b205842
...@@ -19,7 +19,11 @@ namespace Titanium.Web.Proxy.UnitTests ...@@ -19,7 +19,11 @@ namespace Titanium.Web.Proxy.UnitTests
{ {
var tasks = new List<Task>(); var tasks = new List<Task>();
var mgr = new CertificateManager(new Lazy<Action<Exception>>(() => (e => { })).Value); var mgr = new CertificateManager(new Lazy<Action<Exception>>(() => (e =>
{
Console.WriteLine(e.ToString() + e.InnerException != null ? e.InnerException.ToString() : string.Empty);
})).Value);
mgr.CertificateEngine = CertificateEngine.BouncyCastle; mgr.CertificateEngine = CertificateEngine.BouncyCastle;
mgr.ClearIdleCertificates(); mgr.ClearIdleCertificates();
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
...@@ -27,8 +31,8 @@ namespace Titanium.Web.Proxy.UnitTests ...@@ -27,8 +31,8 @@ namespace Titanium.Web.Proxy.UnitTests
{ {
tasks.Add(Task.Run(() => tasks.Add(Task.Run(() =>
{ {
//get the connection //get the connection
var certificate = mgr.CreateCertificate(host, false); var certificate = mgr.CreateCertificate(host, false);
Assert.IsNotNull(certificate); Assert.IsNotNull(certificate);
})); }));
} }
...@@ -45,10 +49,14 @@ namespace Titanium.Web.Proxy.UnitTests ...@@ -45,10 +49,14 @@ namespace Titanium.Web.Proxy.UnitTests
{ {
var tasks = new List<Task>(); var tasks = new List<Task>();
var mgr = new CertificateManager(new Lazy<Action<Exception>>(() => (e => { })).Value); var mgr = new CertificateManager(new Lazy<Action<Exception>>(() => (e =>
{
Console.WriteLine(e.ToString() + e.InnerException != null ? e.InnerException.ToString() : string.Empty);
})).Value);
mgr.CertificateEngine = CertificateEngine.DefaultWindows; mgr.CertificateEngine = CertificateEngine.DefaultWindows;
mgr.CreateRootCertificate(true); mgr.CreateRootCertificate(true);
mgr.TrustRootCertificateAsAdmin(); mgr.TrustRootCertificate();
mgr.ClearIdleCertificates(); mgr.ClearIdleCertificates();
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
...@@ -56,8 +64,8 @@ namespace Titanium.Web.Proxy.UnitTests ...@@ -56,8 +64,8 @@ namespace Titanium.Web.Proxy.UnitTests
{ {
tasks.Add(Task.Run(() => tasks.Add(Task.Run(() =>
{ {
//get the connection //get the connection
var certificate = mgr.CreateCertificate(host, false); var certificate = mgr.CreateCertificate(host, false);
Assert.IsNotNull(certificate); Assert.IsNotNull(certificate);
})); }));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment