Skip to content

Commit 991e567

Browse files
authored
DC-231: Update Test Scenario Mock Data (#111)
* Add last 4 and address to large family scenario * DC-231: Update mock user scenarios to match Lower Environment UAT Test Cases
1 parent 5aebaa3 commit 991e567

4 files changed

Lines changed: 28 additions & 20 deletions

File tree

src/SEBT.Portal.Core/Seeding/SeedScenarios.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ public static class SeedScenarios
1111
// IAL1+ scenarios
1212
public static readonly SeedScenario CoLoaded = new("co-loaded", UserIalLevel.IAL1plus);
1313
public static readonly SeedScenario Verified = new("verified", UserIalLevel.IAL1plus);
14-
public static readonly SeedScenario SingleChild = new("singlechild", UserIalLevel.IAL1plus);
15-
public static readonly SeedScenario LargeFamily = new("largefamily", UserIalLevel.IAL1plus);
1614
public static readonly SeedScenario Expired = new("expired", UserIalLevel.IAL1plus);
15+
public static readonly SeedScenario Review = new("review", UserIalLevel.IAL1plus);
16+
17+
// IAL1 scenarios
18+
public static readonly SeedScenario SingleChild = new("singlechild", UserIalLevel.IAL1);
19+
public static readonly SeedScenario NonCoLoaded = new("non-co-loaded", UserIalLevel.IAL1);
1720

1821
// Non-IAL scenarios
19-
public static readonly SeedScenario NonCoLoaded = new("non-co-loaded", UserIalLevel.None);
22+
public static readonly SeedScenario LargeFamily = new("largefamily", UserIalLevel.None);
2023
public static readonly SeedScenario NotStarted = new("not-started", UserIalLevel.None);
2124
public static readonly SeedScenario Pending = new("pending", UserIalLevel.None);
2225
public static readonly SeedScenario Minimal = new("minimal", UserIalLevel.None);
2326
public static readonly SeedScenario Denied = new("denied", UserIalLevel.None);
24-
public static readonly SeedScenario Review = new("review", UserIalLevel.None);
2527
public static readonly SeedScenario Cancelled = new("cancelled", UserIalLevel.None);
2628
public static readonly SeedScenario Unknown = new("unknown", UserIalLevel.None);
2729

src/SEBT.Portal.Infrastructure/Dependencies.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static IServiceCollection AddPortalInfrastructureRepositories(
9999
"UseMockHouseholdData is false but no household plugin (ISummerEbtCaseService) is loaded. " +
100100
"Either set UseMockHouseholdData to true in configuration or ensure a state plugin is loaded (e.g. PluginAssemblyPaths and the plugin DLL).");
101101
});
102-
services.AddTransient<MockHouseholdRepository>();
102+
services.AddSingleton<MockHouseholdRepository>();
103103
services.AddTransient<HouseholdRepository>();
104104

105105
services.AddMemoryCache();

src/SEBT.Portal.Infrastructure/Repositories/MockHouseholdRepository.cs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ private void SeedMockData()
232232

