public void Test_checkNewsPaperPagesCompiled() { helper = new PaperGeneraterHelper(); objNewsPaper = new NewsPaper(DateTime.Now); NewsPaperPage objPage = new NewsPaperPage(); objNewsPaper.NewsPaperPages.Add(objPage); helper.lstNews = GetNews(); helper.lstAdvertise = GetAdvertisements(); helper.AddPagesToNewsPaper(objNewsPaper, objPage); helper.AddAddvertisementToNewsPaper(objNewsPaper); Assert.IsNotNull(objNewsPaper); Assert.IsNotNull(objNewsPaper.NewsPaperPages); }
public void Test_checkNewsPaperHasMaximumHighPiorityNews() { helper = new PaperGeneraterHelper(); objNewsPaper = new NewsPaper(DateTime.Now); NewsPaperPage objPage = new NewsPaperPage(); objNewsPaper.NewsPaperPages.Add(objPage); helper.lstNews = GetNewsAllHighPriority(); helper.lstAdvertise = GetAdvertisements(); helper.AddPagesToNewsPaper(objNewsPaper, objPage); helper.AddAddvertisementToNewsPaper(objNewsPaper); Assert.IsNotNull(objNewsPaper); Assert.IsNotNull(objNewsPaper.NewsPaperPages); Assert.IsTrue(objNewsPaper.NewsPaperPages[0].Advertisement.Count == 0); }
public NewsPaper GenerateNewsPaper() { try { NewsPaper objPaper = NewsPaper.GetInstance(DateTime.Now); NewsPaperPage objPage = new NewsPaperPage(); objPaper.NewsPaperPages.Add(objPage); helper = new PaperGeneraterHelper(); helper.AddPagesToNewsPaper(objPaper, objPage); helper.AddAddvertisementToNewsPaper(objPaper); return(objPaper); } catch (Exception ex) { throw; } }