예제 #1
0
        public void CalculateTest()
        {
            Hsinchu target = new Hsinchu()
            {
                ShipProduct = new Product
                {
                    IsNeedCool = true,
                    Name       = "商品測試1",
                    Size       = new Size
                    {
                        Height = 10,
                        Length = 30,
                        Width  = 20
                    },
                    Weight = 10
                }
            };

            //act
            target.Calculate();

            //assert
            var expectedName = "新竹貨運";
            var expectedFee  = 254.16;

            var actualName = target.GetsComapanyName();
            var actualFee  = target.GetsFee();

            //assert
            Assert.AreEqual(expectedName, actualName);
            Assert.AreEqual(expectedFee, actualFee);
        }
예제 #2
0
        public void GetsComapanyNameTest()
        {
            Hsinchu target   = new Hsinchu();
            string  expected = "新竹貨運";
            string  actual;

            actual = target.GetsComapanyName();
            Assert.AreEqual(expected, actual);
        }