示例#1
0
        public void From_decimal_to_integer()
        {
            // Arrange
            var c = new StringFormatConverter(typeof(int), "F0");

            // Act
            var result = c.FieldToString(1234.5678m);

            // Assert
            Assert.AreEqual("1235", result);
        }
示例#2
0
        public void From_decimal()
        {
            // Arrange
            var c = new StringFormatConverter(typeof(decimal), "F2");

            // Act
            var result = c.FieldToString(1234.5678m);

            // Assert
            Assert.AreEqual("1234.57", result);
        }