public static bool TryParse(string value, out OfxEntryType result) { result = (value.ToUpper()) switch { "DEBIT" => OfxEntryType.Debit, "CREDIT" => OfxEntryType.Credit }; return(Enum.IsDefined(typeof(OfxEntryType), result)); } }
public void TryParseOfxEntryType_ShouldReturnTrueWhenValueCorrect(string strValue, OfxEntryType expectedType) { var result = OfxValuesParser.TryParse(strValue, out OfxEntryType parsedValue); result.Should().BeTrue(); parsedValue.Should().Be(expectedType); }