Beispiel #1
0
        public void CorrectlyCreateNewListOfReports()
        {
            //Arrange
            var writer = new Mock <IWriter>();
            //Act
            var sut = new PrintReports(writer.Object);

            //Assert
            Assert.IsInstanceOfType(sut.Reports, typeof(List <string>));
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //create object from report
     PrintReports report = new PrintReports();
     //create a list from wine report
     List<GiftCard> wine = report.WineCards();
     //check if list is empty
     if (wine.Count == 0)
     { //display a message to user and hide the reportviewer
         lblMessage.Visible = true;
         ReportViewer1.Visible = false;
     }
     else
     {   //hide message and show report
         lblMessage.Visible = false;
         ReportViewer1.Visible = true;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     //create object from report class
     PrintReports house = new PrintReports();
     //create a list from house keeping giftcards
     List<GiftCard> houseGift = house.HouseKeepingCards();
     //check if is empty
     if (houseGift.Count == 0)
     {   //display message and hide report
         lblHouseMessage.Visible = true;
         ReportViewer1.Visible = false;
     }
     else
     {
         //hide label and show report
         lblHouseMessage.Visible = false;
         ReportViewer1.Visible = true;
     }
 }