Код: Выделить всё
public class GetRolesQuery : GenericDetailsPaginatedQueryBase
{
public string[] OrganizationIds { get; set; } = [];
public DateTime? FromDate { get; set; }
public DateTime? ToDate { get; set; }
}
Код: Выделить всё
public class GetRolesQueryValidator : AbstractValidator
{
private readonly IGenericMongoDbRepository _repository;
public GetRolesQueryValidator(IGenericMongoDbRepository repository)
{
_repository = repository;
RuleFor(x => x)
.Must(x => x.FromDate x.FromDate != null && x.ToDate != null);
}
}
Я получаю частичное покрытие для этого x.FromDate
Подробнее здесь: https://stackoverflow.com/questions/793 ... -the-cases
Мобильная версия