Exemplo n.º 1
0
        public void CalculateTest_BlackCat()
        {
            BlackCat target = new BlackCat()
            {
                ShipProduct = new Product
                {
                    IsNeedCool = true,
                    Name       = "test1",
                    Size       = new getSize
                    {
                        Height = 10,
                        Length = 30,
                        Width  = 20
                    },
                    Weight = 10
                }
            };

            target.Calculate();

            var expectedName = "BlackCat";
            var expectedFee  = 200;

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

            Assert.AreEqual(expectedName, actualName);
            Assert.AreEqual(expectedFee, actualFee);
        }
Exemplo n.º 2
0
        public void CalculateTest()
        {
            // 從整合測試的test case,來當做單元測試的test case

            // arrange
            BlackCat target = new BlackCat()
            {
                ShipProduct = new Product
                {
                    IsNeedCool = true,
                    Name       = "商品測試1",
                    Size       = new Size
                    {
                        Height = 10,
                        Length = 30,
                        Width  = 20
                    },
                    Weight = 10
                }
            };

            // act
            target.Calculate();

            var expectedName = "黑貓";
            var expectedFee  = 200;

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

            // assert
            Assert.AreEqual(expectedName, actualName);
            Assert.AreEqual(expectedFee, actualFee);
        }
Exemplo n.º 3
0
        public void GetsFeeTest_BlackCat()
        {
            BlackCat target   = new BlackCat();
            double   expected = 0F;

            Assert.AreEqual(expected, target.GetsFee());
        }
Exemplo n.º 4
0
        public void GetsFeeTest()
        {
            BlackCat target   = new BlackCat();
            double   expected = 0F;
            double   actual;

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