public void FileParserService_FileParserService_ContentOk_Ok() { var fileParserService = new FileParserService(); using (var stream = new FileStream("Content/MOCK_DATA - 2.csv", FileMode.Open)) { var users = fileParserService.ParseFileToUsers(stream); Assert.IsTrue(users.Any()); } }
public FileParserServiceTest() { var optionsBuilder = new DbContextOptionsBuilder <AppDbContext>(); optionsBuilder.UseInMemoryDatabase("FileParserServiceTestDb"); _dbContext = new AppDbContext(optionsBuilder.Options); _service = new FileParserService( MockFileProvider.Object, _dbContext, MockBlogRepository.Object, MockLogger.Object, MockConfig.Object ); }
public void FileParserService_FileParserService_ContentBad_Ok() { var fileParserService = new FileParserService(); using (var stream = new FileStream("Content/MOCK_DATA-1.csv", FileMode.Open)) { try { var users = fileParserService.ParseFileToUsers(stream); Assert.IsTrue(false); } catch { Assert.IsTrue(true); } } }
public void TestInit() { _service = new FileParserService(new FileHelpers.FileHelperEngine <IPHeatMap.Data.Models.IPv4>()); }