public static Parcel Register(ParcelId id, VbrCaPaKey vbrCaPaKey, IParcelFactory factory)
        {
            var parcel = factory.Create();

            parcel.ApplyChange(new ParcelWasRegistered(id, vbrCaPaKey));
            return(parcel);
        }
        public IParcel Create(double size, double weight)
        {
            var parcel           = _parcelFactory.Create(size);
            var parcelWithWeight = new ParcelWithWeight(parcel)
            {
                Weight = weight
            };

            return(parcelWithWeight);
        }
Esempio n. 3
0
        private static Order AddParcelsToOrder(IParcelWithWeightFactory parcelWithweightFactory, IParcelFactory factory)
        {
            var order = new Order();


            var p1 = parcelWithweightFactory.Create(11);

            order.Add(p1);
            var p2 = factory.Create(2);

            order.Add(p2);
            var p3 = factory.Create(3);

            order.Add(p3);
            var p4 = parcelWithweightFactory.Create(12);

            order.Add(p4);
            var p5 = factory.Create(4);

            order.Add(p5);
            var p6 = factory.Create(11);

            order.Add(p6);
            var p7 = factory.Create(51);

            order.Add(p7);
            var p8 = factory.Create(4);

            order.Add(p8);
            return(order);
        }