using XFEEDToolBox.Core.Session;
using XFEEDToolBox.Services;
using XFEExtension.NetCore.XUnit.Attributes;
namespace XFEEDToolBox.Test;
[TestFixture]public class OwnedStartupCrashReporterTests
{
[Test]public void ReporterMustMatchInstallationExactDumpAndCrashTime()
{
using var folder=new TemporaryDirectory();var game=Path.Combine(folder.Path,"Products","game","EliteDangerous64.exe");
var reporter=Path.Combine(folder.Path,"CrashReporter.exe");var dump=Path.Combine(folder.Path,"this crash.dmp");var at=DateTimeOffset.UtcNow;
var proof=new StartupCrashEvidence(dump,74248,0xc0000005,at);var args=$"reporter \"{dump}\"";
Check.That(OwnedStartupCrashReporter.Matches(game,reporter,args,at.AddSeconds(1),proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,Path.Combine(folder.Path,"other","CrashReporter.exe"),args,at,proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,reporter,"reporter other.dmp",at,proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,reporter,args,at.AddMinutes(-1),proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,reporter,args,at.AddMinutes(2),proof));
}
}
using XFEEDToolBox.Core.Session;
using XFEEDToolBox.Services;
using XFEExtension.NetCore.XUnit.Attributes;
namespace XFEEDToolBox.Test;
[TestFixture]public class OwnedStartupCrashReporterTests
{
[Test]public void ReporterMustMatchInstallationExactDumpAndCrashTime()
{
using var folder=new TemporaryDirectory();var game=Path.Combine(folder.Path,"Products","game","EliteDangerous64.exe");
var reporter=Path.Combine(folder.Path,"CrashReporter.exe");var dump=Path.Combine(folder.Path,"this crash.dmp");var at=DateTimeOffset.UtcNow;
var proof=new StartupCrashEvidence(dump,74248,0xc0000005,at);var args=$"reporter \"{dump}\"";
Check.That(OwnedStartupCrashReporter.Matches(game,reporter,args,at.AddSeconds(1),proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,Path.Combine(folder.Path,"other","CrashReporter.exe"),args,at,proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,reporter,"reporter other.dmp",at,proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,reporter,args,at.AddMinutes(-1),proof));
Check.That(!OwnedStartupCrashReporter.Matches(game,reporter,args,at.AddMinutes(2),proof));
}
}