Example #1
0
        public void ThenTheUpdateCustomerEventDetailsAreStoredInVSSDB()
        {
            string customerUID         = customerServiceSupport.UpdateCustomerModel.CustomerUID.ToString().Replace("-", "");
            string customerName        = String.IsNullOrEmpty(customerServiceSupport.UpdateCustomerModel.CustomerName) ? customerServiceSupport.CreateCustomerModel.CustomerName : customerServiceSupport.UpdateCustomerModel.CustomerName;
            string customerType        = customerServiceSupport.CreateCustomerModel.CustomerType.ToString();
            string primaryContactEmail = customerServiceSupport.UpdateCustomerModel.PrimaryContactEmail == null ? customerServiceSupport.CreateCustomerModel.PrimaryContactEmail : customerServiceSupport.UpdateCustomerModel.PrimaryContactEmail;
            string firstName           = customerServiceSupport.UpdateCustomerModel.FirstName == null ? customerServiceSupport.CreateCustomerModel.FirstName : customerServiceSupport.UpdateCustomerModel.FirstName;
            string lastName            = customerServiceSupport.UpdateCustomerModel.LastName == null ? customerServiceSupport.CreateCustomerModel.LastName : customerServiceSupport.UpdateCustomerModel.LastName;

            CommonUtil.WaitToProcess("2"); //Wait for the data to get persisted in DB

            List <string> columnList = new List <string>()
            {
                "CustomerUID", "CustomerName", "CustomerType", "PrimaryContactEmail", "FirstName", "LastName"
            };
            List <string> updateCustomerDetails = new List <string>();

            updateCustomerDetails.Add(customerUID.ToUpper());
            updateCustomerDetails.Add(customerName);
            updateCustomerDetails.Add(GetCustomerTypeId(customerType));
            updateCustomerDetails.Add(primaryContactEmail);
            updateCustomerDetails.Add(firstName);
            updateCustomerDetails.Add(lastName);

            string validateQuery     = CustomerServiceMySqlQueries.CustomerDetailsByCustomerUID + customerUID + "')";
            string validateDateQuery = CustomerServiceMySqlQueries.CustomerUpdateUTCByCustomerUID + customerUID + "')";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, updateCustomerDetails);
            MySqlUtil.ValidateMySQLDateValueQuery(MySqlConnectionString, validateDateQuery, DateTime.UtcNow.AddMinutes(-2), "LESS_THAN_DB");
        }
Example #2
0
        public void ThenTheAssociateCustomerUserEventDetailsAreStoredInVSSDB()
        {
            customerUID = customerUserServiceSupport.AssociateCustomerUserModel.CustomerUID.ToString();
            userUID     = customerUserServiceSupport.AssociateCustomerUserModel.UserUID.ToString();

            string validateQuery = CustomerListSqlQueries.CustomerUserDetailsByCustomerUID + userUID + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, customerUID);
        }
Example #3
0
        public void ThenTheAssociateCustomerUserEventDetailsForAllCustomersAreStoredInVSSDB()
        {
            userUID = customerUserServiceSupport.AssociateCustomerUserModel.UserUID.ToString();

            for (int index = 0; index <= 2; index++)
            {
                string validateQuery = CustomerListSqlQueries.CustomerUserDetailsByUserUID +
                                       multipleCustomerGUID[index].ToString() + "'";
                MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, userUID);
            }
        }
Example #4
0
        public void ThenTheUpdateCustomerEventDetailsAreUpdatedInVSSDB()
        {
            customerUID  = customerServiceSupport.UpdateCustomerModel.CustomerUID.ToString();
            customerName = customerServiceSupport.UpdateCustomerModel.CustomerName;

            string validateQuery     = CustomerListSqlQueries.CustomerNameUpdateByCustomerUID + customerUID + "'";
            string validateDateQuery = CustomerListSqlQueries.CustomerUpdateUTCByCustomerUID + customerUID + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, customerName.ToString());
            MySqlUtil.ValidateMySQLDateValueQuery(MySqlConnectionString, validateDateQuery, actionUTC, "LESS_THAN_DB");
        }
