Commit 498fcae7 authored by Jason Williams's avatar Jason Williams
Browse files

Adds device verification to Xbox specific methods

parent c945380e
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -20,6 +20,28 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
    [TestClass]
    public class UserManagementTests : BaseTests
    {
        /// <summary>
        /// Gets the Platform type these tests are targeting.
        /// </summary>
        protected override DevicePortalPlatforms PlatformType
        {
            get
            {
                return DevicePortalPlatforms.XboxOne;
            }
        }

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

        /// <summary>
        /// Basic test of the GET method. Gets a mock list of users
        /// and verifies it comes back as expected from the raw response
+22 −0
Original line number Diff line number Diff line
@@ -16,6 +16,28 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
    [TestClass]
    public class XboxAppDeploymentTests : BaseTests
    {
        /// <summary>
        /// Gets the Platform type these tests are targeting.
        /// </summary>
        protected override DevicePortalPlatforms PlatformType
        {
            get
            {
                return DevicePortalPlatforms.XboxOne;
            }
        }

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

        /// <summary>
        /// Basic test of the register API.
        /// </summary>
+22 −0
Original line number Diff line number Diff line
@@ -20,6 +20,28 @@ namespace Microsoft.Tools.WindowsDevicePortal.Tests
    [TestClass]
    public class XboxSettingsTests : BaseTests
    {
        /// <summary>
        /// Gets the Platform type these tests are targeting.
        /// </summary>
        protected override DevicePortalPlatforms PlatformType
        {
            get
            {
                return DevicePortalPlatforms.XboxOne;
            }
        }

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

        /// <summary>
        /// Basic test of the GET method. Gets a mock list of settings
        /// and verifies it comes back as expected from the raw response
+6 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
// </copyright>
//----------------------------------------------------------------------------------------------

using System;
using System.Runtime.Serialization;
using System.Threading.Tasks;

@@ -25,6 +26,11 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// <returns>The SMB path, username, and password.</returns>
        public async Task<SmbInfo> GetSmbShareInfo()
        {
            if (this.Platform != DevicePortalPlatforms.XboxOne)
            {
                throw new NotSupportedException("This method is only supported on Xbox One.");
            }

            return await this.Get<SmbInfo>(GetSmbShareInfoApi);
        }

+11 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
// </copyright>
//----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Threading.Tasks;
@@ -26,6 +27,11 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// <returns>UserList object containing a List of UserInfo objects representing the users on the device.</returns>
        public async Task<UserList> GetXboxLiveUsers()
        {
            if (this.Platform != DevicePortalPlatforms.XboxOne)
            {
                throw new NotSupportedException("This method is only supported on Xbox One.");
            }

            return await this.Get<UserList>(XboxLiveUserApi);
        }

@@ -36,6 +42,11 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// <returns>Task for tracking async completion.</returns>
        public async Task UpdateXboxLiveUsers(UserList users)
        {
            if (this.Platform != DevicePortalPlatforms.XboxOne)
            {
                throw new NotSupportedException("This method is only supported on Xbox One.");
            }

            await this.Put(XboxLiveUserApi, users);
        }

Loading