Пример #1
0
        public void ProcessesTestTarget()
        {
            var target     = GetTarget("String");
            var obfuscator = new StringObfuscator();

            Assert.IsTrue(obfuscator.Process(target));
        }
Пример #2
0
        public void IgnoresAccessibility()
        {
            var target     = GetTarget("String");
            var obfuscator = new StringObfuscator();

            Assert.IsTrue(obfuscator.Process(target));
            Assert.Contains("Public", obfuscator.FoundStrings, "Missed public accessibility");
            Assert.Contains("Private", obfuscator.FoundStrings, "Missed private accessibility");
            Assert.Contains("Protected", obfuscator.FoundStrings, "Missed protected accessibility");
            Assert.Contains("Internal", obfuscator.FoundStrings, "Missed internal accessibility");
        }
Пример #3
0
        public void DoesNotCorruptBranches()
        {
            var targetGenerator = new BranchesTestTarget();
            var target          = targetGenerator.Generate();
            var sizeBefore      = targetGenerator.EntryMethod.Body.Instructions.Count;

            var obfuscator = new StringObfuscator();

            Assert.IsTrue(obfuscator.Process(target));

            var sizeAfter = targetGenerator.EntryMethod.Body.Instructions.Count;

            Assert.Greater(sizeAfter, sizeBefore);

            BranchHelper.VerifyBranches(targetGenerator.EntryMethod);
        }