public void Retrieve_correct_nullable_value(string value, bool?expectation)
        {
            var retriever = new BoolValueRetriever();
            var result    = (bool?)retriever.Retrieve(new KeyValuePair <string, string>(IrrelevantKey, value), IrrelevantType, typeof(bool?));

            result.Should().Be(expectation);
        }
        public void CanRetrieve(Type type, bool expectation)
        {
            var retriever = new BoolValueRetriever();
            var result    = retriever.CanRetrieve(new KeyValuePair <string, string>(IrrelevantKey, IrrelevantKey), IrrelevantType, type);

            result.Should().Be(expectation);
        }
Exemple #3
0
        public void Returns_false_for_data_that_is_not_bool()
        {
            var retriever = new BoolValueRetriever();

            retriever.GetValue("sssssdfsd").Should().BeFalse();
            retriever.GetValue(null).Should().BeFalse();
            retriever.GetValue("").Should().BeFalse();
            retriever.GetValue("this is false").Should().BeFalse();
        }
Exemple #4
0
        public void Returns_true_when_the_value_is_true()
        {
            var retriever = new BoolValueRetriever();

            retriever.GetValue("true").Should().BeTrue();
        }
Exemple #5
0
        public void Returns_false_when_the_value_is_False()
        {
            var retriever = new BoolValueRetriever();

            retriever.GetValue("False").Should().BeFalse();
        }