Skip to content

Commit

Permalink
feat(corpses): add ms bob to the graveyard
Browse files Browse the repository at this point in the history
  • Loading branch information
victorfrye committed Jan 26, 2024
1 parent 195dafb commit 4f45d4e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Client/Models/Corpse.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/Client/wwwroot/data/corpses.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
8 changes: 7 additions & 1 deletion tests/Unit/Models/CorpseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4f45d4e

Please sign in to comment.