Example #1
0
        public void Retrieve_correct_nullable_value(string value, double?expectation)
        {
            var retriever = new DoubleValueRetriever();
            var result    = (double?)retriever.Retrieve(new KeyValuePair <string, string>(IrrelevantKey, value), IrrelevantType, typeof(double?));

            result.Should().Be(expectation);
        }
Example #2
0
        public void Retrieve_a_double_when_passed_a_double_value_if_culture_is_fr_Fr()
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR", false);

            var retriever = new DoubleValueRetriever();
            var result    = (double?)retriever.Retrieve(new KeyValuePair <string, string>(IrrelevantKey, "384,234879"), IrrelevantType, typeof(double?));

            result.Should().Be(384.234879d);
        }