Ejemplo n.º 1
0
        public void GeneticStringTest()
        {
            GenericCheck <String> obj = new GenericCheck <String>();
            String actual             = (obj.Max("26", "33", "82"));

            Assert.Equal("82", actual);
        }
Ejemplo n.º 2
0
        public void GeneticFloatTest()
        {
            GenericCheck <double> obj = new GenericCheck <double>();
            double actual             = (obj.Max(2.6, 3.3, 8.2));

            Assert.Equal(8.2, actual);
        }
Ejemplo n.º 3
0
        public void GeneticIntTest()
        {
            GenericCheck <int> obj = new GenericCheck <int>();
            int actual             = (obj.Max(22, 33, 90));

            Assert.Equal(90, actual);
        }
Ejemplo n.º 4
0
 private void worker_DoWork(object sender, DoWorkEventArgs e)
 {
     checkLogin = currentSite.Login(username, password, twofactor);
     if (checkLogin.status)
     {
         checkBalance = currentSite.Balance();
     }
 }
Ejemplo n.º 5
0
        public void GeneticMaximumStringTest()
        {
            GenericCheck <String> obj3 = new GenericCheck <String>();

            String[] arr3    = { "88", "8", "56", "75" };
            String   actual3 = (obj3.Max(arr3));

            Assert.Equal("88", actual3);
        }
Ejemplo n.º 6
0
        public void GeneticMaximumDoubleTest()
        {
            GenericCheck <double> obj2 = new GenericCheck <double>();

            double[] arr2    = { 8.8, 1.2, 5.6, 7.5 };
            double   actual2 = (obj2.Max(arr2));

            Assert.Equal(8.8, actual2);
        }
Ejemplo n.º 7
0
        public void GeneticMaximumIntTest()
        {
            GenericCheck <int> obj1 = new GenericCheck <int>();

            int[] arr1    = { 88, 8, 56, 75 };
            int   actual1 = (obj1.Max(arr1));

            Assert.Equal(88, actual1);
        }
Ejemplo n.º 8
0
        public void givenmorethanthreeNumbers_whenallDatatype_returntestmaximum()
        {
            GenericCheck <int>    obj1 = new GenericCheck <int>();
            GenericCheck <double> obj2 = new GenericCheck <double>();
            GenericCheck <int>    obj3 = new GenericCheck <int>();

            int[]    Number1 = { 23, 43, 45, 55, 98, 60 };
            double[] Number2 = { 0.5, 11.2, 20.9, 30.4, 70.8, 1.8 };
            int[]    Number3 = { "The".Length, "Maximum".Length, "Number".Length, "Problem".Length, "using".Length, "Generics".Length };
            int      result1 = (obj1.Max(Number1));
            double   result2 = (obj2.Max(Number2));
            int      result3 = (obj3.Max(Number3));

            Assert.AreEqual(98, result1);
            Assert.AreEqual(70.8, result2);
            Assert.AreEqual(8, result3);
        }
Ejemplo n.º 9
0
        private void ClearCloudVariables()
        {
            _CloudStrats = null;
            _CloudLoadConnected = null;
            CloudLoadMode = 0;
            CloudDownloadedStrat = null;
            _CloudTotalBets = 0;
            _CloudWinStreak = 0;
            _CloudLossStreak = 0;
            _CloudProfit = 0;
            _CloudUploadName = string.Empty;
            _CloudUploadDescription = string.Empty;
            _CloudUploadMinBalance = string.Empty;
            CloudUploadCode = string.Empty;

        }
Ejemplo n.º 10
0
 private void cloudWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     using (var web = new HttpClient())
     {
         switch (CloudLoadMode)
         {
             case 1:
                 _CloudStrats = null;
                 _CloudLoadConnected = null;
                 try
                 {
                     _CloudStrats = JsonConvert.DeserializeObject<Strats>(web.GetAsync("http://www.autodice.net/internal/stratdb?getdetails").Result.Content.ReadAsStringAsync().Result);
                     _CloudLoadConnected = new GenericCheck { status = true };
                 }
                 catch
                 {
                     _CloudLoadConnected = new GenericCheck
                     {
                         status = false,
                         error = "Unable to connect to Strategies Database."
                     };
                 }
                 break;
             case 2:
                 CloudDownloadedStrat = null;
                 CloudDownloadedStrat = web.GetAsync(
                     $"http://www.autodice.net/internal/stratdb?getstrat&name={_CloudLoadName}").Result.Content.ReadAsStringAsync().Result.Split('\n');
                 break;
             case 3:
                 var contentStrat = new FormUrlEncodedContent(new[]
                 {
                     new KeyValuePair<string, string>("name", Base64Encode(_CloudUploadName)),
                     new KeyValuePair<string, string>("description", Base64Encode(_CloudUploadDescription)),
                     new KeyValuePair<string, string>("author", _username),
                     new KeyValuePair<string, string>("minbalance", _CloudUploadMinBalance),
                     new KeyValuePair<string, string>("totalbets", _CloudTotalBets.ToString()),
                     new KeyValuePair<string, string>("profit", _CloudProfit.ToString("0.00000000", CultureInfo.InvariantCulture)),
                     new KeyValuePair<string, string>("biggestwinstreak", _CloudWinStreak.ToString()),
                     new KeyValuePair<string, string>("biggestlossstreak", _CloudLossStreak.ToString()),
                     new KeyValuePair<string, string>("code", CloudUploadCode)
                 });
                 try
                 {
                     _CloudLoadConnected = null;
                     var resultContent = web.PostAsync("http://www.autodice.net/internal/stratdb?setstrat", contentStrat).Result.Content.ReadAsStringAsync().Result;
                     _CloudLoadConnected = new GenericCheck { status = true, error = resultContent };
                 }
                 catch
                 {
                     _CloudLoadConnected = new GenericCheck { status = false, error = "Unable to connect with Strat Database" };
                 }
                 break;
         }
     }
 }