예제 #1
0
        public void TestReceivePackage_CancelTransit()
        {
            MockPackageRepository myMockPackageRepo = new MockPackageRepository();
            PackageService        packageService    = new PackageService(myMockPackageRepo);
            Package            package1             = MockDataAccess.GetPackage(3);
            DistributionCentre myReceiverCentre     = MockDataAccess.GetDistributionCentre(3);
            int    newTransitId  = InsertMockTransit(package1, 2, 3);                                   // insert transit
            Result res           = packageService.CancelTransit(package1.BarCode, DateTime.Today);      // cancel transit
            int    foundTransits = myMockPackageRepo.GetActiveTransitsByPackage(package1).Count;

            Assert.IsTrue(res.Success && foundTransits == 0);
        }