Esempio n. 1
0
            public void GetBookingFeesWithValidOrderExpectBookingDaoCalled()
            {
                //Arrange
                const int ORDER_ID = 1;
                const string CULTURE_CODE = "en-GB";
                var bookingFees = new List<BookingFee>
                                      {
                                          new BookingFee
                                              {
                                                  ItemTypeCode = ItemTypeEnum.RoomNight
                                              },

                                          new BookingFee
                                              {
                                                  ItemTypeCode = ItemTypeEnum.Dinner
                                              }
                                      };

                var bookingManager = new BookingManager();
                var bookingDao = new Mock<IBookingDao>();
                bookingManager.BookingDao = bookingDao.Object;
                bookingDao.Setup(b => b.GetBookingFees(ORDER_ID, CULTURE_CODE)).Returns(bookingFees);

                // Act
                var bookingFeesReturned = bookingManager.GetBookingFees(ORDER_ID, CULTURE_CODE);

                // Assert
                Assert.IsNotNull(bookingFeesReturned, "BookingFees are null.");
                Assert.AreEqual(bookingFees, bookingFeesReturned, "BookingFees return are not correct.");
                bookingDao.VerifyAll();
            }