public void CalculateCost_CalculatesCost_Int() { Parcel package = new Parcel(); package.SetTotalVolume(10000); package.SetWeight(1000); package.CalculateCost(); Assert.AreEqual(110, package.GetCost()); }
public void CalculateCost_XLParcel_25DollarsIsReturned(double dimensions) { //Arrange var parcel = new Parcel(dimensions, 10); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(25, parcelCost.Cost); }
public void CalculateCost_HeavyParcel_50DollarsIsReturned(double dimensions) { //Arrange var parcel = new Parcel(dimensions, 50); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(50, parcelCost.Cost); }
public void CalculateCost_MediumParcel_8DollarsIsReturned(double dimensions) { //Arrange var parcel = new Parcel(dimensions, 3); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(8, parcelCost.Cost); }
public void CalculateCost_SmallParcelWithSpeedyShipping_6DollarsIsReturned() { //Arrange var parcel = new Parcel(5, 1); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(3, parcelCost.Cost); Assert.Equal(6, parcelCost.SpeedyShippingCost); }
public void CalculateCost_HeavyParcelWithSpeedyShipping_100DollarsIsReturned() { //Arrange var parcel = new Parcel(125, 50); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(50, parcelCost.Cost); Assert.Equal(100, parcelCost.SpeedyShippingCost); }
public void CalculateCost_LargeParcelWithSpeedyShipping_30DollarsIsReturned() { //Arrange var parcel = new Parcel(75, 6); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(15, parcelCost.Cost); Assert.Equal(30, parcelCost.SpeedyShippingCost); }
public void CalculateCost_MediumParcelWithSpeedyShipping_16DollarsIsReturned() { //Arrange var parcel = new Parcel(25, 3); //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(8, parcelCost.Cost); Assert.Equal(16, parcelCost.SpeedyShippingCost); }
public void CalculateCost_HeavyParcelIsOverweight_OverweightChargeIsAddedToCostAndReturned(double weight, decimal overweightCharge) { //Arrange var parcel = new Parcel(125, weight); var heavyParcelCost = 50; var expectedCost = heavyParcelCost + overweightCharge; //Act var parcelCost = parcel.CalculateCost(); //Assert Assert.Equal(expectedCost, parcelCost.Cost); }
public ActionResult ParcelResults(string name, int weight, int height, int length, int width) { Parcel package = new Parcel(); package.SetSender(name); package.SetWeight(weight); package.SetHeight(height); package.SetLength(length); package.SetWidth(width); package.CalculateVolume(); package.CalculateCost(); package.SaveParcel(); return(View(Parcel.GetAll())); }