Previously RegisterAnonymousViewer auto-completed the tutorial, which prevented the client from ever entering the tutorial flow. SeedViewerAsync gains a tutorialState parameter (default 100) so existing tests keep their pre-completed-tutorial assumption.
25 lines
918 B
C#
25 lines
918 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using NUnit.Framework;
|
|
using SVSim.Database;
|
|
using SVSim.Database.Repositories.Viewer;
|
|
using SVSim.UnitTests.Infrastructure;
|
|
|
|
namespace SVSim.UnitTests.Repositories;
|
|
|
|
public class ViewerRepositoryTutorialDefaultTests
|
|
{
|
|
[Test]
|
|
public async Task RegisterAnonymousViewer_starts_at_tutorial_step_0()
|
|
{
|
|
using var factory = new SVSimTestFactory();
|
|
using var scope = factory.Services.CreateScope();
|
|
var repo = scope.ServiceProvider.GetRequiredService<IViewerRepository>();
|
|
|
|
var viewer = await repo.RegisterAnonymousViewer(Guid.NewGuid());
|
|
|
|
Assert.That(viewer.MissionData.TutorialState, Is.EqualTo(0),
|
|
"Fresh signups must start at PRE_TUTORIAL_STEP=0 so the client triggers the tutorial flow. " +
|
|
"Tests that want a pre-completed tutorial should use SeedViewerAsync (which defaults to 100).");
|
|
}
|
|
}
|