0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-05-19 20:01:17 +03:00
ParkanPlayground/X86DisassemblerTests/TestFromFileEntry.cs

48 lines
1.1 KiB
C#
Raw Normal View History

2025-04-13 17:02:46 +03:00
using CsvHelper.Configuration;
namespace X86DisassemblerTests;
public class TestFromFileEntry
{
public string RawBytes { get; set; } = string.Empty;
public List<TestFromFileInstruction> Instructions { get; set; } = new();
public TestFromFileEntry()
{
}
public TestFromFileEntry(string rawBytes, List<TestFromFileInstruction> instructions)
{
RawBytes = rawBytes;
Instructions = instructions;
}
}
public class TestFromFileInstruction
{
public string Mnemonic { get; set; } = string.Empty;
public string Operands { get; set; } = string.Empty;
// Parameterless constructor required by CsvHelper
public TestFromFileInstruction()
{
}
public TestFromFileInstruction(string mnemonic, string operands)
{
Mnemonic = mnemonic;
Operands = operands;
}
}
public sealed class TestFromFileEntryMap : ClassMap<TestFromFileEntry>
{
public TestFromFileEntryMap()
{
Map(m => m.RawBytes)
.Name("RawBytes");
Map(m => m.Instructions)
.Name("Instructions")
.TypeConverter<CsvJsonConverter<List<TestFromFileInstruction>>>();
}
}