Files
dotnet-runtime/src/libraries/System.Net.WebSockets.Client/tests/LoggingTest.cs
T
Stephen Toub 7b2a531875 Add additional System.Net tracing tests
- Add tests that actually exercise the event sources, making sure that no event source errors are produced and that events are actually generated.
- Fix a few src issues found from these tests.


Commit migrated from https://github.com/dotnet/corefx/commit/2284f735df7ad8c072b7861980d205c4476709b8
2016-10-29 11:53:54 -04:00

26 lines
943 B
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics.Tracing;
using System.Reflection;
using Xunit;
namespace System.Net.WebSockets.Tests
{
public class LoggingTest
{
[Fact]
public void EventSource_ExistsWithCorrectId()
{
Type esType = typeof(ClientWebSocket).GetTypeInfo().Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false);
Assert.NotNull(esType);
Assert.Equal("Microsoft-System-Net-WebSockets-Client", EventSource.GetName(esType));
Assert.Equal(Guid.Parse("71cddde3-cf58-52d5-094f-927828a09337"), EventSource.GetGuid(esType));
Assert.NotEmpty(EventSource.GenerateManifest(esType, "assemblyPathToIncludeInManifest"));
}
}
}