示例#1
0
        public void ShouldconvertFromStringToItem()
        {
            Item expected = new Item()
            {
                Id          = 1,
                Name        = "Bob",
                Cost        = 1.5m,
                Description = "It's bob you guys"
            };
            string input = "1::Bob::It's bob you guys::1.50";
            //Act
            Item actual = ItemMapper.ToObject(input);

            //Assert
            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void ShouldConvertItemToCSV()
        {
            //Arrange
            Item item = new Item()
            {
                Id          = 1,
                Name        = "Bob",
                Cost        = 1.5m,
                Description = "It's bob you guys"
            };
            string expected = "1::Bob::It's bob you guys::1.50";
            //Act
            string actual = ItemMapper.ToStringCsv(item);

            //Assert
            Assert.AreEqual(expected, actual);
        }