Skip to content

Commit d5915a5

Browse files
HandyS11claude
andcommitted
test+style: tighten 6b upkeep/decay tests + resx period consistency (6b review)
- EmbeddedItemDatabaseTests: Assert.Single on WoodenDoor upkeep entry with ItemId/QuantityMin/QuantityMax - DecayFormatterTests: add DecayLine_ShowsDashAndHpWhenNoDecaySeconds fact; assert HP(250) in variant test - Strings.resx + Strings.fr.resx: append period to help.slash.decay and help.slash.upkeep values Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cd8d54d commit d5915a5

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/RustPlusBot.Localization/Strings.fr.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
<value>Afficher le coût de recherche (ferraille) d'un objet</value>
416416
</data>
417417
<data name="help.slash.decay" xml:space="preserve">
418-
<value>Affiche le temps de dégradation d'un objet</value>
418+
<value>Affiche le temps de dégradation d'un objet.</value>
419419
</data>
420420
<data name="help.slash.help" xml:space="preserve">
421421
<value>Afficher ce message d'aide.</value>
@@ -436,7 +436,7 @@
436436
<value>Afficher le coût de recherche (ferraille) d'un objet.</value>
437437
</data>
438438
<data name="help.slash.upkeep" xml:space="preserve">
439-
<value>Affiche le coût d'entretien d'un bloc de construction</value>
439+
<value>Affiche le coût d'entretien d'un bloc de construction.</value>
440440
</data>
441441
<data name="help.slash.uptime" xml:space="preserve">
442442
<value>Afficher la disponibilité du bot.</value>

src/RustPlusBot.Localization/Strings.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
<value>Show an item's research scrap cost</value>
416416
</data>
417417
<data name="help.slash.decay" xml:space="preserve">
418-
<value>Show an item's decay time</value>
418+
<value>Show an item's decay time.</value>
419419
</data>
420420
<data name="help.slash.help" xml:space="preserve">
421421
<value>Show this help message.</value>
@@ -436,7 +436,7 @@
436436
<value>Show an item's research scrap cost.</value>
437437
</data>
438438
<data name="help.slash.upkeep" xml:space="preserve">
439-
<value>Show a building block's upkeep cost</value>
439+
<value>Show a building block's upkeep cost.</value>
440440
</data>
441441
<data name="help.slash.uptime" xml:space="preserve">
442442
<value>Show the bot's uptime.</value>

tests/RustPlusBot.Features.Commands.Tests/Formatting/DecayFormatterTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,16 @@ public void DecayLine_ShowsVariantsWhenPresent()
2424
var line = DecayLine.Format(item);
2525
Assert.Contains("outside", line, StringComparison.Ordinal);
2626
Assert.Contains("inside", line, StringComparison.Ordinal);
27+
Assert.Contains("250", line, StringComparison.Ordinal);
28+
}
29+
30+
[Fact]
31+
public void DecayLine_ShowsDashAndHpWhenNoDecaySeconds()
32+
{
33+
var item = new ItemRecord(1, "Thing", 1, null, null, null, null,
34+
new DecayInfo(null, null, null, null, 100), null);
35+
var line = DecayLine.Format(item);
36+
Assert.Contains("—", line, StringComparison.Ordinal);
37+
Assert.Contains("100", line, StringComparison.Ordinal);
2738
}
2839
}

tests/RustPlusBot.Features.ItemData.Tests/EmbeddedItemDatabaseTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ public void GetById_WoodenDoor_HasUpkeep()
7272
var rec = _db.GetById(1729120840);
7373
Assert.NotNull(rec);
7474
Assert.NotNull(rec!.Upkeep);
75-
Assert.NotEmpty(rec.Upkeep!.Entries);
75+
var entry = Assert.Single(rec.Upkeep!.Entries);
76+
Assert.Equal(-151838493, entry.ItemId);
77+
Assert.Equal(30, entry.QuantityMin);
78+
Assert.Equal(100, entry.QuantityMax);
7679
}
7780

7881
[Fact]

0 commit comments

Comments
 (0)