public void GetProviderNames_AssertProperties()
        {
            const string Prefix = "win:";
            var          standardOpcodeNames = new List <string>(Enum.GetNames(typeof(StandardEventOpcode))).Select(x => Prefix + x).ToList();

            using (var session = new EventLogSession())
            {
                Assert.NotEmpty(session.GetProviderNames());
                foreach (string providerName in session.GetProviderNames())
                {
                    try
                    {
                        using (var providerMetadata = new ProviderMetadata(providerName))
                        {
                            foreach (var keyword in providerMetadata.Keywords)
                            {
                                Assert.NotEmpty(keyword.Name);
                            }
                            foreach (var logLink in providerMetadata.LogLinks)
                            {
                                Assert.NotEmpty(logLink.LogName);
                            }
                            foreach (var opcode in providerMetadata.Opcodes)
                            {
                                if (opcode != null && standardOpcodeNames.Contains(opcode.Name))
                                {
                                    Assert.Contains((((StandardEventOpcode)(opcode.Value)).ToString()), opcode.Name);
                                }
                            }
                            foreach (var eventMetadata in providerMetadata.Events)
                            {
                                EventLogLink logLink = eventMetadata.LogLink;
                                if (logLink != null)
                                {
                                    if (logLink.DisplayName != null && logLink.DisplayName.Equals("System"))
                                    {
                                        Assert.Equal("System", logLink.LogName);
                                        Assert.True(logLink.IsImported);
                                    }
                                }
                                EventLevel eventLevel = eventMetadata.Level;
                                if (eventLevel != null)
                                {
                                    if (eventLevel.Name != null)
                                    {
                                        // https://github.com/Microsoft/perfview/blob/d4b044abdfb4c8e40a344ca05383e04b5b6dc13a/src/related/EventRegister/winmeta.xml#L39
                                        if (eventLevel.Name.StartsWith(Prefix) && !eventLevel.Name.Contains("ReservedLevel"))
                                        {
                                            Assert.True(System.Enum.IsDefined(typeof(StandardEventLevel), eventLevel.Value));
                                            Assert.Contains(eventLevel.Name.Substring(4), Enum.GetNames(typeof(StandardEventLevel)));
                                        }
                                    }
                                }
                                EventOpcode opcode = eventMetadata.Opcode;
                                if (opcode != null)
                                {
                                    if (opcode.Name != null && opcode.DisplayName != null && opcode.DisplayName.ToLower().Equals("apprun"))
                                    {
                                        Assert.Contains(opcode.DisplayName.ToLower(), opcode.Name.ToLower());
                                    }
                                }
                                EventTask task = eventMetadata.Task;
                                if (task != null)
                                {
                                    Assert.NotEqual(task, eventMetadata.Task);
                                    Assert.Equal(task.DisplayName, eventMetadata.Task.DisplayName);
                                    Assert.Equal(task.Name, eventMetadata.Task.Name);
                                    Assert.Equal(task.Value, eventMetadata.Task.Value);
                                }
                                IEnumerable <EventKeyword> keywords = eventMetadata.Keywords;
                                if (eventMetadata.Keywords != null)
                                {
                                    foreach (var keyword in eventMetadata.Keywords)
                                    {
                                        if (keyword.Name != null && keyword.Name.StartsWith(Prefix))
                                        {
                                            Assert.True(System.Enum.IsDefined(typeof(StandardEventKeywords), keyword.Value));
                                        }
                                    }
                                }
                                Assert.NotNull(eventMetadata.Template);
                            }
                        }
                    }
                    catch (EventLogException)
                    {
                        continue;
                    }
                }
            }
        }