Beispiel #1
0
        public void GenerateReportTest()
        {
            //Arrange
            var fareCapService = new FareCapService(Host.Instance.Get <ILogService>());

            fareCapService.AddCapFareRule(new DailyCapFareRule());
            fareCapService.ApplyFareCap(GetNewJourney(), 30);

            // Act
            fareCapService.GenerateReport();


            // Assert
            Host.Instance.Get <ILogService>().Received().Log(Arg.Any <string>());
        }
Beispiel #2
0
        public void ApplyFareCapTest_Single(double currentfare, double expectedfare)
        {
            //Arrange
            var fareCapService = new FareCapService(Host.Instance.Get <ILogService>());

            fareCapService.AddCapFareRule(new DailyCapFareRule());
            fareCapService.AddCapFareRule(new WeeklyCapFareRule());
            var journey = GetNewJourney();

            // Act
            var fare = fareCapService.ApplyFareCap(journey, currentfare);


            // Assert
            Assert.Equal(expectedfare, fare);
        }