Commit efbc8675 authored by Jason Williams's avatar Jason Williams Committed by GitHub
Browse files

Merge pull request #100 from Microsoft/HymanMatt

Renamed mock data and associated tests to shorten file names
parents 2b9e26ea 19aa5b3d
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        /// </summary>
        public BaseTests()
        {
            TestHelpers.EstablishMockConnection(this.PlatformType, this.OperatingSystemVersion);
            TestHelpers.EstablishMockConnection(this.PlatformType, this.FriendlyOperatingSystemVersion);
        }

        /// <summary>
@@ -48,6 +48,17 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
            }
        }

        /// <summary>
        /// Gets the overridable friendly OS Version used to find the file names of mock data.
        /// </summary>
        protected virtual string FriendlyOperatingSystemVersion
        {
            get
            {
                return null;
            }
        }

        /// <summary>
        /// Cleanup which should run after each test.
        /// </summary>
+3 −2
Original line number Diff line number Diff line
@@ -18,10 +18,11 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        /// <summary>
        /// Helper method for verifying OS info based on a given version.
        /// </summary>
        /// <param name="friendlyOperatingSystemVersion">The friendly version of the OS we are targeting.</param>
        /// <param name="operatingSystemVersion">The version of the OS we are targeting.</param>
        public static void VerifyOsInformation(string operatingSystemVersion)
        public static void VerifyOsInformation(string friendlyOperatingSystemVersion, string operatingSystemVersion)
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.MachineNameApi, DevicePortalPlatforms.XboxOne, operatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.MachineNameApi, DevicePortalPlatforms.XboxOne, friendlyOperatingSystemVersion, HttpMethods.Get);

            Task<string> getNameTask = TestHelpers.Portal.GetDeviceName();
            getNameTask.Wait();
+24 −13
Original line number Diff line number Diff line
//----------------------------------------------------------------------------------------------
// <copyright file="XboxOne_14385_1002_amd64fre_rs1_xbox_rel_1608_160709_1700.cs" company="Microsoft Corporation">
// <copyright file="XboxOne_rs1_xbox_rel_1608.cs" company="Microsoft Corporation">
//     Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------
@@ -13,10 +13,10 @@ using static Microsoft.Tools.WindowsDevicePortal.DevicePortal;
namespace Microsoft.Tools.WindowsDevicePortal.Tests
{
    /// <summary>
    /// Test class for XboxOne_14385_1002_amd64fre_rs1_xbox_rel_1608_160709_1700 version
    /// Test class for XboxOne_rs1_xbox_rel_1608 version
    /// </summary>
    [TestClass]
    public class XboxOne_14385_1002_amd64fre_rs1_xbox_rel_1608_160709_1700 : BaseTests
    public class XboxOne_rs1_xbox_rel_1608 : BaseTests
    {
        /// <summary>
        /// Gets the Platform type these tests are targeting.
@@ -29,6 +29,17 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
            }
        }

        /// <summary>
        /// Gets the friendly OS Version these tests are targeting.
        /// </summary>
        protected override string FriendlyOperatingSystemVersion
        {
            get
            {
                return "rs1_xbox_rel_1608";
            }
        }

        /// <summary>
        /// Gets the OS Version these tests are targeting.
        /// </summary>
@@ -48,7 +59,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetXboxLiveUserListTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxLiveUserApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxLiveUserApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get);

            Task<UserList> getUserTask = TestHelpers.Portal.GetXboxLiveUsers();
            getUserTask.Wait();
@@ -74,7 +85,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetOsInfo_XboxOne_1608()
        {
            XboxHelpers.VerifyOsInformation(this.OperatingSystemVersion);
            XboxHelpers.VerifyOsInformation(this.FriendlyOperatingSystemVersion, this.OperatingSystemVersion);
        }

        /// <summary>
@@ -85,7 +96,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetXboxSettingsTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxSettingsApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxSettingsApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get);

            Task<XboxSettingList> getSettingsTask = TestHelpers.Portal.GetXboxSettings();
            getSettingsTask.Wait();
@@ -120,7 +131,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void AppFileExplorerGetKnownFolderTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.KnownFoldersApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.KnownFoldersApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get);

            Task<KnownFolders> getKnownFoldersTask = TestHelpers.Portal.GetKnownFolders();
            getKnownFoldersTask.Wait();
@@ -142,7 +153,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void AppFileExplorerGetFolderContentsTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFilesApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFilesApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get);

            Task<FolderContents> getFolderContentsTask = TestHelpers.Portal.GetFolderContents("DevelopmentFiles");
            getFolderContentsTask.Wait();
@@ -245,7 +256,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetRunningProcessesTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunningProcessApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunningProcessApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get);

            Task<RunningProcesses> getRunningProcessesTask = TestHelpers.Portal.GetRunningProcesses();
            getRunningProcessesTask.Wait();
@@ -262,7 +273,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetRunningProcessesWebSocketTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunningProcessApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.WebSocket);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunningProcessApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.WebSocket);

            ManualResetEvent runningProcessesReceived = new ManualResetEvent(false);
            RunningProcesses runningProcesses = null;
@@ -302,7 +313,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetSystemPerfTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SystemPerfApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.Get);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SystemPerfApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get);

            Task<SystemPerformanceInformation> getSystemPerfTask = TestHelpers.Portal.GetSystemPerf();
            getSystemPerfTask.Wait();
@@ -319,7 +330,7 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
        [TestMethod]
        public void GetSystemPerfWebSocketTest_XboxOne_1608()
        {
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SystemPerfApi, this.PlatformType, this.OperatingSystemVersion, HttpMethods.WebSocket);
            TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SystemPerfApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.WebSocket);

            ManualResetEvent systemPerfReceived = new ManualResetEvent(false);
            SystemPerformanceInformation systemPerfInfo = null;
+0 −0

File moved.

+0 −0

File moved.

Loading