Beispiel #1
0
        public void ShouldAddDetailsViewAndControlsViewToContentArea()
        {
            var detailsViewModel = new MockOrderDetailsViewModel();

            var composite = new OrderCompositeViewModel(detailsViewModel);

            Assert.AreSame(detailsViewModel, composite.OrderDetails);
        }
Beispiel #2
0
        public void ShouldCreateOrderdetailsViewModel()
        {
            var detailsViewModel = new MockOrderDetailsViewModel();

            var composite = new OrderCompositeViewModel(detailsViewModel);

            composite.TransactionInfo = new TransactionInfo("FXX01", TransactionType.Sell);

            Assert.IsNotNull(detailsViewModel.TransactionInfo);
        }
Beispiel #3
0
        public void ShouldSetHeaderInfo()
        {
            var composite = new OrderCompositeViewModel(new MockOrderDetailsViewModel());

            composite.TransactionInfo = new TransactionInfo("FXX01", TransactionType.Sell);

            Assert.IsNotNull(composite.HeaderInfo);
            Assert.IsTrue(composite.HeaderInfo.Contains("FXX01"));
            Assert.IsTrue(composite.HeaderInfo.Contains("Sell"));
            Assert.AreEqual("Sell FXX01", composite.HeaderInfo);
        }
Beispiel #4
0
        public void TransactionInfoAndSharesAndCommandsAreTakenFromOrderDetails()
        {
            var orderDetailsPM = new MockOrderDetailsViewModel();
            var composite      = new OrderCompositeViewModel(orderDetailsPM);

            orderDetailsPM.Shares = 100;

            Assert.AreEqual(orderDetailsPM.Shares, composite.Shares);
            Assert.AreSame(orderDetailsPM.SubmitCommand, composite.SubmitCommand);
            Assert.AreSame(orderDetailsPM.CancelCommand, composite.CancelCommand);
            Assert.AreSame(orderDetailsPM.TransactionInfo, composite.TransactionInfo);
        }
Beispiel #5
0
        public void ShouldUpdateHeaderInfoWhenUpdatingTransactionInfo()
        {
            var orderDetailsPM = new MockOrderDetailsViewModel();
            var composite      = new OrderCompositeViewModel(orderDetailsPM);

            composite.TransactionInfo = new TransactionInfo("FXX01", TransactionType.Sell);

            orderDetailsPM.TransactionInfo.TickerSymbol = "NEW_SYMBOL";
            Assert.AreEqual("Sell NEW_SYMBOL", composite.HeaderInfo);

            orderDetailsPM.TransactionInfo.TransactionType = TransactionType.Buy;
            Assert.AreEqual("Buy NEW_SYMBOL", composite.HeaderInfo);
        }
Beispiel #6
0
        public void PresenterExposesChildOrderPresentersCloseRequested()
        {
            var detailsViewModel = new MockOrderDetailsViewModel();

            var composite = new OrderCompositeViewModel(detailsViewModel);

            var closeViewRequestedFired = false;

            composite.CloseViewRequested += delegate
            {
                closeViewRequestedFired = true;
            };

            detailsViewModel.RaiseCloseViewRequested();

            Assert.IsTrue(closeViewRequestedFired);
        }