AsmResolver.Tests.Utilities.ValidateCode C# (CSharp) Метод

ValidateCode() публичный статический Метод

public static ValidateCode ( string code, MethodBody body ) : void
code string
body AsmResolver.Net.Msil.MethodBody
Результат void
        public static void ValidateCode(string code, MethodBody body)
        {
            var builder = new StringBuilder();
            foreach (var instruction in body.Instructions)
            {
                builder.AppendLine(String.Format("{0}{1}", instruction.OpCode.Name,
                    instruction.Operand != null ? " " + instruction.OperandToString() : String.Empty));
            }
            Assert.IsTrue(code.TrimEnd() == builder.ToString().TrimEnd());
        }