feat: solve part 1

This commit is contained in:
Stevan Freeborn
2023-12-07 14:06:26 -06:00
parent 4621e17a8e
commit a84b0d07f0
9 changed files with 578 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
namespace CamelCards.Tests;
public class CardTests
{
[Theory]
[InlineData('A', 12)]
[InlineData('K', 11)]
[InlineData('Q', 10)]
[InlineData('J', 9)]
[InlineData('T', 8)]
[InlineData('9', 7)]
[InlineData('8', 6)]
[InlineData('7', 5)]
[InlineData('6', 4)]
[InlineData('5', 3)]
[InlineData('4', 2)]
[InlineData('3', 1)]
[InlineData('2', 0)]
public void Card_WhenGivenValidCharacter_ItShouldReturnCardWithExpectedStrength(char character, int expectedStrength)
{
var card = new Card(character);
card.Strength.Should().Be(expectedStrength);
}
[Fact]
public void Card_WhenGivenInvalidCardCharacter_ItShouldThrowArgumentException()
{
Action act = () => new Card('X');
act.Should().Throw<ArgumentException>();
}
}