是一个具有属性但没有逻辑单元可测试的类? [关闭]

问题描述 投票:1回答:1

我有一个课程如下。这是单独测试的候选者吗?我可以为这堂课写什么样的考试/报道?

public class Cart : ICart
{
    public int Id { get; set; }
    public ABCCompany Company { get; set; }
    public decimal Subtotal { get; set; }
    public decimal DiscountValue { get; set; }
    public decimal DiscountedSubtotal{ get; set; }
    public ICartDiscounts Discounts { get; set; }
    public IList<ICartItem> Items { get; set; }
}
c# .net unit-testing xunit
1个回答
8
投票

没有逻辑可以测试......不;它不是真正的单元可测试的。

人们可以争辩说,吸气剂和制定者可以进行测试;但这样做确实没有意义,因为逻辑是提供的框架。

© www.soinside.com 2019 - 2024. All rights reserved.