我知道很多人都有不同的想法。
public class UiField<ContentType>
{
public bool IsEnabled { get; set; }
public ContentType Value { get; set; }
public bool IsVisible { get; set; }
}
在你看来,那么:
public interface ISampleView
{
UiField<bool> IsStaffFullTime { get; set; }
UiField<string> StaffName { get; set; }
UiField<string> JobTitle { get; set; }
UiField<int> StaffAge { get; set; }
UiField<IList<string>> Certifications { get; set; }
}
顺便说一句,我建议您不要手动对这些接口进行存根测试——使用模拟框架。