예제 #1
0
        public void MockupProxyPostponedRebootTest()
        {
            var twin           = new TwinMockup();
            var requestHandler = new HandlerMockupForReboot(false);
            var proxy          = new ConfigurationProxyMockup();
            var dmClient       = DeviceManagementClient.Create(twin, requestHandler, proxy);

            dmClient.RebootAsync().Wait();

            Assert.AreEqual(proxy.ReceivedRequest, null);
            Assert.AreEqual(proxy.ReturnedResponse, null);
        }
예제 #2
0
        public void MockupProxyImmediateRebootTest()
        {
            var twin           = new TwinMockup();
            var requestHandler = new HandlerMockupForReboot(true);
            var proxy          = new ConfigurationProxyMockup();
            var dmClient       = DeviceManagementClient.Create(twin, requestHandler, proxy);

            dmClient.RebootAsync().Wait();

            Assert.AreEqual(proxy.ReceivedRequest.Tag, DMMessageKind.ImmediateReboot);
            Assert.AreEqual(proxy.ReturnedResponse.Tag, DMMessageKind.ImmediateReboot);
            Assert.AreEqual(proxy.ReturnedResponse.Status, ResponseStatus.Success);
        }
예제 #3
0
        public void MockupProxyInstallAppTest()
        {
            var twin  = new TwinMockup();
            var proxy = new ConfigurationProxyMockup();

            var appInstallRequest = new AppInstallRequest(new AppInstallRequestData()
            {
                AppxPath = "abc", PackageFamilyName = "def", Dependencies = new List <String>()
                {
                    "ghi", "jkl"
                }
            });
            var response = proxy.SendCommandAsync(appInstallRequest).Result;

            Assert.AreEqual(response.Status, ResponseStatus.Success);
            Assert.AreEqual(response.Tag, DMMessageKind.InstallApp);
        }