From 4f45d4e2f31638bf88fe5cf7577bc2b845856304 Mon Sep 17 00:00:00 2001 From: Victor Frye Date: Fri, 26 Jan 2024 08:03:13 -0500 Subject: [PATCH] feat(corpses): add ms bob to the graveyard --- src/Client/Models/Corpse.cs | 5 ++--- src/Client/wwwroot/data/corpses.json | 7 +++++++ tests/Unit/Models/CorpseTests.cs | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Client/Models/Corpse.cs b/src/Client/Models/Corpse.cs index 5daf61c..13abfab 100644 --- a/src/Client/Models/Corpse.cs +++ b/src/Client/Models/Corpse.cs @@ -1,10 +1,9 @@ -using System.Text; - namespace VictorFrye.MicrosoftGraveyard.Client.Models; +using System.Text; + public class Corpse(string name, string? qualifier, DateOnly? birthDate, DateOnly deathDate, string description, string link) { - public string Slug { get; init; } = $"{name}-{qualifier}".ToLower().Replace(" ", "-"); public string Name { get; init; } = name; public string? Qualifier { get; init; } = qualifier; public DateOnly? BirthDate { get; init; } = birthDate; diff --git a/src/Client/wwwroot/data/corpses.json b/src/Client/wwwroot/data/corpses.json index 79579b8..11cd8bd 100644 --- a/src/Client/wwwroot/data/corpses.json +++ b/src/Client/wwwroot/data/corpses.json @@ -434,6 +434,13 @@ "deathDate": "2001-12-31", "description": "a major release of the Windows operating system in 1995 and the first of the Windows 9x family", "link": "https://en.wikipedia.org/wiki/Windows_95" + }, + { + "name": "Bob", + "birthDate": "1995-03-10", + "deathDate": "1996-01-01", + "description": "a Microsoft project intended to provide a personalized alternative interface for the Windows operating system", + "link": "https://www.youtube.com/watch?v=rXHu9OmLd8Y" } ] } diff --git a/tests/Unit/Models/CorpseTests.cs b/tests/Unit/Models/CorpseTests.cs index 85f466f..95407a2 100644 --- a/tests/Unit/Models/CorpseTests.cs +++ b/tests/Unit/Models/CorpseTests.cs @@ -190,7 +190,13 @@ public void ShouldReturnObituaryWhenToBeKilledInTwoMonthsMinusADay() Assert.Equal(expected, actual); } - private static Corpse NewMockCorpse(string name = "Test Corpse", string? qualifier = null, DateOnly? birthDate = null, DateOnly? deathDate = null, string description = "nice words said", string link = "https://somelink.com") + private static Corpse NewMockCorpse( + string name = "Test Corpse", + string? qualifier = null, + DateOnly? birthDate = null, + DateOnly? deathDate = null, + string description = "nice words said", + string link = "https://somelink.com") { return new( name,