コード例 #1
0
 public void ShouldHaveNullResultWhenConverting()
 {
     GivenDataDictionary = new Dictionary <string, object> {
         { "Name", "Jane Doe" }
     };
     WhenConverting();
     ThenResult.Should().BeNull();
     ThenSuccess.Should().BeFalse();
 }
コード例 #2
0
        public void ShouldHaveNullResultWhenConvertingGivenNoValidConverters()
        {
            GivenDataDictionary = new Dictionary <string, object> {
                { "Name", "Jane Doe" }
            };
            GivenConversionTo = typeof(string);

            WhenConverting();

            ThenResult.Should().BeNull();
            ThenSuccess.Should().BeFalse();
        }
コード例 #3
0
        public void ShouldHaveValidResultWhenConvertingToAKnownConverterType()
        {
            GivenDataDictionary = new Dictionary <string, object> {
                { "Name", "Jane Doe" }
            };
            GivenConversionTo = typeof(string);
            GivenConverter    = dct => string.Join(", ", dct.Keys.Select(key => key + "=" + dct[key]));

            WhenConverting();

            ThenSuccess.Should().BeTrue();
            ThenResult.Should().BeAssignableTo <string>();
            ThenResult.Should().NotBeNull().And.Be("Name=Jane Doe");
        }