public void Test_Holiday_Update_From_File() { string filePath = Path.Combine(Directory.GetCurrentDirectory(), @"Source/Holiday.json"); ISourceGraber <SourceHoliday> sourceGraber = new FileSourceGraber <SourceHoliday>(filePath); IUnitOfWork unitOfWork = EFUnitOfWorkFactory.GetUnitOfWork <HolidayEntities>(); IGenericDataAccess <TWHoliday> dataAccess = new GenericDataAccess <TWHoliday>(unitOfWork); HolidayMaintainer maintanier = new HolidayMaintainer(sourceGraber, dataAccess); var source = maintanier.AddHolidayFromSource(); Assert.AreEqual(true, source); }
static void Main(string[] args) { Console.WriteLine("Start update holiday"); string filePath = Path.Combine(Directory.GetCurrentDirectory(), @"Source/Holiday.json"); ISourceGraber <SourceHoliday> sourceGraber = new FileSourceGraber <SourceHoliday>(filePath); IUnitOfWork unitOfWork = EFUnitOfWorkFactory.GetUnitOfWork <HolidayEntities>(); IGenericDataAccess <TWHoliday> dataAccess = new GenericDataAccess <TWHoliday>(unitOfWork); HolidayMaintainer maintanier = new HolidayMaintainer(sourceGraber, dataAccess); var source = maintanier.AddHolidayFromSource(); if (source) { Console.WriteLine("Update Holiday success"); } Console.WriteLine("Update Holiday fail"); }