From a88e98176fae0556e88cad412c8a62b6f7ab4efc Mon Sep 17 00:00:00 2001 From: agentic-dev agent Date: Sun, 22 Nov 2026 19:25:04 +0000 Subject: [PATCH 1/3] Add Phoenix Feather item kind Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Core/ProposedCode/Domain/ItemKind.cs | 5 ++++- tests/Core.Tests/ProposedCode/Domain/ItemKindTests.cs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Core/ProposedCode/Domain/ItemKind.cs b/src/Core/ProposedCode/Domain/ItemKind.cs index 199f351..7341096 100644 --- a/src/Core/ProposedCode/Domain/ItemKind.cs +++ b/src/Core/ProposedCode/Domain/ItemKind.cs @@ -16,6 +16,8 @@ public sealed record Backstage : ItemKind; public sealed record Conjured : ItemKind; + public sealed record PhoenixFeather : ItemKind; + public sealed record Sulfuras : ItemKind; public static ItemKind FromName(string itemName) @@ -28,8 +30,9 @@ public static ItemKind FromName(string itemName) "Backstage" => new Backstage(), "Conjured Mana Cake" => new Conjured(), "Conjured" => new Conjured(), + "Phoenix Feather" => new PhoenixFeather(), "Sulfuras, Hand of Ragnaros" => new Sulfuras(), _ => new Standard(), }; } -} \ No newline at end of file +} diff --git a/tests/Core.Tests/ProposedCode/Domain/ItemKindTests.cs b/tests/Core.Tests/ProposedCode/Domain/ItemKindTests.cs index 040e12d..d2db8b1 100644 --- a/tests/Core.Tests/ProposedCode/Domain/ItemKindTests.cs +++ b/tests/Core.Tests/ProposedCode/Domain/ItemKindTests.cs @@ -17,6 +17,7 @@ public class ItemKindTests [InlineData("Backstage", typeof(ItemKind.Backstage))] [InlineData("Conjured Mana Cake", typeof(ItemKind.Conjured))] [InlineData("Conjured", typeof(ItemKind.Conjured))] + [InlineData("Phoenix Feather", typeof(ItemKind.PhoenixFeather))] [InlineData("Sulfuras, Hand of Ragnaros", typeof(ItemKind.Sulfuras))] [InlineData("Elixir of the Mongoose", typeof(ItemKind.Standard))] public void FromName_MapsNamesToExpectedKinds(string itemName, Type expectedType) @@ -25,4 +26,4 @@ public void FromName_MapsNamesToExpectedKinds(string itemName, Type expectedType result.Should().BeOfType(expectedType); } -} \ No newline at end of file +} From bcb8dfd0e40ad0d81996809f0e858cb9e8213b36 Mon Sep 17 00:00:00 2001 From: agentic-dev agent Date: Sun, 22 Nov 2026 19:25:34 +0000 Subject: [PATCH 2/3] Implement Phoenix Feather maturation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Core/ProposedCode/Domain/ItemKind.cs | 5 ++++- .../ProposedCode/Domain/ItemMaturingPolicy.cs | 16 +++++++++++++++- .../Domain/ItemMaturingPolicyTests.cs | 16 +++++++++++++++- .../ProposedCode/ItemMaturationServiceTests.cs | 4 +++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/Core/ProposedCode/Domain/ItemKind.cs b/src/Core/ProposedCode/Domain/ItemKind.cs index 199f351..3dbb7bd 100644 --- a/src/Core/ProposedCode/Domain/ItemKind.cs +++ b/src/Core/ProposedCode/Domain/ItemKind.cs @@ -18,6 +18,8 @@ public sealed record Conjured : ItemKind; public sealed record Sulfuras : ItemKind; + public sealed record PhoenixFeather : ItemKind; + public static ItemKind FromName(string itemName) { return itemName switch @@ -29,7 +31,8 @@ public static ItemKind FromName(string itemName) "Conjured Mana Cake" => new Conjured(), "Conjured" => new Conjured(), "Sulfuras, Hand of Ragnaros" => new Sulfuras(), + "Phoenix Feather" => new PhoenixFeather(), _ => new Standard(), }; } -} \ No newline at end of file +} diff --git a/src/Core/ProposedCode/Domain/ItemMaturingPolicy.cs b/src/Core/ProposedCode/Domain/ItemMaturingPolicy.cs index 0221621..2cd7e49 100644 --- a/src/Core/ProposedCode/Domain/ItemMaturingPolicy.cs +++ b/src/Core/ProposedCode/Domain/ItemMaturingPolicy.cs @@ -15,6 +15,7 @@ public ItemState Mature(ItemKind kind, ItemState state) ItemKind.AgedBrie => this.MatureAgedBrie(state), ItemKind.Backstage => this.MatureBackstage(state), ItemKind.Conjured => this.MatureConjured(state), + ItemKind.PhoenixFeather => this.MaturePhoenixFeather(state), ItemKind.Sulfuras => state, _ => this.MatureStandard(state), }; @@ -77,4 +78,17 @@ private ItemState MatureConjured(ItemState state) return new(newQuality, newSellIn); } -} \ No newline at end of file + + private ItemState MaturePhoenixFeather(ItemState state) + { + var newQuality = state.Quality.Increase(2); + var newSellIn = state.SellIn.NextDay(); + + if (newSellIn.IsExpired) + { + newQuality = newQuality.Increase(2); + } + + return new(newQuality, newSellIn); + } +} diff --git a/tests/Core.Tests/ProposedCode/Domain/ItemMaturingPolicyTests.cs b/tests/Core.Tests/ProposedCode/Domain/ItemMaturingPolicyTests.cs index 55d645c..1360e8a 100644 --- a/tests/Core.Tests/ProposedCode/Domain/ItemMaturingPolicyTests.cs +++ b/tests/Core.Tests/ProposedCode/Domain/ItemMaturingPolicyTests.cs @@ -80,6 +80,20 @@ public void Mature_WhenKindIsConjured_FollowsExpectedRules(int quality, int sell result.SellIn.Value.Should().Be(expectedSellIn); } + [Theory] + [InlineData(10, 5, 12, 4)] + [InlineData(10, 0, 14, -1)] + [InlineData(49, 0, 50, -1)] + public void Mature_WhenKindIsPhoenixFeather_FollowsExpectedRules(int quality, int sellIn, int expectedQuality, int expectedSellIn) + { + var state = new ItemState(new Quality(quality), new SellIn(sellIn)); + + var result = this.policy.Mature(new ItemKind.PhoenixFeather(), state); + + result.Quality.Value.Should().Be(expectedQuality); + result.SellIn.Value.Should().Be(expectedSellIn); + } + [Fact] public void Mature_WhenKindIsSulfuras_PreservesProvidedState() { @@ -89,4 +103,4 @@ public void Mature_WhenKindIsSulfuras_PreservesProvidedState() result.Should().Be(state); } -} \ No newline at end of file +} diff --git a/tests/Core.Tests/ProposedCode/ItemMaturationServiceTests.cs b/tests/Core.Tests/ProposedCode/ItemMaturationServiceTests.cs index 4690ec6..a6aea77 100644 --- a/tests/Core.Tests/ProposedCode/ItemMaturationServiceTests.cs +++ b/tests/Core.Tests/ProposedCode/ItemMaturationServiceTests.cs @@ -20,6 +20,7 @@ public class ItemMaturationServiceTests [InlineData("Conjured Mana Cake", 10, 5, 8, 4)] [InlineData("Conjured", 10, 0, 6, -1)] [InlineData("Sulfuras, Hand of Ragnaros", 80, 0, 80, 0)] + [InlineData("Phoenix Feather", 10, 5, 12, 4)] public void Mature_UsesExpectedRulesForResolvedItemKinds(string name, int quality, int sellIn, int expectedQuality, int expectedSellIn) { var service = new ItemMaturationService(); @@ -32,7 +33,8 @@ public void Mature_UsesExpectedRulesForResolvedItemKinds(string name, int qualit var result = service.Mature(item); + result.Name.Should().Be(name); result.Quality.Should().Be(expectedQuality); result.SellIn.Should().Be(expectedSellIn); } -} \ No newline at end of file +} From 8f39950c5ff7c5f0b2417e8299f45bef4a3d7d8c Mon Sep 17 00:00:00 2001 From: agentic-dev agent Date: Sun, 22 Nov 2026 19:27:32 +0000 Subject: [PATCH 3/3] Remove duplicate PhoenixFeather entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Core/ProposedCode/Domain/ItemKind.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Core/ProposedCode/Domain/ItemKind.cs b/src/Core/ProposedCode/Domain/ItemKind.cs index 0bb11bc..7341096 100644 --- a/src/Core/ProposedCode/Domain/ItemKind.cs +++ b/src/Core/ProposedCode/Domain/ItemKind.cs @@ -20,8 +20,6 @@ public sealed record PhoenixFeather : ItemKind; public sealed record Sulfuras : ItemKind; - public sealed record PhoenixFeather : ItemKind; - public static ItemKind FromName(string itemName) { return itemName switch @@ -34,7 +32,6 @@ public static ItemKind FromName(string itemName) "Conjured" => new Conjured(), "Phoenix Feather" => new PhoenixFeather(), "Sulfuras, Hand of Ragnaros" => new Sulfuras(), - "Phoenix Feather" => new PhoenixFeather(), _ => new Standard(), }; }