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:
48
X86DisassemblerTests/TestFromFileEntry.cs
Normal file
48
X86DisassemblerTests/TestFromFileEntry.cs
Normal 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>>>();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user