private ShippingProduct GetShippingProduct() { var result = new ShippingProduct { Name = this.txtProductName.Text, Weight = Convert.ToDouble(this.txtProductWeight.Text), Size = new Size { Length = Convert.ToDouble(this.txtProductLength.Text), Width = Convert.ToDouble(this.txtProductWidth.Text), Height = Convert.ToDouble(this.txtProductHeight.Text) }, Shipper = Convert.ToInt32(this.drpCompany.SelectedValue) }; return(result); }
public void CalculateTest() { //arrange var sut = new BlackCatShipper(); var product = new ShippingProduct { Name = "book", Weight = 10, Size = new Size { Length = 30, Width = 20, Height = 10 }, }; //act sut.CalculateFee(product); //assert var expected = 200; Assert.AreEqual(expected, product.ShippingFee); }