public async System.Threading.Tasks.Task DownLoadFile_NonexitingFile() { var options = new DbContextOptionsBuilder <ChemiCleanContext>() .UseSqlServer(connectionString) .Options; var dbContext = new ChemiCleanContext(options); ProductsRepository productsRepository = new ProductsRepository(dbContext); ProductsService productsService = new ProductsService(productsRepository); var NonExistingFile = await productsService.DownloadFile(0); Assert.Null(NonExistingFile); }
public async System.Threading.Tasks.Task DownLoadFile_NonexitingURL() { var options = new DbContextOptionsBuilder <ChemiCleanContext>() .UseSqlServer(connectionString) .Options; var dbContext = new ChemiCleanContext(options); ProductsRepository productsRepository = new ProductsRepository(dbContext); ProductsService productsService = new ProductsService(productsRepository); var product = productsRepository.GetProducts().FirstOrDefault(); if (product != null) { product.Url = "None"; productsRepository.Commit(); } var NonExistingFile = await productsService.DownloadFile(product.Id); Assert.Null(NonExistingFile); }