public void OrderDetailsByTypeAndStatus_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");
            IOrderDetailsDataLayer OrderDetailsDataLayerObj = new OrderDetailsDataLayer(UserProfileObj, OrderObj);
            DataSet Output = OrderDetailsDataLayerObj.FetchOrderDetailsByTypeAndStatus();

            Assert.AreEqual(Output.Tables[0].Rows.Count == 0, true);
        }
        public void OrderDetailsByTypeAndStatus_9()
        {
            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("Individual");
            OrderObj.SetStatusName("");
            IOrderDetailsDataLayer OrderDetailsDataLayerObj = new OrderDetailsDataLayer(UserProfileObj, OrderObj);

            try
            {
                DataSet Output = OrderDetailsDataLayerObj.FetchOrderDetailsByTypeAndStatus();
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(GotOutput, ExpectedOutput);
        }
Exemple #3
0
        public void OrderDetailsByType_4()
        {
            IUserProfile UserProfileObj = new UserProfile();
            IOrder       OrderObj       = new Order();

            UserProfileObj.SetToken("ABCD");
            OrderObj.SetOrderType("Group");
            IOrderDetailsDataLayer OrderDetailsDataLayerObj = new OrderDetailsDataLayer(UserProfileObj, OrderObj);
            DataSet Output = OrderDetailsDataLayerObj.FetchOrderDetailsByType();

            Assert.AreEqual(Output.Tables[0].Rows.Count == 0, true);
        }
        public void OrderDetailsByTypeAndStatus_4()
        {
            IUserProfile UserProfileObj = new UserProfile();
            IOrder       OrderObj       = new Order();

            UserProfileObj.SetToken("ABCD");
            OrderObj.SetOrderType("Individual");
            OrderObj.SetStatusName("Cancelled");
            IOrderDetailsDataLayer OrderDetailsDataLayerObj = new OrderDetailsDataLayer(UserProfileObj, OrderObj);
            DataSet Output = OrderDetailsDataLayerObj.FetchOrderDetailsByTypeAndStatus();

            Assert.AreEqual(Output.Tables[0].Rows.Count == 0, true);
        }
Exemple #5
0
        public void OrderDetailsByType_3()
        {
            int          ExpectedOutput = -2;
            int          GotOutput      = 0;
            IUserProfile UserProfileObj = new UserProfile();
            IOrder       OrderObj       = new Order();

            UserProfileObj.SetToken("");
            OrderObj.SetOrderType("Group");
            IOrderDetailsDataLayer OrderDetailsDataLayerObj = new OrderDetailsDataLayer(UserProfileObj, OrderObj);

            try
            {
                DataSet Output = OrderDetailsDataLayerObj.FetchOrderDetailsByType();
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(GotOutput, ExpectedOutput);
        }
        public void OrderDetailsByTypeAndStatus_3()
        {
            int          ExpectedOutput = -2;
            int          GotOutput      = 0;
            IUserProfile UserProfileObj = new UserProfile();
            IOrder       OrderObj       = new Order();

            UserProfileObj.SetToken("");
            OrderObj.SetOrderType("Individual");
            OrderObj.SetStatusName("Cancelled");
            IOrderDetailsDataLayer OrderDetailsDataLayerObj = new OrderDetailsDataLayer(UserProfileObj, OrderObj);

            try
            {
                DataSet Output = OrderDetailsDataLayerObj.FetchOrderDetailsByTypeAndStatus();
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(GotOutput, ExpectedOutput);
        }