Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LogWriter"/> class.
 /// </summary>
 /// <param name="logger">Serilog.ILogger.</param>
 /// <param name="writerHelper">Log Writer Helper.</param>
 public LogWriter(
     ILogger logger,
     LogWriterHelper writerHelper)
 {
     this.writerHelper = writerHelper;
     this.logger       = logger;
 }
Пример #2
0
    public void TestEmptyRom(string expectedAsm)
    {
        var emptyData = dataFactory.Create();

        emptyData.Apis.AddIfDoesntExist(new SnesApi(emptyData));
        var result = LogWriterHelper.ExportAssembly(emptyData);

        LogWriterHelper.AssertAssemblyOutputEquals(expectedAsm, result, debugWriter);
    }
Пример #3
0
    public void TestAFewLines()
    {
        var data = CreateSampleData();

        LogWriterHelper.AssertAssemblyOutputEquals(ExpectedRaw, LogWriterHelper.ExportAssembly(data, creator =>
        {
            creator.Settings = new LogWriterSettings
            {
                OutputExtraWhitespace = false
            };
        }), debugWriter);
    }
Пример #4
0
        public static void RunTestRom()
        {
            // C# ROM -> Assembly Text
            var exportAssembly = LogWriterHelper.ExportAssembly(GetSampleData()).OutputStr;

            // Assembly Text -> Asar -> SFC file
            var bytes = AsarRunner.AssembleToRom(exportAssembly);

            Assert.Equal(0x8D, bytes[0]);
            Assert.Equal(0x16, bytes[1]);
            Assert.Equal(0x21, bytes[2]);
            Assert.Equal(3, bytes.Count);
        }
Пример #5
0
 public void TestAFewLines()
 {
     LogWriterHelper.AssertAssemblyOutputEquals(ExpectedRaw, LogWriterHelper.ExportAssembly(InputRom));
 }
Пример #6
0
    public void TestOneLine()
    {
        var exportAssembly = LogWriterHelper.ExportAssembly(dataFactory.Create());

        LogWriterHelper.AssertAssemblyOutputEquals(ExpectedRaw, exportAssembly);
    }