Esempio n. 1
0
        public void BuildOrder_6()
        {
            int          ExpectedOutput = -2;
            int          GotOutput      = 0;
            IUserProfile UserProfileObj = new UserProfile();

            UserProfileObj.SetEmail("*****@*****.**");
            List <string> token = new SecurityDataLayer(UserProfileObj).GetTokenList();

            if (token.Count == 0)
            {
                // token count = 0 means that the account is not logged in or all sessions destroyed
                // generate the token
                UserProfileObj.SetPassword("Root@123");
                LoginUserReponse response = new UserActions().LoginUserAction(UserProfileObj);
                token = new SecurityDataLayer(UserProfileObj).GetTokenList();
            }
            UserProfileObj.SetToken(token[token.Count - 1].ToString());
            IOrder OrderObj = new Order();

            OrderObj.SetOrderType("");
            OrderObj.SetStatusName("Unpaid");
            try
            {
                OrderDetailsTemplate         UnpaidOrdersObj = new UnpaidOrdersTemplate(UserProfileObj, OrderObj);
                List <IOrderBuilderResponse> Output          = UnpaidOrdersObj.BuildOrder();
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(GotOutput, ExpectedOutput);
        }
Esempio n. 2
0
        public void BuildOrder_10()
        {
            IUserProfile UserProfileObj = new UserProfile();

            UserProfileObj.SetEmail("*****@*****.**");
            List <string> token = new SecurityDataLayer(UserProfileObj).GetTokenList();

            if (token.Count == 0)
            {
                // token count = 0 means that the account is not logged in or all sessions destroyed
                // generate the token
                UserProfileObj.SetPassword("Root@123");
                LoginUserReponse response = new UserActions().LoginUserAction(UserProfileObj);
                token = new SecurityDataLayer(UserProfileObj).GetTokenList();
            }
            UserProfileObj.SetToken(token[token.Count - 1].ToString());
            IOrder OrderObj = new Order();

            OrderObj.SetOrderType("Individual");
            OrderObj.SetStatusName("ABCD");
            OrderDetailsTemplate         UnpaidOrdersObj = new UnpaidOrdersTemplate(UserProfileObj, OrderObj);
            List <IOrderBuilderResponse> Output          = UnpaidOrdersObj.BuildOrder();

            Assert.AreEqual(Output.Count == 0, true);
        }
Esempio n. 3
0
        public void BuildOrder_4()
        {
            IUserProfile UserProfileObj = new UserProfile();
            IOrder       OrderObj       = new Order();

            UserProfileObj.SetToken("ABCD");
            OrderObj.SetOrderType("Individual");
            OrderObj.SetStatusName("Unpaid");
            OrderDetailsTemplate         UnpaidOrdersObj = new UnpaidOrdersTemplate(UserProfileObj, OrderObj);
            List <IOrderBuilderResponse> Output          = UnpaidOrdersObj.BuildOrder();

            Assert.AreEqual(Output.Count == 0, true);
        }
 public override List <IOrderBuilderResponse> FetchUnpaidOrderID()
 {
     try
     {
         OrderObj.SetStatusName("Unpaid");
         OrderDetailsTemplate UnpaidOrders = new UnpaidOrdersTemplate(UserProfileObj, OrderObj);
         return(UnpaidOrders.BuildOrder());
     }
     catch (Exception ex)
     {
         Logger.Instance().Log(Fatal.Instance(), ex);
         throw ex;
     }
 }
Esempio n. 5
0
        public void BuildOrder_3()
        {
            int          ExpectedOutput = -2;
            int          GotOutput      = 0;
            IUserProfile UserProfileObj = new UserProfile();
            IOrder       OrderObj       = new Order();

            UserProfileObj.SetToken("");
            OrderObj.SetOrderType("Individual");
            OrderObj.SetStatusName("Unpaid");
            try
            {
                OrderDetailsTemplate         UnpaidOrdersObj = new UnpaidOrdersTemplate(UserProfileObj, OrderObj);
                List <IOrderBuilderResponse> Output          = UnpaidOrdersObj.BuildOrder();
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(GotOutput, ExpectedOutput);
        }