コード例 #1
0
 public void GivenCustomerUserServiceAssociateRequestIsSetupWithDefaultValues()
 {
     customerServiceSupport.CreateCustomerModel =
         CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
     customerServiceSupport.PostValidCreateRequestToService();
     customerUserServiceSupport.AssociateCustomerUserModel = GetDefaultValidAssociateCustomerUserServiceRequest();
 }
コード例 #2
0
        public void GivenCustomerListConsumerServiceAssociateCustomerUserEventRequestIsSetupWithMultipleCustomerDefaultValues()
        {
            //Posting 1st Customer
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerServiceSupport.PostValidCreateRequestToService();
            multipleCustomerName[0] = customerServiceSupport.CreateCustomerModel.CustomerName;
            multipleCustomerGUID[0] = customerServiceSupport.CreateCustomerModel.CustomerUID;

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            //Posting 2nd Customer
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerServiceSupport.PostValidCreateRequestToService();
            multipleCustomerName[1] = customerServiceSupport.CreateCustomerModel.CustomerName;
            multipleCustomerGUID[1] = customerServiceSupport.CreateCustomerModel.CustomerUID;

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            //Posting 3rd Customer
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerServiceSupport.PostValidCreateRequestToService();
            multipleCustomerName[2] = customerServiceSupport.CreateCustomerModel.CustomerName;
            multipleCustomerGUID[2] = customerServiceSupport.CreateCustomerModel.CustomerUID;

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);
        }
コード例 #3
0
        public void WhenUpdateTheCustomerListConsumerServiceCreateCustomerEventRequestWithDifferentCustomerName()
        {
            Guid   oldCustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
            string oldCustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            customerServiceSupport.CreateCustomerModel.CustomerUID  = oldCustomerUID;
            customerServiceSupport.CreateCustomerModel.CustomerType = oldCustomerType;
        }
コード例 #4
0
        public void GivenCustomerListConsumerServiceCreateCustomerEventRequestIsSetupWithDefaultValues()
        {
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID.ToString();
            customerName = customerServiceSupport.CreateCustomerModel.CustomerName;
            customerType = customerServiceSupport.CreateCustomerModel.CustomerType.ToString();
            actionUTC    = customerServiceSupport.CreateCustomerModel.ActionUTC;
        }
コード例 #5
0
        public void WhenCustomerListConsumerServiceDeleteCustomerEventRequestIsSetupWithDefaultValues()
        {
            deleteCustomerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;
            deleteActionUTC   = DateTime.UtcNow;

            customerServiceSupport.DeleteCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceDeleteRequest();
            customerServiceSupport.DeleteCustomerModel.CustomerUID = deleteCustomerUID;
            customerServiceSupport.DeleteCustomerModel.ActionUTC   = deleteActionUTC;
        }
コード例 #6
0
        public void WhenCustomerListConsumerServiceUpdateCustomerEventRequestIsSetupWithDefaultValues()
        {
            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            Guid oldCustomerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

            //string oldCustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;

            customerServiceSupport.UpdateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceUpdateRequest();
            customerServiceSupport.UpdateCustomerModel.CustomerUID = oldCustomerUID;
            //customerServiceSupport.UpdateCustomerModel.CustomerName = oldCustomerName;
        }
コード例 #7
0
        public void CreateCustomer(string customerType, string customerName)
        {
            if (!CustomerNameWithUID.ContainsKey(customerName))
            {
                customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.CreateCustomerModel.CustomerType = customerType;
                customerServiceSupport.CreateCustomerModel.CustomerName = customerName;
                customerServiceSupport.PostValidCreateRequestToService();

                parentUID.Add(customerServiceSupport.CreateCustomerModel.CustomerUID);
                CustomerNameWithUID.Add(customerName, customerServiceSupport.CreateCustomerModel.CustomerUID);
            }
        }
コード例 #8
0
        public void GivenCustomerServiceCreateRequestIsSetupWithDefaultValues()
        {
            customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            //string requestCustomerString = JsonConvert.SerializeObject(customerServiceSupport.CreateCustomerModel);

            customerServiceSupport.PostValidCreateRequestToService();
            dealerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

            assetDetailsServiceSupport.DealerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
            assetDetailsServiceSupport.DealerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
            assetDetailsServiceSupport.DealerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

            customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";
        }