Example #5
0
        public void ThenTheAssociateCustomerUserEventDetailsAreStoredInVSSDB()
        {
            CommonUtil.WaitToProcess("2");

            string customerUID       = customerAssetServiceSupport.AssociateCustomerAssetModel.CustomerUID.ToString();
            string assetUID          = customerAssetServiceSupport.AssociateCustomerAssetModel.AssetUID.ToString();
            string assetRelationType = customerAssetServiceSupport.AssociateCustomerAssetModel.RelationType.ToString();


            List <string> columnList = new List <string>()
            {
                "fk_CustomerUID", "fk_AssetUID", "fk_AssetRelationTypeID"
            };
            List <string> createCustomerDetails = new List <string>();

            createCustomerDetails.Add(customerUID);
            createCustomerDetails.Add(assetUID);
            createCustomerDetails.Add(GetAssetRelationTypeId(assetRelationType));

            string validateQuery = CustomerServiceMySqlQueries.CustomerAssetDetailsByCustomerUID + customerUID + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, customerUID);
        }
Example #6
0
        public void ThenTheCreateCustomerRelationshipEventDetailsAreStoredInVSSDB()
        {
            CommonUtil.WaitToProcess("2");

            string parentCustomerUid = customerRelationshipServiceSupport.CreateCustomerRelationshipModel.ParentCustomerUID.ToString();
            string childCustomerUid  = customerRelationshipServiceSupport.CreateCustomerRelationshipModel.ChildCustomerUID.ToString();

            List <string> columnList = new List <string>()
            {
                "fk_ParentCustomerUID", "fk_CustomerUID", "fk_RootCustomerUID", "LeftNodePosition", "RightNodePosition"
            };
            List <string> parentCustomerDetails = new List <string>();

            parentCustomerDetails.Add(parentCustomerUid);
            parentCustomerDetails.Add(parentCustomerUid);
            parentCustomerDetails.Add(parentCustomerUid);
            parentCustomerDetails.Add("1");
            parentCustomerDetails.Add("4");
            string validateQuery = CustomerServiceMySqlQueries.CustomerRelationshipByParentCustomerUID + parentCustomerUid + "'and fk_CustomerUID='" + parentCustomerUid + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, parentCustomerDetails);

            List <string> childcolumnList = new List <string>()
            {
                "fk_ParentCustomerUID", "fk_CustomerUID", "fk_RootCustomerUID", "LeftNodePosition", "RightNodePosition"
            };
            List <string> childCustomerDetails = new List <string>();

            childCustomerDetails.Add(parentCustomerUid);
            childCustomerDetails.Add(childCustomerUid);
            childCustomerDetails.Add(parentCustomerUid);
            childCustomerDetails.Add("2");
            childCustomerDetails.Add("3");
            string validateChildCustomerQuery = CustomerServiceMySqlQueries.CustomerRelationshipByChildCustomerUID + childCustomerUid + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateChildCustomerQuery, childCustomerDetails);
        }
Example #7
0
        public void ThenTheCreateCustomerEventDetailsAreStoredInVSSDB()
        {
            customerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID.ToString();
            customerName = customerServiceSupport.CreateCustomerModel.CustomerName;
            customerType = customerServiceSupport.CreateCustomerModel.CustomerType.ToString();

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            List <string> columnList = new List <string>()
            {
                "CustomerUID", "CustomerName", "CustomerType"
            };
            List <string> createCustomerDetails = new List <string>();

            createCustomerDetails.Add(customerUID);
            createCustomerDetails.Add(customerName);
            createCustomerDetails.Add(GetCustomerTypeId(customerType));

            string validateQuery     = CustomerListSqlQueries.CustomerDetailsByCustomerUID + customerUID + "'";
            string validateDateQuery = CustomerListSqlQueries.CustomerUpdateUTCByCustomerUID + customerUID + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, createCustomerDetails);
            MySqlUtil.ValidateMySQLDateValueQuery(MySqlConnectionString, validateDateQuery, DateTime.UtcNow.AddMinutes(-2), "LESS_THAN_DB");
        }
Example #8
0
        public void ThenTheDissociateCustomerUserEventDetailsAreInvalidUserNOTRemovedInVSSDB()
        {
            string validateQuery = CustomerListSqlQueries.CustomerUserDetailsByUserUID + customerUID + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, userUID); // NOT Removed In VSS DB
        }
Example #9
0
        public void ThenTheCreateCustomerEventDetailsAreNOTUpdatedInVSSDB()
        {
            string validateQuery = CustomerListSqlQueries.CustomerTypeIdByCustomerUID + customerUID + "'";

            MySqlUtil.ValidateMySQLQuery(MySqlConnectionString, validateQuery, "1"); //Not Updated As Customer
        }