mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 12:49:35 -10:00
- 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
26 lines
943 B
C#
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"));
|
|
}
|
|
}
|
|
}
|