Exemple #1
0
        public void LargePackageType()
        {
            var controller = new ParseParcelController()
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new HttpConfiguration()
            };

            var packageDTO = new PackageDTO();

            packageDTO.Length  = 300;
            packageDTO.Breadth = 550;
            packageDTO.Height  = 180;
            packageDTO.Weight  = 25;
            var _response = controller.GetParcelPrice(packageDTO);

            Assert.AreEqual("Large Package", _response.PackageType);
        }
Exemple #2
0
        public void ExceedDimension()
        {
            var controller = new ParseParcelController()
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new HttpConfiguration()
            };

            var packageDTO = new PackageDTO();

            packageDTO.Length  = 400;
            packageDTO.Breadth = 550;
            packageDTO.Height  = 200;
            packageDTO.Weight  = 25;
            var _response = controller.GetParcelPrice(packageDTO);

            Assert.AreEqual("The Parcel dimension exceeded the maximum dimension of the service package.", _response.Message);
        }
Exemple #3
0
        public void CheckPackageType()
        {
            var controller = new ParseParcelController()
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new HttpConfiguration()
            };

            var packageDTO = new PackageDTO();

            packageDTO.Length  = 190;
            packageDTO.Breadth = 260;
            packageDTO.Height  = 150;
            packageDTO.Weight  = 27;
            var _response = controller.GetParcelPrice(packageDTO);

            Assert.AreEqual("The Parcel Weight exceeded the maximum weight of 25kg.", _response.Message);
        }