?????????????????????
???????????? ???????[ 2013/3/15 10:56:41 ] ????????
??????????????????????????????????????????????????????????????????????????????????????????????????????
public Product Map(ProductDto productDto)
{
var product = new Product()
{
ID = productDto.ID??
Name = productDto.ProductName??
BasePrice = productDto.Price
};
return product;
}
??????????????????д??????????????????ж??????б????????????????д?????????????
[TestMethod]
public void ProductMapperMapsToExpectedProperties()
{
// Arrange
var mapper = new ProductMapper();
var productDto = new ProductDto()
{
ID = "sp-001"??
Price = 10m??
ProductName = "Super Product"
};
// Act
Product product = mapper.Map(productDto);
// Assert
Assert.AreEqual(10m?? product.BasePrice);
Assert.AreEqual("sp-001"?? product.ID);
Assert.AreEqual("Super Product"?? product.Name);
}
????4????д?????д????
???????????????????????????????????????????????????????????????????????Ч?????????????????????????????????????????????????д??????????????????????????????????????????????С?????????д???????????????????????????????
????????????????д?????д?????????????????????????????д????????????????????
?????????????????????????????????Щ????TDD??????????The String Calculator Code Kata??
????5?????????
??????????????????????
public Product GetByID(string id)
{
return _productRepository.GetByID(id);
}
????????????????????????????????????????
?????????????????????????????????е?????????????????????????????????????????貢???????????????????б????????????????????????????????????????????????????塣
??????????????????????????????????????????????????д?κβ?????????????ɡ????????????????????????????????????????????????geter??setter???????????????????????????????????????????????????
???????????????IF??And??Or??Case??For??While??????д????????????????
????????????????????κ???????????????????????????????????
????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11