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>()); }
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); }