예제 #1
0
        public void CalculateFeeTest()
        {
            //arrange
            var target = new Postoffice();
            var product = new ShippingProduct
            {
                Name = "book",
                Weight = 10,
                Size = new Size
                {
                    Length = 30,
                    Width = 20,
                    Height = 10
                },
            };

            //act
            target.CalculateFee(product);

            //assert
            var expected = 180;
            Assert.AreEqual(expected, product.ShippingFee);
        }
예제 #2
0
파일: Product.aspx.cs 프로젝트: cashwu/TDD
    private IShipper GetShipper(string shipperId)
    {
        IShipper result = null;
        switch (shipperId)
        {
            case "1":
                result = new Blackcat();
                break;

            case "2":
                result = new HsinChu();
                break;

            case "3":
                result = new Postoffice();
                break;

            default:
                break;
        }

        return result;
    }