233233
// Scenario 5: Under review
234234
var reviewEmail = _settings.BuildEmail(SeedScenarios.Review.Name);
235-
var review = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.UnderReview, h =>
235+
var review = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Unknown, h =>
236236
{
237-
h.BenefitIssuanceType = BenefitIssuanceType.SnapEbtCard;
237+
h.BenefitIssuanceType = BenefitIssuanceType.SummerEbt;
238238
var app = h.Applications.FirstOrDefault();
239239
if (app != null)
240240
{
@@ -243,6 +243,7 @@ private void SeedMockData()
243243
.RuleFor(c => c.FirstName, f => f.Name.FirstName())
244244
.RuleFor(c => c.LastName, f => f.Name.LastName());
245245
app.Children = childFaker.Generate(1);
246+
app.CardRequestedAt = now.AddDays(-7);
246247
}
247248
});
248249
review.Email = reviewEmail;
@@ -253,6 +254,7 @@ private void SeedMockData()
253254
var nonCoLoadedEmail = _settings.BuildEmail(SeedScenarios.NonCoLoaded.Name);
254255
var nonCoLoaded = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Pending, h =>
255256
{
257+
h.BenefitIssuanceType = BenefitIssuanceType.SummerEbt;
256258
var app = h.Applications.FirstOrDefault();
257259
if (app != null)
258260
{
@@ -261,13 +263,7 @@ private void SeedMockData()
261263
new Child { CaseNumber = 555001, FirstName = "Emma", LastName = "Garcia" }
262264
};
263265
}
264-
h.AddressOnFile = new Address
265-
{
266-
StreetAddress1 = "789 In-Progress Lane",
267-
City = "Denver",
268-
State = "CO",
269-
PostalCode = "80204"
270-
};
266+
h.AddressOnFile = null;
271267
});
272268
nonCoLoaded.Email = nonCoLoadedEmail;
273269
nonCoLoaded.Phone = "555-123-4567";
@@ -278,6 +274,7 @@ private void SeedMockData()
278274
var notStartedEmail = _settings.BuildEmail(SeedScenarios.NotStarted.Name);
279275
var notStarted = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Pending, h =>
280276
{
277+
h.BenefitIssuanceType = BenefitIssuanceType.TanfEbtCard;
281278
var app = h.Applications.FirstOrDefault();
282279
if (app != null)
283280
{
@@ -316,7 +313,7 @@ private void SeedMockData()
316313

317314
// Scenario 7: Approved with single child
318315
var singleChildEmail = _settings.BuildEmail(SeedScenarios.SingleChild.Name);
319-
var singleChild = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Approved, h =>
316+
var singleChild = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Pending, h =>
320317
{
321318
h.BenefitIssuanceType = BenefitIssuanceType.SummerEbt;
322319
var app = h.Applications.FirstOrDefault();
@@ -337,14 +334,15 @@ private void SeedMockData()
337334

338335
// Scenario 8: Large family (multiple children)
339336
var largeFamilyEmail = _settings.BuildEmail(SeedScenarios.LargeFamily.Name);
340-
var largeFamily = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Approved, h =>
337+
var largeFamily = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Unknown, h =>
341338
{
342-
h.BenefitIssuanceType = BenefitIssuanceType.TanfEbtCard;
339+
h.BenefitIssuanceType = BenefitIssuanceType.SummerEbt;
343340
var app = h.Applications.FirstOrDefault();
344341
if (app != null)
345342
{
346343
app.BenefitIssueDate = now.AddDays(-45);
347344
app.BenefitExpirationDate = now.AddDays(45);
345+
app.Last4DigitsOfCard = "4321";
348346
// Set specific children names for test
349347
app.Children = new List<Child>
350348
{
@@ -354,6 +352,14 @@ private void SeedMockData()
354352
new Child { CaseNumber = 222004, FirstName = "Emily", LastName = "Brown" }
355353
};
356354
}
355+
h.AddressOnFile = new Address
356+
{
357+
StreetAddress1 = "456 Large Family Lane",
358+
StreetAddress2 = "Unit 8",
359+
City = "Aurora",
360+
State = "CO",
361+
PostalCode = "80010"
362+
};
357363
});
358364
largeFamily.Email = largeFamilyEmail;
359365
largeFamily.UserProfile = new UserProfile { FirstName = "Christopher", MiddleName = "Michael", LastName = "Brown" };
@@ -377,9 +383,9 @@ private void SeedMockData()
377383

378384
// Scenario 10: Expired benefits
379385
var expiredEmail = _settings.BuildEmail(SeedScenarios.Expired.Name);
380-
var expired = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Approved, h =>
386+
var expired = HouseholdFactory.CreateHouseholdDataWithStatus(ApplicationStatus.Unknown, h =>
381387
{
382-
h.BenefitIssuanceType = BenefitIssuanceType.SnapEbtCard;
388+
h.BenefitIssuanceType = BenefitIssuanceType.SummerEbt;
383389
var app = h.Applications.FirstOrDefault();
384390
if (app != null)
385391
{

test/SEBT.Portal.Tests/Unit/Repositories/MockHouseholdRepositoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public async Task GetHouseholdByEmailAsync_ExpiredScenario_HasExpiredBenefits()
478478
var app = result.Applications.First();
479479
Assert.NotNull(app.BenefitExpirationDate);
480480
Assert.True(app.BenefitExpirationDate < _timeProvider.GetUtcNow().UtcDateTime);
481-
Assert.Equal(ApplicationStatus.Approved, app.ApplicationStatus);
481+
Assert.Equal(ApplicationStatus.Unknown, app.ApplicationStatus);
482482
}
483483

484484
[Fact]

0 commit comments

Comments
 (0)