0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-19 16:08:02 +03:00

move tests to csv

This commit is contained in:
bird_egop
2025-04-13 17:02:46 +03:00
parent 565158d9bd
commit 2cdd9f1e83
12 changed files with 274 additions and 518 deletions

View File

@ -0,0 +1,48 @@
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>>>();
}
}