コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
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;
            }
        }