Commit 5861be21 authored by Chris Baudin's avatar Chris Baudin
Browse files

Update ETW API tests to validate the contents of the EtwProviders object. (Issue #31)

parent b4d29f0a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
// </copyright>
//----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
@@ -101,8 +102,11 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests.Core
        /// <param name="etw">The <see cref="EtwProviders"/> to validate.</param>
        private static void ValidateEtwProviders(EtwProviders etw)
        {
            EtwProviderInfo providerInfo = etw?.Providers?.FirstOrDefault();
            Assert.IsNotNull(providerInfo);
            Guid result;
            Assert.IsTrue(etw.Providers.Count > 0);
            Assert.IsTrue(etw.Providers.All(etwProvider => 
                Guid.TryParse(etwProvider.GUID, out result) &&
                !string.IsNullOrEmpty(etwProvider.Name)));
        }
    }
}
+1 −1
Original line number Diff line number Diff line
{ "Providers": [ { "GUID": "ProviderGUID", "Name": "ProviderName" } ] }
 No newline at end of file
{"Providers" : [{"GUID" : "3A43D90E-530E-41E5-A897-B555516070E2", "Name" : "Provider.One"},{"GUID" : "52B1715B-5AB6-4B48-A61A-A93EE8D4B5CD", "Name" : "Provider-Two"},{"GUID" : "698F02FF-2B63-4CBB-AB06-FEB88011347E", "Name" : "Provider.Three"}]}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
{ "Providers": [ { "GUID": "ProviderGUID", "Name": "ProviderName" } ] }
 No newline at end of file
{"Providers" : [{"GUID" : "3A43D90E-530E-41E5-A897-B555516070E2", "Name" : "Provider.One"},{"GUID" : "52B1715B-5AB6-4B48-A61A-A93EE8D4B5CD", "Name" : "Provider-Two"},{"GUID" : "698F02FF-2B63-4CBB-AB06-FEB88011347E", "Name" : "Provider.Three"}]}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// <summary>
        /// ETW Provider Info. Contains the Name and GUID.
        /// </summary>
        [DataContract]
        public class EtwProviderInfo
        {
            /// <summary>