Commit d1941d98 authored by Hirsch Singhal's avatar Hirsch Singhal Committed by GitHub
Browse files

Change array return types to Lists for #189 (#191)

parent cfa91448
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests.Core
        /// <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);
+3 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
@@ -589,7 +590,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
            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>
@@ -771,7 +772,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
            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>
+1 −1
Original line number Diff line number Diff line
@@ -669,7 +669,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        /// <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);
+12 −20
Original line number Diff line number Diff line
@@ -412,7 +412,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
            /// 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
@@ -423,8 +423,6 @@ namespace Microsoft.Tools.WindowsDevicePortal
            {
                bool found = false;

                if (this.Processes != null)
                {
                foreach (DeviceProcessInfo pi in this.Processes)
                {
                    if (pi.ProcessId == processId)
@@ -433,8 +431,6 @@ namespace Microsoft.Tools.WindowsDevicePortal
                        break;
                    }
                }
                }

                return found;
            }

@@ -448,8 +444,6 @@ namespace Microsoft.Tools.WindowsDevicePortal
            {
                bool found = false;

                if (this.Processes != null)
                {
                foreach (DeviceProcessInfo pi in this.Processes)
                {
                    if (string.Compare(
@@ -461,8 +455,6 @@ namespace Microsoft.Tools.WindowsDevicePortal
                        break;
                    }
                }
                }

                return found;
            }
        }
+3 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
//----------------------------------------------------------------------------------------------

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

        [DataContract]
@@ -148,7 +149,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
            /// 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
Loading