public void Retrieve_correct_nullable_value(string value, double?expectation) { var retriever = new DecimalValueRetriever(); var result = (decimal?)retriever.Retrieve(new KeyValuePair <string, string>(IrrelevantKey, value), IrrelevantType, typeof(decimal?)); result.Should().Be((decimal?)expectation); }
public void Retrieve_a_decimal_when_passed_a_decimal_value_if_culture_is_fr_Fr() { Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR", false); var retriever = new DecimalValueRetriever(); var result = (decimal?)retriever.Retrieve(new KeyValuePair <string, string>(IrrelevantKey, "384,234879"), IrrelevantType, typeof(decimal?)); result.Should().Be(384.234879m); }