Пример #1
0
        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());
            }
        }
Пример #2
0
        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
                );
        }
Пример #3
0
        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>());
 }