Beispiel #1
0
        public void Start(string appDynamicsBankIP, string port, int timerange1, int timerange2)
        {
            string bindingURI = string.Format("http://{0}:{1}/AppDynamicsBank/CreditCardService?wsdl", appDynamicsBankIP, port);

            disco = new AppDMoviesWSAutoDiscovery(bindingURI, interfaceContractName);
            Console.WriteLine(string.Format("Partial auto discovery done, basic http binding done:{0}", bindingURI));
            //sometimes duplicates are generated,but for testing this is not an issue
            List <string> ccnumbers = RandomCreditCardNumberGenerator.GenerateMasterCardNumbers(CARD_LIST_SIZE).ToList();
            int           next      = 0;
            Random        rnd       = new Random();

            while (true)
            {
                double amount     = GetRandomAmount();
                string creditcard = ccnumbers[next++];
                //write a method to generate different credit cards
                if (next >= CARD_LIST_SIZE)
                {
                    next = 0;                        //this is just to recycle the crecit card numbers for the purpose of this test
                }
                ValidateAndChargeCard(creditcard, amount);
                int interval = rnd.Next(timerange1 * 1000, timerange2 * 1000);
                System.Threading.Thread.Sleep(interval);
            }
        }
Beispiel #2
0
        public void Bind(string appDynamicsBankIP, string port)
        {
            string bindingURI = string.Format("http://{0}:{1}/AppDynamicsBank/CreditCardService?wsdl", appDynamicsBankIP, port);

            disco = new AppDMoviesWSAutoDiscovery(bindingURI, interfaceContractName);
            Console.WriteLine(string.Format("Partial auto discovery done, basic http binding done:{0}", bindingURI));
        }
        public void Start(string appDynamicsBankIP, string port, int timerange1, int timerange2)
        {
            string bindingURI = string.Format("http://{0}:{1}/AppDynamicsBank/CreditCardService?wsdl", appDynamicsBankIP, port);
            disco = new AppDMoviesWSAutoDiscovery(bindingURI, interfaceContractName);
            Console.WriteLine(string.Format("Partial auto discovery done, basic http binding done:{0}", bindingURI));
            //sometimes duplicates are generated,but for testing this is not an issue
            List<string> ccnumbers = RandomCreditCardNumberGenerator.GenerateMasterCardNumbers(CARD_LIST_SIZE).ToList();
            int next = 0;
            Random rnd = new Random();

            while (true)
            {
                double amount = GetRandomAmount();
                string creditcard = ccnumbers[next++];
                //write a method to generate different credit cards
                if (next >= CARD_LIST_SIZE) next = 0;//this is just to recycle the crecit card numbers for the purpose of this test
                ValidateAndChargeCard(creditcard, amount);
                int interval = rnd.Next(timerange1 * 1000, timerange2 * 1000);
                System.Threading.Thread.Sleep(interval);
            }
        }
 public void Bind(string appDynamicsBankIP, string port)
 {
     string bindingURI = string.Format("http://{0}:{1}/AppDynamicsBank/CreditCardService?wsdl", appDynamicsBankIP, port);
     disco = new AppDMoviesWSAutoDiscovery(bindingURI, interfaceContractName);
     Console.WriteLine(string.Format("Partial auto discovery done, basic http binding done:{0}", bindingURI));
 }