Example #1
0
        public void TestGetConsoleInfoCallsXdkGetConsoleInfo()
        {
            bool isCorrectMethodCalled = false;

            string        expectedToolsIp   = "Expected Tools Ip";
            string        expectedSystemIp  = "Expected System Ip";
            string        expectedAccessKey = "Expected Access Key";
            string        expectedConsoleId = "Expected Console Id";
            XboxCertTypes expectedCertType  = XboxCertTypes.EraDevKit | XboxCertTypes.Other;
            string        expectedHostName  = "Expected Host Name";
            string        expectedDeviceId  = "Expected Device Id";

            XboxConsoleInfo expectedValue = new XboxConsoleInfo(expectedToolsIp, expectedSystemIp, expectedAccessKey, expectedConsoleId, expectedCertType, expectedHostName, expectedDeviceId);

            this.fakeXboxXdk.GetConsoleInfoFunc = (address) =>
            {
                isCorrectMethodCalled = true;
                Assert.AreEqual(ConsoleAddress, address, "GetConsoleInfo method did not pass the correct system IP address to the Xdk.");
                return(expectedValue);
            };

            var value = this.adapter.GetConsoleInfo(ConsoleAddress);

            Assert.IsTrue(isCorrectMethodCalled, "The GetConsoleInfo method did not call the Xdk's GetConsoleInfo method.");

            Assert.AreEqual(expectedToolsIp, value.ToolsIpAddress, "GetConsoleInfo method did not receive the correct tools ip value in the returned XboxConsoleInfo object from the xdk.");
            Assert.AreEqual(expectedSystemIp, value.ConsoleIPAddress, "etConsoleInfo method did not receive the correct console ip value in the returned XboxConsoleInfo object from the xdk.");
            Assert.AreEqual(expectedAccessKey, value.AccessKey, "GetConsoleInfo method did not receive the correct access key value in the returned XboxConsoleInfo object from the xdk.");
            Assert.AreEqual(expectedConsoleId, value.ConsoleId, "GetConsoleInfo method did not receive the correct console id value in the returned XboxConsoleInfo object from the xdk.");
            Assert.AreEqual(expectedCertType, value.CertType, "GetConsoleInfo method did not receive the correct cert type value in the returned XboxConsoleInfo object from the xdk.");
            Assert.AreEqual(expectedHostName, value.HostName, "GetConsoleInfo method did not receive the correct host name value in the returned XboxConsoleInfo object from the xdk.");
            Assert.AreEqual(expectedDeviceId, value.DeviceId, "GetConsoleInfo method did not receive the correct device id value in the returned XboxConsoleInfo object from the xdk.");

            this.VerifyThrows <ArgumentNullException>(() => this.adapter.GetConsoleInfo(null));
        }
 /// <summary>
 /// Initializes a new instance of the XboxConsoleInfo class.
 /// </summary>
 /// <param name="toolsIpAddress">The tools ip address of the console.</param>
 /// <param name="consoleIPAddress">The system ip address of the console.</param>
 /// <param name="accessKey">The access key of the console.</param>
 /// <param name="consoleId">The console id.</param>
 /// <param name="certType">The cert type of the console.</param>
 /// <param name="hostName">The host name of the console.</param>
 /// <param name="deviceId">The device id of the console.</param>
 public XboxConsoleInfo(string toolsIpAddress, string consoleIPAddress, string accessKey, string consoleId, XboxCertTypes certType, string hostName, string deviceId)
 {
     this.ToolsIpAddress   = toolsIpAddress;
     this.ConsoleIPAddress = consoleIPAddress;
     this.AccessKey        = accessKey;
     this.ConsoleId        = consoleId;
     this.CertType         = certType;
     this.HostName         = hostName;
     this.DeviceId         = deviceId;
 }