BootstrapAdmin11/Bootstrap.DataAccessTests/ExceptionHelperTests.cs

27 lines
746 B
C#
Raw Normal View History

2016-11-10 16:39:07 +08:00
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Specialized;
namespace Bootstrap.DataAccess.Tests
{
[TestClass()]
public class ExceptionHelperTests
{
[TestMethod()]
public void LogTest()
{
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);
}
2016-11-10 16:39:07 +08:00
}
}
}