public void ConvertOptionInput_Negative_Test(CommandOptionInput optionInput, Type targetType) { // Arrange var converter = new CommandOptionInputConverter(); // Act & Assert converter.Invoking(c => c.ConvertOptionInput(optionInput, targetType)) .Should().ThrowExactly <CliFxException>(); }
public void ConvertOptionInput_Test(CommandOptionInput optionInput, Type targetType, object expectedConvertedValue) { // Arrange var converter = new CommandOptionInputConverter(); // Act var convertedValue = converter.ConvertOptionInput(optionInput, targetType); // Assert convertedValue.Should().BeEquivalentTo(expectedConvertedValue); convertedValue?.Should().BeAssignableTo(targetType); }