コード例 #9
0
        public void CreateCustomer(string customerType)
        {
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            if (customerType == "Dealer")
            {
                customerServiceSupport.CreateCustomerModel.CustomerType = "Dealer";
            }
            else if (customerType == "Customer")
            {
                customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";
            }


            customerServiceSupport.PostValidCreateRequestToService();
        }
コード例 #10
0
        public void GivenCustomerListConsumerServiceAssociateCustomerUserEventRequestIsSetupWithDefaultValues()
        {
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerServiceSupport.PostValidCreateRequestToService();

            multipleCustomerGUID[0] = customerServiceSupport.CreateCustomerModel.CustomerUID;

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            customerUserServiceSupport.AssociateCustomerUserModel             = CustomerUserServiceSteps.GetDefaultValidAssociateCustomerUserServiceRequest();
            customerUserServiceSupport.AssociateCustomerUserModel.CustomerUID = multipleCustomerGUID[0];
            Guid userUID = new Guid(CreateValueSingleCustomerUserWithUID());

            customerUserServiceSupport.AssociateCustomerUserModel.UserUID = userUID;
        }
コード例 #11
0
        public void CreateCustomer(string customerType, string customerName)
        {
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerServiceSupport.CreateCustomerModel.CustomerType = customerType;
            customerServiceSupport.CreateCustomerModel.CustomerName = customerName + DateTime.UtcNow.ToString("yyyyMMddhhmmss");
            if (customerType == "Account" && IsSameUCID)
            {
                customerServiceSupport.CreateCustomerModel.NetworkCustomerCode = UCID;
            }

            CustomerList.Add(customerServiceSupport.CreateCustomerModel.CustomerName, customerServiceSupport.CreateCustomerModel.CustomerUID);
            CustomerName.Add(customerServiceSupport.CreateCustomerModel.CustomerName);

            customerServiceSupport.PostValidCreateRequestToService();
        }
コード例 #12
0
        public void GivenCustomerServiceCreateRequestIsSetupFor(string associationType)
        {
            if (associationType == "CustomerWithSameDealer")
            {
                customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.PostValidCreateRequestToService();
                dealerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

                assetDetailsServiceSupport.DealerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
                assetDetailsServiceSupport.DealerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
                assetDetailsServiceSupport.DealerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

                customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";

                customerServiceSupport.PostValidCreateRequestToService();
                customerUID    = customerServiceSupport.CreateCustomerModel.CustomerUID;
                oldCustomerUID = customerUID;

                assetDetailsServiceSupport.FirstCustomerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
                assetDetailsServiceSupport.FirstCustomerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
                assetDetailsServiceSupport.FirstCustomerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

                customerRelationshipServiceSupport.CreateCustomerRelationshipModel = CustomerRelationshipServiceSteps.GetDefaultValidCustomerRelationshipServiceCreateRequest();
                customerRelationshipServiceSupport.CreateCustomerRelationshipModel.ParentCustomerUID = dealerUID;
                customerRelationshipServiceSupport.CreateCustomerRelationshipModel.ChildCustomerUID  = customerUID;
                customerRelationshipServiceSupport.PostValidCreateCustomerRelationshipRequestToService();

                customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";
            }
            else
            {
                customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.PostValidCreateRequestToService();
                dealerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

                assetDetailsServiceSupport.DealerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
                assetDetailsServiceSupport.DealerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
                assetDetailsServiceSupport.DealerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

                customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";
            }
        }
