예제 #1
0
        public void TestProcessListParser2()
        {
            List <int> result;

            var processListParer = new ProcessListParser(GetFakeProcessListText2());

            result = processListParer.FindProcesses("hellojni");
            Assert.Empty(result);

            result = processListParer.FindProcesses("com.example.hellojni");
            Assert.Single(result);
            Assert.Equal(7848, result[0]);

            result = processListParer.FindProcesses("com.example.memory_hog");
            Assert.Single(result);
            Assert.Equal(7915, result[0]);
        }
예제 #2
0
        public void TestProcessListParser2()
        {
            List <int> result;

            var processListParer = new ProcessListParser(GetFakeProcessListText2());

            result = processListParer.FindProcesses("hellojni");
            Assert.Equal(result.Count, 0);

            result = processListParer.FindProcesses("com.example.hellojni");
            Assert.Equal(result.Count, 1);
            Assert.Equal(result[0], 7848);

            result = processListParer.FindProcesses("com.example.memory_hog");
            Assert.Equal(result.Count, 1);
            Assert.Equal(result[0], 7915);
        }
예제 #3
0
        public void TestProcessListParser1()
        {
            List <int> result;

            var processListParer = new ProcessListParser(GetFakeProcessListText1());

            result = processListParer.FindProcesses("hellojni");
            Assert.Empty(result);

            result = processListParer.FindProcesses("com.example.hellojni");
            Assert.Single(result);
            Assert.Equal(1165, result[0]);

            result = processListParer.FindProcesses("fake_name");
            Assert.Equal(2, result.Count);
            Assert.Equal(2, result[0]);
            Assert.Equal(3, result[1]);
        }
예제 #4
0
        public void TestProcessListParser1()
        {
            List <int> result;

            var processListParer = new ProcessListParser(GetFakeProcessListText1());

            result = processListParer.FindProcesses("hellojni");
            Assert.Equal(result.Count, 0);

            result = processListParer.FindProcesses("com.example.hellojni");
            Assert.Equal(result.Count, 1);
            Assert.Equal(result[0], 1165);

            result = processListParer.FindProcesses("fake_name");
            Assert.Equal(result.Count, 2);
            Assert.Equal(result[0], 2);
            Assert.Equal(result[1], 3);
        }