public void Return_PartOf_Rides() { CabInvoice[] rides = { new CabInvoice(5, 15), new CabInvoice(12, 35), new CabInvoice(7, 23) }; CabInvoice obj = new CabInvoice(); var result = CabInvoice.totalFare(rides); }
public void CalCulateTotalFare_OfMultipleRides() { CabInvoice[] rides = { new CabInvoice(5, 15), new CabInvoice(12, 35), new CabInvoice(7, 23) }; double result = CabInvoice.totalFare(rides); Assert.AreEqual(313, result); }
public void InvoiceGeneratorShouldTakesMultipleRide_ShouldReturnTotalFare2() { Rides[] rides = { new Rides(5, 15), new Rides(12, 35), new Rides(7, 23) }; CabInvoice obj = new CabInvoice("Normal"); double Actual = obj.totalFare(rides, "Normal"); Assert.AreEqual(Actual, 313); }
public void InvoiceGeneratorShouldTakesMultipleRide_ShouldReturnTotalFare1() { Rides[] rides = { new Rides(5, 15), new Rides(12, 35), new Rides(7, 23) }; CabInvoice obj = new CabInvoice("Premium"); double Actual = obj.totalFare(rides, "Premium"); double expect = obj.CalculateFare(5, 15) + obj.CalculateFare(12, 35) + obj.CalculateFare(7, 23); Assert.AreEqual(Actual, expect); }
public void Given_User_Id_AndGet_Total_Fare_User() { RideReposetory rideRepository = new RideReposetory(); List <Rides> rides = new List <Rides>(); rides.Add(new Rides(0.5, 5)); rides.Add(new Rides(1.0, 8)); CabInvoice obj = new CabInvoice("Normal"); Customer New_Custmor = new Customer("Bdec123"); rideRepository.AddRide(rides, New_Custmor); double actual = obj.GetInvoiceSummary(New_Custmor, "Normal"); double expected = obj.totalFare(rides.ToArray(), "Normal"); Assert.AreEqual(actual, expected); }