public void TemplateMethodTest()
        {
            // Arrange
            OrderShipment order = new FedExOrderShipment();

            // Act
            order.Ship();
        }
Beispiel #2
0
        public void Ship_FedEx()
        {
            var logger = new Mock <ILogger>();
            var ups    = new FedExOrderShipment();

            ups.Address = "123 Broadway";
            ups.Ship(logger.Object);

            logger.Verify(l => l.Log("FedEx:[123 Broadway]"), Times.Once());
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Sending order UPS:");
            OrderShipment upsOrder = new UpsOrderShipment();

            upsOrder.ShippingAddress = "NimblePros, Hudson, OH 44236";
            Console.WriteLine(upsOrder.Ship());

            Console.WriteLine("Sending order FedEx:");
            OrderShipment fedExOrder = new FedExOrderShipment();

            fedExOrder.ShippingAddress = "NimblePros, Hudson, OH 44236";
            Console.WriteLine(fedExOrder.Ship());

            Console.ReadLine();
        }