Пример #1
0
        public void CheckIfRandomlyCreatedShipmentPackagesAreStoredInCache()
        {
            ShipmentBusiness          shipmentBusiness        = new ShipmentBusiness(_baseFixture.MockedShipmentPackageGenerator, _baseFixture.MockedCache);
            List <ShipmentPackageDTO> shipmentPackagesInitial = shipmentBusiness.GetShipmentPackages();
            List <ShipmentPackageDTO> shipmentPackagesCached  = shipmentBusiness.GetShipmentPackages();

            Assert.True(shipmentPackagesInitial.All(shipmentPackagesCached.Contains) && shipmentPackagesInitial.Count == shipmentPackagesCached.Count);
        }
Пример #2
0
        public void CheckIfQueryingANonExistingPackageReturnsNull()
        {
            ShipmentBusiness          shipmentBusiness = new ShipmentBusiness(_baseFixture.MockedShipmentPackageGenerator, _baseFixture.MockedCache);
            List <ShipmentPackageDTO> shipmentPackages = shipmentBusiness.GetShipmentPackages();
            ShipmentPackageDTO        shipmentPackage  = shipmentPackages.First();

            ShipmentPackageDTO queriedShipmentPackage = shipmentBusiness.QuerySpecificPackage(shipmentPackage.PackageNumber + "asd");

            Assert.True(queriedShipmentPackage == null);
        }
Пример #3
0
        public void CheckIfQueryingAnExistingPackageReturnsValidPackage()
        {
            ShipmentBusiness          shipmentBusiness = new ShipmentBusiness(_baseFixture.MockedShipmentPackageGenerator, _baseFixture.MockedCache);
            List <ShipmentPackageDTO> shipmentPackages = shipmentBusiness.GetShipmentPackages();
            ShipmentPackageDTO        shipmentPackage  = shipmentPackages.First();

            ShipmentPackageDTO queriedShipmentPackage = shipmentBusiness.QuerySpecificPackage(shipmentPackage.PackageNumber);

            Assert.True(queriedShipmentPackage != null && queriedShipmentPackage.Equals(shipmentPackage));
        }