15 lines
1.9 KiB
C#
15 lines
1.9 KiB
C#
using Microsoft.AspNetCore.Hosting;
|
|
using PlotLine.Services;
|
|
using PlotLine.ViewModels;
|
|
internal static class ReleaseSprintTests
|
|
{
|
|
public static void Run()
|
|
{
|
|
void Check(bool value,string text){if(!value)throw new Exception(text);}
|
|
var warnings=new[]{new ProjectWarningViewModel{ContinuityWarningID=1,WarningType="Travel",WarningTypeDisplayName="Travel",Severity="Warning",CharacterID=10,CharacterName="A",SceneID=1},new ProjectWarningViewModel{ContinuityWarningID=2,WarningType="Travel",WarningTypeDisplayName="Travel",Severity="Warning",CharacterID=10,CharacterName="A",SceneID=2,IsAcknowledged=true},new ProjectWarningViewModel{ContinuityWarningID=3,WarningType="Travel",Severity="Warning",CharacterID=20},new ProjectWarningViewModel{ContinuityWarningID=4,WarningType="Age",Severity="Warning",CharacterID=10}};
|
|
var groups=WarningTriage.Group(warnings);Check(groups.Count==3&&groups.Sum(g=>g.Warnings.Count)==4,"Triage groups related rule/entity evidence without dropping warnings");var travel=groups.Single(g=>g.Warnings.Count==2);Check(travel.Active==1&&travel.Scenes==2&&warnings[1].IsAcknowledged,"Triage preserves decisions and separates active from acknowledged evidence");
|
|
var environment=NativeWorkflowTests.Proxy<IWebHostEnvironment>((name,args)=>name=="get_ContentRootPath"?Path.GetFullPath("PlotLine"):name=="get_EnvironmentName"?"Development":null);
|
|
var help=new HelpService(environment);var first=help.GetByContextKey("gettingStarted.firstBook");var install=help.GetByContextKey("wordCompanion.install");Check(first?.Url=="/help/getting-started/first-book"&&install?.Url=="/help/word-companion/install","New author/Companion guidance resolves through actual help routing");Check(install!.MarkdownContent.Contains("not yet offered")&&!install.MarkdownContent.Contains("C:\\Users"),"Download guidance does not expose an internal installer path or pretend public qualification");
|
|
}
|
|
}
|