Ejemplo n.º 1
0
        public void Parse_Uses_Configured_Type_Converter(string input)
        {
            // Arrange
            ParserContainer parser = ParserContainer.Create(config =>
            {
                config.UseTypeConverter <TestClassWithTypeConverter>();
            });

            // Act
            TestClassWithTypeConverter obj = parser.For <TestClassWithTypeConverter>().Parse(input);

            // Assert
            Assert.That(obj.Value, Is.EqualTo(input));
        }
Ejemplo n.º 2
0
        public void Format_Uses_Configured_Type_Converter(string input)
        {
            // Arrange
            FormatterContainer formatter = FormatterContainer.Create(config =>
            {
                config.UseTypeConverter <TestClassWithTypeConverter>();
            });
            TestClassWithTypeConverter obj = new TestClassWithTypeConverter(input);

            // Act
            string result = formatter.For <TestClassWithTypeConverter>().Format(obj);

            // Assert
            Assert.That(result, Is.EqualTo(input));
        }