Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void GetSystemPerfWebSocketTest()
/// <param name="runningProcesses">The <see cref="RunningProcesses" /> to validate.</param>
private static void ValidateRunningProcessesAsync(RunningProcesses runningProcesses)
{
List<DeviceProcessInfo> processes = new List<DeviceProcessInfo>(runningProcesses.Processes);
List<DeviceProcessInfo> processes = runningProcesses.Processes;

// Check some known things about this response.
Assert.AreEqual(2, processes.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
Expand Down Expand Up @@ -589,7 +590,7 @@ public void GetHeadlessAppsListInfo_IoT()
HeadlessAppsListInfo appsList = getTask.Result;

// Check some known things about this response.
Assert.AreEqual(true, appsList.AppPackages[0].IsStartup);
Assert.AreEqual(true, appsList.AppPackages.First().IsStartup);
}

/// <summary>
Expand Down Expand Up @@ -771,7 +772,7 @@ public void GetIcsInterfacesInfo_IoT()
IscInterfacesInfo icsInterfaceInfo = getTask.Result;

// Check some known things about this response.
Assert.AreEqual("Broadcom 802.11n Wireless SDIO Adapter", icsInterfaceInfo.PrivateInterfaces[0]);
Assert.AreEqual("Broadcom 802.11n Wireless SDIO Adapter", icsInterfaceInfo.PrivateInterfaces.First());
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public void SetXboxLiveSandboxTest()
/// <param name="runningProcesses">The <see cref="RunningProcesses" /> to validate.</param>
private static void ValidateRunningProcessesAsync(RunningProcesses runningProcesses)
{
List<DeviceProcessInfo> processes = new List<DeviceProcessInfo>(runningProcesses.Processes);
List<DeviceProcessInfo> processes = runningProcesses.Processes;

// Check some known things about this response.
Assert.AreEqual(75, processes.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public class RunningProcesses
/// Gets list of running processes.
/// </summary>
[DataMember(Name = "Processes")]
public DeviceProcessInfo[] Processes { get; private set; }
public List<DeviceProcessInfo> Processes { get; private set; }

/// <summary>
/// Checks to see if this process Id is in the list of processes
Expand All @@ -423,18 +423,14 @@ public bool Contains(int processId)
{
bool found = false;

if (this.Processes != null)
foreach (DeviceProcessInfo pi in this.Processes)
{
foreach (DeviceProcessInfo pi in this.Processes)
if (pi.ProcessId == processId)
{
if (pi.ProcessId == processId)
{
found = true;
break;
}
found = true;
break;
}
}

return found;
}

Expand All @@ -448,21 +444,17 @@ public bool Contains(string packageName, bool caseSensitive = true)
{
bool found = false;

if (this.Processes != null)
foreach (DeviceProcessInfo pi in this.Processes)
{
foreach (DeviceProcessInfo pi in this.Processes)
if (string.Compare(
pi.PackageFullName,
packageName,
caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase) == 0)
{
if (string.Compare(
pi.PackageFullName,
packageName,
caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase) == 0)
{
found = true;
break;
}
found = true;
break;
}
}

return found;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Threading.Tasks;
Expand Down Expand Up @@ -119,7 +120,7 @@ public class AppsListInfo
/// Gets or sets the application packages
/// </summary>
[DataMember(Name = "AppPackages")]
public AppPackage[] AppPackages { get; private set; }
public List<AppPackage> AppPackages { get; private set; }
}

[DataContract]
Expand Down Expand Up @@ -148,7 +149,7 @@ public class HeadlessAppsListInfo
/// Gets the list of headless application packages
/// </summary>
[DataMember(Name = "AppPackages")]
public AppPackage[] AppPackages { get; private set; }
public List<AppPackage> AppPackages { get; private set; }
}

#endregion // Data contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Runtime.Serialization;
using System.Threading.Tasks;
using System.Threading;
using System.Collections.Generic;

namespace Microsoft.Tools.WindowsDevicePortal
{
Expand Down Expand Up @@ -359,7 +360,7 @@ public class AvailableBluetoothDevicesInfo
/// Returns a list of available devices
/// </summary>
[DataMember(Name = "AvailableDevices")]
public BluetoothDeviceInfo[] AvailableDevices;
public List<BluetoothDeviceInfo> AvailableDevices { get; private set; }
}
public class BluetoothDeviceInfo
{
Expand All @@ -386,7 +387,7 @@ public class PairedBluetoothDevicesInfo
/// Returns a list of paired devices
/// </summary>
[DataMember(Name = "PairedDevices")]
public BluetoothDeviceInfo[] PairedDevices;
public List<BluetoothDeviceInfo> PairedDevices { get; private set; }
}

/// <summary>
Expand All @@ -399,7 +400,7 @@ public class PairBluetoothDevicesInfo
/// Returns the pair results
/// </summary>
[DataMember(Name = "PairResult")]
public PairResult PairResult;
public PairResult PairResult { get; private set; }
}

public class PairResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Threading.Tasks;
Expand Down Expand Up @@ -245,7 +246,7 @@ public class TimezoneInfo
/// Gets the list of all timezones
/// </summary>
[DataMember(Name = "Timezones")]
public Timezone[] Timezones { get; private set; }
public List<Timezone> Timezones { get; private set; }
}

/// <summary>
Expand Down Expand Up @@ -345,7 +346,7 @@ public class ControllerDriverInfo
/// Gets the list of all the controller drivers information
/// </summary>
[DataMember(Name = "ControllersDrivers")]
public string[] ControllersDrivers { get; private set; }
public List<string> ControllersDrivers { get; private set; }

/// <summary>
/// Gets the request for reboot
Expand Down Expand Up @@ -383,7 +384,7 @@ public class DisplayResolutionInfo
/// Gets the list of resolution specifications
/// </summary>
[DataMember(Name = "Resolutions")]
public Resolution[] Resolutions { get; private set; }
public List<Resolution> Resolutions { get; private set; }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Threading.Tasks;
Expand Down Expand Up @@ -71,13 +72,13 @@ public class IscInterfacesInfo
/// Gets the internet connection sharing(ICS) private interfaces.
/// </summary>
[DataMember(Name = "PrivateInterfaces")]
public string[] PrivateInterfaces { get; private set; }
public List<string> PrivateInterfaces { get; private set; }

/// <summary>
/// Gets the internet connection sharing(ICS) public interfaces.
/// </summary>
[DataMember(Name = "PublicInterfaces")]
public string[] PublicInterfaces { get; private set; }
public List<string> PublicInterfaces { get; private set; }
}
#endregion // Data contract
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Threading.Tasks;
Expand Down Expand Up @@ -160,7 +161,7 @@ public class TpmAcpiTablesInfo
/// Gets TPM ACPI Tables.
/// </summary>
[DataMember(Name = "AcpiTables")]
public string[] AcpiTables { get; private set; }
public List<string> AcpiTables { get; private set; }
}

/// <summary>
Expand Down