public void ActionsForMembershipUpgrade_Test()
        {
            PaymentDetailsDto paymentDetailsDto = new PaymentDetailsDto();

            paymentDetailsDto.ProductType   = ProductEnum.UpgradeMembership;
            paymentDetailsDto.MembershipDto = new MembershipDto
            {
                MembershipId   = 10001,
                MembershipName = "Prime Membership"
            };
            paymentDetailsDto.CustomerDto = new CustomerDto
            {
                CustomerEmail = "*****@*****.**",
                CustomerId    = 120,
                CustomerName  = "Vithal Deshpande"
            };

            var actions = ActionFactory.CreateActions(paymentDetailsDto);

            Assert.IsTrue(actions.Count == 2); // membership upgrade and sending email

            foreach (var action in actions)
            {
                Assert.IsNotNull(action.DoProcess());
            }
        }
        public void ActionsForBook_Test()
        {
            PaymentDetailsDto paymentDetailsDto = new PaymentDetailsDto();

            paymentDetailsDto.ProductType = ProductEnum.Book;
            paymentDetailsDto.ProductDto  = new ProductDto
            {
                Price     = 1000,
                ProductId = 1
            };

            var actions = ActionFactory.CreateActions(paymentDetailsDto);

            Assert.IsTrue(actions.Count == 2); // one of packing slip for shipping and agent payment generation

            paymentDetailsDto.AgentDto = new AgentDto
            {
                AgentId   = 200,
                AgentName = "John Miller"
            };
            foreach (var action in actions)
            {
                Assert.IsNotNull(action.DoProcess());
            }
        }
Esempio n. 3
0
        public Store(TState initialState = null)
        {
            var assemebly = Assembly.GetCallingAssembly();

            _selectors       = SelectorFactory.CreateSelectors(assemebly);
            _reducers        = ActionFactory.CreateActions(assemebly, this);
            _observableState = new BehaviorSubject <TState>(initialState ?? new TState());
        }
        public void ActionsForVideoPayment_Test()
        {
            PaymentDetailsDto paymentDetailsDto = new PaymentDetailsDto();

            paymentDetailsDto.ProductType          = ProductEnum.Video;
            paymentDetailsDto.ProductDto           = new ProductDto();
            paymentDetailsDto.ProductDto.ProductId = 101;
            paymentDetailsDto.ProductDto.Price     = 200;

            var actions = ActionFactory.CreateActions(paymentDetailsDto);

            Assert.IsTrue(actions.Count == 1); // sending free video


            foreach (var action in actions)
            {
                Assert.IsNotNull(action.DoProcess());
            }
        }
Esempio n. 5
0
 private void LoadActions(string applicationName, string msiLocation, List <string> webDirectories)
 {
     //OurStopWatch.Enter("LoadActions");
     listViewControl.Items.Clear();
     txtSSOConfigLoc.Text = txtConfigAppName.Text = txtBxSSOKey.Text = "";
     foreach (BaseAction action in ActionFactory.CreateActions(applicationName, msiLocation, webDirectories))
     {
         Color  statusColor    = Color.SteelBlue;
         string initialMessage = string.Empty;
         if (!IsAdministrator() && action.IsAdminOnly)
         {
             initialMessage = "This action will fail. Action needs Administrator priviledges to run. Please run the tool as Administrator.";
             statusColor    = Color.Salmon;
         }
         ListViewItem listViewItem = new ListViewItem(new string[] { action.DisplayName, "Not Executed", "Never", string.Empty, initialMessage });
         listViewItem.SubItems[1].ForeColor   = statusColor;
         listViewItem.SubItems[1].Font        = new Font(lblMsiLoc.Font.Name, lblMsiLoc.Font.Size, FontStyle.Bold);
         listViewItem.UseItemStyleForSubItems = false;
         listViewItem.Tag = action;
         listViewControl.Items.Add(listViewItem);
     }
     //OurStopWatch.Exit();
 }