【发布时间】:2020-09-06 21:39:13
【问题描述】:
我是 Autofixture 的新手,但我非常喜欢它提供的功能。
我有一个类可以处理不同类型的推送通知,对于每种可能的类型,我都有一个 Enum。 我希望 Autofixture 为每种枚举类型创建一个对象,但还不能这样做。
我的简单通知类如下所示:
public class PushNotificationModel
{
public string CustomerId { get; set; }
public EPushNotifications NotificationType { get; set; }
public bool EnableNotification { get; set; }
}
使用枚举:
public enum EPushNotifications
{
DailyConsumption,
WeeklyConsumption,
MonthlyConsumption,
QuarterlyConsumption,
Marketing
}
之后我使用 XUnit 进行断言。
非常感谢任何帮助! :)
【问题讨论】:
标签: xunit autofixture