Пример #1
0
        public void TestComObjectCollector()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Setup();

                var FirstRunId = "TestComObjectCollector-1";

                var coc = new ComObjectCollector(FirstRunId);
                coc.Execute();

                List <RawCollectResult> collectResults = DatabaseManager.GetResultsByRunid(FirstRunId);

                List <ComObject> comObjects = new List <ComObject>();

                foreach (var collectResult in collectResults)
                {
                    comObjects.Add((ComObject)(collectResult.DeserializedObject));
                }

                Assert.IsTrue(comObjects.Where(x => x.x86_Binary != null).Count() > 0);

                TearDown();
            }
        }
        public void TestComObjectCollector()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var coc = new ComObjectCollector(new CollectCommandOptions());
                coc.Execute();

                Assert.IsTrue(coc.Results.Any(x => x is ComObject y && y.x86_Binary != null));
            }
        }
Пример #3
0
        public void TestComObjectCollector()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var coc = new ComObjectCollector(new CollectCommandOptions());
                coc.TryExecute();

                Assert.IsTrue(coc.Results.Any(x => x is ComObject y && y.x86_Binary != null));

                ConcurrentStack <CollectObject> results = new ConcurrentStack <CollectObject>();
                coc = new ComObjectCollector(changeHandler: x => results.Push(x));
                coc.TryExecute();

                Assert.IsTrue(results.Any(x => x is ComObject y && y.x86_Binary != null));
            }
        }