예제 #1
0
        protected override void Given()
        {
            base.Given();

            var customer = new CustomerModel();
            _model = new OrderShipmentModel
            {
                ShippedDate = null,
                Items = new List<OrderItemShipmentModel>
                {
                    new OrderItemShipmentModel
                    {
                        IsPackaged = true
                    },
                    new OrderItemShipmentModel
                    {
                        IsPackaged = true
                    },
                    new OrderItemShipmentModel
                    {
                        IsPackaged = true
                    }
                }
            };

            ViewModel.Initialize(customer, _model);
        }
예제 #2
0
        private IOrderShipmentViewModel CreateOrderShipmentViewModel(CustomerModel customer, OrderShipmentModel model)
        {
            var viewModel = _viewModelFactory.CreateOrderShipmentViewModel();
            viewModel.Initialize(customer, model);

            return viewModel;
        }
예제 #3
0
        protected override void Given()
        {
            base.Given();

            _model = new OrderShipmentModel();

            ViewModel.Initialize(new CustomerModel(), _model);
        }
        protected override void Given()
        {
            base.Given();

            var customer = new CustomerModel();
            var orderShipment = new OrderShipmentModel
            {
                Items = new List<OrderItemShipmentModel>
                {
                    new OrderItemShipmentModel
                    {
                        IsPackaged = false
                    },
                    new OrderItemShipmentModel
                    {
                        IsPackaged = true
                    }
                }
            };

            ViewModel.Initialize(customer, orderShipment);
        }
예제 #5
0
        protected override void Given()
        {
            base.Given();

            ViewModel.PropertyChanged += (sender, args) => _raisedProperties.Add(args.PropertyName);

            _customer = new CustomerModel
            {
                City = "Delivery town",
                FirstName = "John",
                LastName = "Doe",
                StreetAddress = "Delivery street 15",
                ZipCode = 12345
            };

            _allOrderItems = new[]
            {
                new OrderItemShipmentModel
                {
                    Id = 1,
                    IsPackaged = false,
                    OrderItem =
                    {
                        Quantity = 3,
                        Item = {Price = 18m}
                    }
                },
                new OrderItemShipmentModel
                {
                    Id = 2,
                    IsPackaged = true,
                    OrderItem =
                    {
                        Quantity = 1,
                        Item = {Price = 1.5m}
                    }
                },
                new OrderItemShipmentModel
                {
                    Id = 3,
                    IsPackaged = false,
                    OrderItem =
                    {
                        Quantity = 4,
                        Item = {Price = 100m}
                    }
                },
                new OrderItemShipmentModel
                {
                    Id = 4,
                    IsPackaged = true,
                    OrderItem =
                    {
                        Quantity = 1,
                        Item = {Price = 10m}
                    }
                },
                new OrderItemShipmentModel
                {
                    Id = 5,
                    IsPackaged = true,
                    OrderItem =
                    {
                        Quantity = 10,
                        Item = {Price = 10m}
                    }
                },
                new OrderItemShipmentModel
                {
                    Id = 6,
                    IsPackaged = true,
                    OrderItem =
                    {
                        Quantity = 3,
                        Item = {Price = 25}
                    }
                },
                new OrderItemShipmentModel
                {
                    Id = 7,
                    IsPackaged = false,
                    OrderItem =
                    {
                        Quantity = 2,
                        Item = {Price = 15.5m}
                    }
                }
            };

            _orderShipment = new OrderShipmentModel {Items = _allOrderItems, OrderInfo = {Id = OrderNumber}};
        }