コード例 #1
0
        public void When_formatter_scanning_is_disabled_it_should_use_the_default_formatters()
        {
            // Arrange
            Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Disabled;

            var subject = new SomeClassWithCustomFormatter
            {
                Property = "SomeValue"
            };

            // Act
            string result = Formatter.ToString(subject);

            // Assert
            result.Should().Be(subject.ToString());
        }
コード例 #2
0
        public void When_no_custom_formatter_exists_in_the_specified_assembly_it_should_use_the_default()
        {
            // Arrange
            Configuration.Current.ValueFormatterAssembly = "FluentAssertions";

            var subject = new SomeClassWithCustomFormatter
            {
                Property = "SomeValue"
            };

            // Act
            string result = Formatter.ToString(subject);

            // Assert
            result.Should().Be(subject.ToString());
        }
コード例 #3
0
        public void When_no_formatter_scanning_is_configured_it_should_use_the_default_formatters()
        {
            //-----------------------------------------------------------------------------------------------------------
            // Arrange
            //-----------------------------------------------------------------------------------------------------------
            Services.ResetToDefaults();

            var subject = new SomeClassWithCustomFormatter
            {
                Property = "SomeValue"
            };

            //-----------------------------------------------------------------------------------------------------------
            // Act
            //-----------------------------------------------------------------------------------------------------------
            string result = Formatter.ToString(subject);

            //-----------------------------------------------------------------------------------------------------------
            // Assert
            //-----------------------------------------------------------------------------------------------------------
            result.Should().Be(subject.ToString());
        }