1
0
Форкнуть 0
This commit is contained in:
Anastasia Baranchenkova 2015-04-28 11:17:43 -07:00
Родитель a99ab52b0e
Коммит db90a5c26a
2 изменённых файлов: 15 добавлений и 16 удалений

Просмотреть файл

@ -1,4 +1,6 @@
using Microsoft.ApplicationInsights.DataContracts;
namespace Microsoft.ApplicationInsights.AspNet.Tests.Helpers
{
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Core;
@ -6,8 +8,6 @@ using Microsoft.AspNet.Mvc;
using Microsoft.Framework.DependencyInjection;
using System;
namespace Microsoft.ApplicationInsights.AspNet.Tests.Helpers
{
public static class HttpContextAccessorHelper
{
public static HttpContextAccessor CreateHttpContextAccessor(RequestTelemetry requestTelemetry = null, ActionContext actionContext = null)

Просмотреть файл

@ -4,11 +4,10 @@
using Microsoft.ApplicationInsights.AspNet.Tests.Helpers;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Core;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Routing;
using Microsoft.Framework.DependencyInjection;
using Microsoft.AspNet.Routing;
using System;
using Xunit;
@ -84,7 +83,7 @@
public void InitializeSetsTelemetryOperationNameToControllerFromActionContext()
{
var actionContext = new ActionContext();
actionContext.RouteData = new Microsoft.AspNet.Routing.RouteData();
actionContext.RouteData = new RouteData();
actionContext.RouteData.Values.Add("controller", "home");
var contextAccessor = HttpContextAccessorHelper.CreateHttpContextAccessor(new RequestTelemetry(), actionContext);
@ -101,7 +100,7 @@
public void InitializeSetsTelemetryOperationNameToControllerAndActionFromActionContext()
{
var actionContext = new ActionContext();
actionContext.RouteData = new Microsoft.AspNet.Routing.RouteData();
actionContext.RouteData = new RouteData();
actionContext.RouteData.Values.Add("controller", "account");
actionContext.RouteData.Values.Add("action", "login");
@ -119,7 +118,7 @@
public void InitializeSetsTelemetryOperationNameToControllerAndActionAndParameterFromActionContext()
{
var actionContext = new ActionContext();
actionContext.RouteData = new Microsoft.AspNet.Routing.RouteData();
actionContext.RouteData = new RouteData();
actionContext.RouteData.Values.Add("controller", "account");
actionContext.RouteData.Values.Add("action", "login");
actionContext.RouteData.Values.Add("parameter", "myName");
@ -138,7 +137,7 @@
public void InitializeSortsParameters()
{
var actionContext = new ActionContext();
actionContext.RouteData = new Microsoft.AspNet.Routing.RouteData();
actionContext.RouteData = new RouteData();
actionContext.RouteData.Values.Add("controller", "account");
actionContext.RouteData.Values.Add("action", "login");
actionContext.RouteData.Values.Add("parameterZ", "myName1");
@ -159,7 +158,7 @@
public void InitializeDoesNotIncludeRouteGroupKeyInParametersList()
{
var actionContext = new ActionContext();
actionContext.RouteData = new Microsoft.AspNet.Routing.RouteData();
actionContext.RouteData = new RouteData();
actionContext.RouteData.Values.Add("controller", "account");
actionContext.RouteData.Values.Add("action", "login");
actionContext.RouteData.Values.Add(AttributeRouting.RouteGroupKey, "RouteGroupKey");