AsmResolver.Tests.Native.X86AssemblerTests.TestAssembler C# (CSharp) Method

TestAssembler() private static method

private static TestAssembler ( IReadOnlyList instructions ) : void
instructions IReadOnlyList
return void
        private static void TestAssembler(IReadOnlyList<X86Instruction> instructions)
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "test.bin");
            using (var stream = File.Create(path))
            {
                var writer = new BinaryStreamWriter(stream);
                var assembler = new X86Assembler(writer);

                foreach (var instruction in instructions)
                    assembler.Write(instruction);
            }

            ValidateCode(instructions, File.ReadAllBytes(path));
        }