From bee2917e9fd7e377ee762c3e3bba8ca1e399a13f Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Wed, 16 Nov 2016 22:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9AExceptionLog?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E4=B8=AD=E6=9C=89=E7=A9=BA=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AF=BC=E8=87=B4=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExceptionHelperTests.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Bootstrap.DataAccessTests/ExceptionHelperTests.cs b/Bootstrap.DataAccessTests/ExceptionHelperTests.cs index 722648c1..e9fe1bfb 100644 --- a/Bootstrap.DataAccessTests/ExceptionHelperTests.cs +++ b/Bootstrap.DataAccessTests/ExceptionHelperTests.cs @@ -10,11 +10,18 @@ namespace Bootstrap.DataAccess.Tests [TestMethod()] public void LogTest() { - var ex = new Exception("Just for Test"); - var nv = new NameValueCollection(); - nv.Add("ErrorPage", "UnitTest_Page"); - nv.Add("UserIp", "::1"); - ExceptionHelper.Log(ex, nv); + try + { + throw new Exception("Just for Test", new Exception("Inner Exception")); + } + catch (Exception ex) + { + var nv = new NameValueCollection(); + nv.Add("ErrorPage", "UnitTest_Page"); + nv.Add("UserIp", "::1"); + nv.Add("UserId", "UnitTest"); + ExceptionHelper.Log(ex, nv); + } } } } \ No newline at end of file