forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpConfigurationTracingExtensionsTest.cs
More file actions
27 lines (23 loc) · 1 KB
/
Copy pathHttpConfigurationTracingExtensionsTest.cs
File metadata and controls
27 lines (23 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Web.Http.Tracing;
using Microsoft.TestCommon;
namespace System.Web.Http.Test
{
public class HttpConfigurationTracingExtensionsTest
{
[Fact]
public void EnableSystemDiagnosticsTracing_Adds_TraceWriter()
{
HttpConfiguration config = new HttpConfiguration();
SystemDiagnosticsTraceWriter returnedTraceWriter = config.EnableSystemDiagnosticsTracing();
ITraceWriter setTraceWriter = config.Services.GetService(typeof(ITraceWriter)) as ITraceWriter;
Assert.ReferenceEquals(returnedTraceWriter, setTraceWriter);
}
[Fact]
public void EnableSystemDiagnosticsTracing_ThrowsIfNull()
{
Assert.ThrowsArgumentNull(() => HttpConfigurationTracingExtensions.EnableSystemDiagnosticsTracing(null), "configuration");
}
}
}