コード例 #13
0
        public void GivenCustomerServiceCreateRequestIsSetupForAssetAndDeviceVerification()
        {
            //first dealer
            customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            customerServiceSupport.PostValidCreateRequestToService();
            dealerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

            assetDetailsServiceSupport.FirstDealerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
            assetDetailsServiceSupport.FirstDealerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
            assetDetailsServiceSupport.FirstDealerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

            //first customer
            customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";

            customerServiceSupport.PostValidCreateRequestToService();
            customerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

            assetDetailsServiceSupport.FirstCustomerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
            assetDetailsServiceSupport.FirstCustomerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
            assetDetailsServiceSupport.FirstCustomerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

            //first dealer customer relationship
            customerRelationshipServiceSupport.CreateCustomerRelationshipModel = CustomerRelationshipServiceSteps.GetDefaultValidCustomerRelationshipServiceCreateRequest();
            customerRelationshipServiceSupport.CreateCustomerRelationshipModel.ParentCustomerUID = dealerUID;
            customerRelationshipServiceSupport.CreateCustomerRelationshipModel.ChildCustomerUID  = customerUID;
            customerRelationshipServiceSupport.PostValidCreateCustomerRelationshipRequestToService();

            //second dealer
            customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            customerServiceSupport.PostValidCreateRequestToService();
            dealerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

            assetDetailsServiceSupport.DealerModel.CustomerUID  = customerServiceSupport.CreateCustomerModel.CustomerUID;
            assetDetailsServiceSupport.DealerModel.CustomerName = customerServiceSupport.CreateCustomerModel.CustomerName;
            assetDetailsServiceSupport.DealerModel.CustomerType = customerServiceSupport.CreateCustomerModel.CustomerType;

            //second customer
            customerServiceSupport.CreateCustomerModel = CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
            customerServiceSupport.CreateCustomerModel.CustomerType = "Customer";
        }
コード例 #14
0
        //To Associate 'N' Dealers/Customers To A User
        public void AssociateUsersToACustomer(int numberOfCustomers, string customerType = null)
        {
            UserUID[0] = new Guid(CreateValueSingleCustomerUserWithUID());
            customerUserServiceSupport.AssociateCustomerUserModel         = CustomerUserServiceSteps.GetDefaultValidAssociateCustomerUserServiceRequest();
            customerUserServiceSupport.AssociateCustomerUserModel.UserUID = UserUID[0];

            for (int i = 0; i < numberOfCustomers; i++)
            {
                customerServiceSupport.CreateCustomerModel =
                    CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();
                customerServiceSupport.CreateCustomerModel.CustomerType = customerType;
                customerServiceSupport.PostValidCreateRequestToService();

                ParentCustomerUID[i]  = customerServiceSupport.CreateCustomerModel.CustomerUID;
                ParentCustomerName[i] = customerServiceSupport.CreateCustomerModel.CustomerName;
                ParentCustomerType[i] = customerServiceSupport.CreateCustomerModel.CustomerType;

                customerUserServiceSupport.AssociateCustomerUserModel.CustomerUID = ParentCustomerUID[i];
                customerUserServiceSupport.PostValidCustomerUserAssociateRequestToService();
            }
        }
コード例 #15
0
        public void GivenCustomerListConsumerServiceDissociateCustomerUserEventRequestIsSetupWithDefaultValues()
        {
            customerServiceSupport.CreateCustomerModel =
                CustomerServiceSteps.GetDefaultValidCustomerServiceCreateRequest();

            customerServiceSupport.PostValidCreateRequestToService();

            Guid oldCustomerUID = customerServiceSupport.CreateCustomerModel.CustomerUID;

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            customerUserServiceSupport.AssociateCustomerUserModel             = CustomerUserServiceSteps.GetDefaultValidAssociateCustomerUserServiceRequest();
            customerUserServiceSupport.AssociateCustomerUserModel.CustomerUID = oldCustomerUID;

            customerUserServiceSupport.PostValidCustomerUserAssociateRequestToService();

            CommonUtil.WaitToProcess(CustomerListConfig.KafkaTimeoutThreshold);

            customerUserServiceSupport.DissociateCustomerUserModel             = CustomerUserServiceSteps.GetDefaultValidDissociateCustomerUserServiceRequest();
            customerUserServiceSupport.DissociateCustomerUserModel.CustomerUID = oldCustomerUID;
            customerUserServiceSupport.DissociateCustomerUserModel.UserUID     = customerUserServiceSupport.AssociateCustomerUserModel.UserUID;
        }