예제 #1
0
        public void SetDeviceOtherException()
        {
            var requests = new string[]
            {
                "host:transport:169.254.109.177:5555"
            };

            Assert.Throws <AdbException>(() => this.RunTest(
                                             new AdbResponse[] { AdbResponse.FromError("Too many cats.") },
                                             NoResponseMessages,
                                             requests,
                                             () =>
            {
                this.Socket.SetDevice(Device);
            }));
        }
예제 #2
0
        public void SetInvalidDeviceTest()
        {
            var requests = new string[]
            {
                "host:transport:169.254.109.177:5555"
            };

            Assert.Throws <DeviceNotFoundException>(() => this.RunTest(
                                                        new AdbResponse[] { AdbResponse.FromError("device not found") },
                                                        NoResponseMessages,
                                                        requests,
                                                        () =>
            {
                this.Socket.SetDevice(Device);
            }));
        }
예제 #3
0
        public void SetDeviceOtherException()
        {
            var requests = new string[]
            {
                "host:transport:169.254.109.177:5555"
            };

            this.RunTest(
                new AdbResponse[] { AdbResponse.FromError("Too many cats.") },
                NoResponseMessages,
                requests,
                () =>
            {
                AdbClient.Instance.SetDevice(this.Socket, Device);
            });
        }
예제 #4
0
        public void SetInvalidDeviceTest()
        {
            var requests = new string[]
            {
                "host:transport:169.254.109.177:5555"
            };

            this.RunTest(
                new AdbResponse[] { AdbResponse.FromError("device not found") },
                NoResponseMessages,
                requests,
                () =>
            {
                AdbClient.Instance.SetDevice(this.Socket, Device);
            });
        }
예제 #5
0
        public void CreateDuplicateForwardTest()
        {
            var responses = new AdbResponse[]
            {
                AdbResponse.FromError("cannot rebind existing socket")
            };

            var requests = new string[]
            {
                "host-serial:169.254.109.177:5555:forward:norebind:tcp:1;tcp:2"
            };

            Assert.Throws <AdbException>(() => this.RunTest(
                                             responses,
                                             NoResponseMessages,
                                             requests,
                                             () =>
            {
                this.TestClient.CreateForward(Device, "tcp:1", "tcp:2", false);
            }));
        }
예제 #6
0
 public void ToStringTest()
 {
     Assert.AreEqual("OK", AdbResponse.OK.ToString());
     Assert.AreEqual("Error: Huh?", AdbResponse.FromError("Huh?").ToString());
 }