我正在尝试测试我的服务。当我运行测试时,它显示此错误并且测试失败。我的Unity配置类在我的asp.net mvc项目中,我的测试在不同的项目中,我不知道我在哪里做错了。
无法获取Class servicetest的默认构造函数
barplot(sort(table(BartRider$DualInc), decreasing = TRUE), main = "Bar plot XYZ")
[TestClass]
public class ImportServiceTests
{
private readonly IImportService _importService;
private readonly IUnitOfWork _unitOfWork;
public ImportServiceTests(IImportService importService, IUnitOfWork unitOfWork)
{
_importService = importService;
_unitOfWork = unitOfWork;
}
[TestMethod]
public void ImportCategories()
{
string filePath = Path.GetFullPath(@"E:\categories.xlsx");
if (File.Exists(filePath))
{
Stream data = File.OpenRead(filePath);
string fileName = Path.GetFileName(filePath);
_importService.ImportCategoriesFromXlsx(data);
}
}
}