Argument Null exception on name
continuous-integration/drone/push Build is passing Details

test_dice_group_manager
mohammad_zafir.jeeawody 3 years ago
parent c9cb17899e
commit 0f1f253746

@ -126,6 +126,21 @@ namespace Tests.Data_UTs.Dice
Xunit.Assert.Throws<NotImplementedException>(action); Xunit.Assert.Throws<NotImplementedException>(action);
} }
[Theory]
[InlineData("")]
[InlineData(null)]
[InlineData(" ")]
public void TestGetOneByNameIfInvalidThrowsException(string name)
{
// Arrange
DiceGroupManager dgm = new();
KeyValuePair<string, IEnumerable<Die>> toAdd = new("Monopoly", new List<NumberDie> { new NumberDie(new NumberFace(5), new NumberFace(7)), new NumberDie(new NumberFace(5), new NumberFace(7)) });
dgm.Add(toAdd);
void action() => dgm.GetOneByName(name);
// Assert
Xunit.Assert.Throws<ArgumentNullException>(action);
}

Loading…
Cancel
Save