Beispiel #1
0
        public void Format_WhenRegisteredFormatterInterfaceIsFound_ItUsesTheFormatter()
        {
            var formatter = new FakeIntFormatter();

            formatterManager.Register(typeof(int), formatter);
            var value  = 10;
            var actual = formatterManager.Format("TableC", "ColumnC", value);

            actual.Should().Be("int-formatter");
            formatter.LastValue.Should().Be(10);
        }
Beispiel #2
0
        public void Format_When_there_is_a_register_formatter_interface_It_must_be_used()
        {
            var formatter = new FakeIntFormatter();

            _target.Register(typeof(int), formatter);
            int value  = 10;
            var actual = _target.Format("TableC", "ColumnC", value);

            Assert.AreEqual("int-formatter", actual);
            Assert.AreEqual(10, formatter.LastValue);
        }