feat: add self test

This commit is contained in:
goat 2021-08-10 23:33:37 +02:00
parent 409ce984da
commit a8e00f91e7
No known key found for this signature in database
GPG key ID: F18F057873895461
18 changed files with 1004 additions and 0 deletions

View file

@ -0,0 +1,39 @@
using System.Collections.Generic;
using System.Linq;
using Dalamud.Utility;
using Lumina.Excel;
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
{
/// <summary>
/// Test setup for Lumina.
/// </summary>
/// <typeparam name="T">ExcelRow to run test on.</typeparam>
internal class LuminaAgingStep<T> : IAgingStep
where T : ExcelRow
{
private int step = 0;
private List<T> rows;
/// <inheritdoc/>
public string Name => "Test Lumina";
/// <inheritdoc/>
public SelfTestStepResult RunStep(Dalamud dalamud)
{
this.rows ??= dalamud.Data.GetExcelSheet<T>().ToList();
Util.ShowObject(this.rows[this.step]);
this.step++;
return this.step >= this.rows.Count ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
}
/// <inheritdoc/>
public void CleanUp(Dalamud dalamud)
{
// ignored
}
}
}