Example #1
0
//        public ActionResult About()
//        {
//            ViewBag.Message = "Your application description page.";

//            return View();
//        }
//        public ActionResult Contact()
//        {
//            ViewBag.Message = "Your contact page.";

//            return View();
//        }
//        public ActionResult Ueditor()
//        {
//            ViewBag.Message = "Your contact page.";

//            return View();
//        }
//        [HttpPost]
//        [ValidateInput(false)]
//        public ActionResult UpUeditor(string content)
//        {
//            return Json(content);
//        }
//        [ActionName("action")]
//        public ActionResult dsadsa()
//        {
//            String sb="";
//            int temp = 0;
//            for (int i = list.Count; i >0; i--)
//            {
//                for (int j = 0; j < i-1; j++)
//                {
//                    if (list[j]>list[j+1])
//                    {

//                        temp = list[j];
//                        list[j] = list[j + 1];
//                        list[j + 1] = temp;
//                    }
//                }
//              sb+=  print()+@"/n";
//            }


//            return Content(print());

//        }
//        public string print()
//        {
//               StringBuilder sb = new StringBuilder();
//            list.ForEach(i => sb.Append("   "+i.ToString()));
//            return sb.ToString();
//        }
//        //发邮件测试
//        public ActionResult SendEmail()
//        {
//           //  //声明一个Mail对象
//           // MailMessage mymail = new MailMessage();
//           // //发件人地址
//           // //如是自己,在此输入自己的邮箱
//           // mymail.From = new MailAddress("*****@*****.**");
//           // //收件人地址
//           // mymail.To.Add(new MailAddress("*****@*****.**"));
//           // //邮件主题
//           // mymail.Subject = "测试(主题)";
//           // //邮件标题编码
//           // mymail.SubjectEncoding = System.Text.Encoding.UTF8;
//           // //发送邮件的内容
//           // mymail.Body ="<a href='#'>66<a/> <h2>H2<h2/>" ;
//           // //邮件内容编码
//           // mymail.BodyEncoding = System.Text.Encoding.UTF8;
//           // //添加附件
//           // //Attachment myfiles = new Attachment(tb_Attachment.PostedFile.FileName);
//           // //mymail.Attachments.Add(myfiles);
//           // //抄送到其他邮箱
//           //// mymail.CC.Add(new MailAddress(tb_cc.Text));
//           // //是否是HTML邮件
//           // mymail.IsBodyHtml = true;
//           // //邮件优先级
//           // mymail.Priority = MailPriority.High;
//           // //创建一个邮件服务器类
//           // SmtpClient myclient = new SmtpClient();
//           // myclient.Host = "SMTP.163.com";
//           // //SMTP服务端口
//           // myclient.Port = 25;
//           // //验证登录
//           // myclient.Credentials = new NetworkCredential("*****@*****.**", "2047566yh");//"@"输入有效的邮件名, "*"输入有效的密码
//           // myclient.Send(mymail);



//            // 设置发送方的邮件信息,例如使用网易的smtp
//            string smtpServer = "smtp.163.com"; //SMTP服务器
//            string mailFrom = "*****@*****.**"; //登陆用户名
//            string userPassword = "******";//登陆密码

//            // 邮件服务设置
//            SmtpClient smtpClient = new SmtpClient();
//            smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;//指定电子邮件发送方式
//            smtpClient.Host = smtpServer; //指定SMTP服务器
//            smtpClient.Credentials = new System.Net.NetworkCredential(mailFrom, userPassword);//用户名和密码

////发送邮件设置
//            MailMessage mailMessage = new MailMessage(mailFrom, "*****@*****.**"); // 发送人和收件人
//            mailMessage.Subject = "zhuti";//主题
//            mailMessage.Body = "content";//内容
//            mailMessage.BodyEncoding = Encoding.UTF8;//正文编码
//            mailMessage.IsBodyHtml = true;//设置为HTML格式
//            mailMessage.Priority = MailPriority.Low;//优先级

//            try
//            {
//                smtpClient.Send(mailMessage); // 发送邮件

//            }
//            catch (SmtpException ex)
//            {

//            }
//           // int i = SendEmail("*****@*****.**", "123456yh", new string[] { "*****@*****.**" }, "标题", " mailMessage.BodyEncoding = Encoding.UTF8 这是测试中,zheshiceshi 689542dadasdasd邮件服务设置");


//            return Content("结果:");
//        }
//        ///<summary>
//        /// 发送邮件
//        ///</summary>
//        ///<param name="sendEmailAddress">发件人邮箱</param>
//        ///<param name="sendEmailPwd">发件人密码</param>
//        ///<param name="msgToEmail">收件人邮箱地址</param>
//        ///<param name="title">邮件标题</param>
//        ///<param name="content">邮件内容</param>
//        ///<returns>0:失败。1:成功!</returns>
//        public static int SendEmail(string sendEmailAddress, string sendEmailPwd, string[] msgToEmail, string title, string content)
//        {
//            //发件者邮箱地址
//            string fjrtxt = sendEmailAddress;
//            //发件者邮箱密码
//            string mmtxt = sendEmailPwd;
//            ////收件人收箱地址
//            //string sjrtxt = msgToEmail;
//            //主题
//            string zttxt = title;
//            //附件
//            //string fjtxt = fj.Text;
//            //内容
//            string nrtxt = content;
//            string[] fasong = fjrtxt.Split('@');
//            string[] fs = fasong[1].Split('.');
//            //发送
//            //设置邮件协议
//            SmtpClient client = new SmtpClient("smtp." + fs[0].ToString().Trim() + ".com");
//            client.UseDefaultCredentials = false;
//            //通过网络发送到Smtp服务器
//            client.DeliveryMethod = SmtpDeliveryMethod.Network;
//            //通过用户名和密码 认证
//            client.Credentials = new NetworkCredential(fasong[0].ToString(), mmtxt);
//            //发件人和收件人的邮箱地址
//            MailMessage mmsg = new MailMessage();
//            mmsg.From = new MailAddress(fjrtxt);
//            for (int i = 0; i < msgToEmail.Length; i++)
//            {
//                mmsg.To.Add(new MailAddress(msgToEmail[i]));
//            }
//            //邮件主题
//            mmsg.Subject = zttxt;
//            //主题编码
//            mmsg.SubjectEncoding = Encoding.UTF8;
//            //邮件正文
//            mmsg.Body = nrtxt;
//            //正文编码
//            mmsg.BodyEncoding = Encoding.UTF8;
//            //设置为HTML格式
//            mmsg.IsBodyHtml = true;
//            //优先级
//            mmsg.Priority = MailPriority.Low;
//            //if (fj.Text.Trim() != "")
//            //{
//            ////增加附件
//            //    mmsg.Attachments.Add(new Attachment(fj.Text));
//            //}
//            try
//            {
//                client.Send(mmsg);
//                return 1;
//            }
//            catch(Exception ex)
//            {
//                return 0;
//            }

//        }
//        delegate decimal pref(decimal amount);
//        public ActionResult Music()
//        {



//            return View();
//        }

        public ActionResult test()
        {
            UnitTest1 unitTest1 = new UnitTest1();

            unitTest1.TestMethod1();
            return(Content(""));
        }
Example #2
0
        static void Main(string[] args)
        {
            var unitTest = new UnitTest1();

            unitTest.TestSamplingHistogrammDataFactory1();
            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            UnitTest1 u = new UnitTest1();

            u.TestMethod2();

            Console.ReadLine();
        }
Example #4
0
    public void BenchmarkMethod(BenchmarkContext context)
    {
        //var b = new byte[1024];
        //_counter.Increment();
        UnitTest1 u = new UnitTest1();

        u.AddTaskwithParent();
    }
Example #5
0
    public void BenchmarkMethod2(BenchmarkContext context)
    {
        //var b = new byte[1024];
        //_counter.Increment();
        UnitTest1 u = new UnitTest1();

        u.GetTaskByID();
    }
        public string currentPlayerTest(
            [PexAssumeUnderTest] UnitTest1 target,
            string playerWhosTurnIsRN,
            string otherPlayer
            )
        {
            string result = target.currentPlayer(playerWhosTurnIsRN, otherPlayer);

            return(result);
            // TODO: add assertions to method UnitTest1Test.currentPlayerTest(UnitTest1, String, String)
        }
Example #7
0
        public string ChangePlayerTest(
            [PexAssumeUnderTest] UnitTest1 target,
            int playerCounter,
            string player1,
            string player2
            )
        {
            string result = target.ChangePlayer(playerCounter, player1, player2);

            return(result);
            // TODO: add assertions to method UnitTest1Test.ChangePlayerTest(UnitTest1, Int32, String, String)
        }
Example #8
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            //render the spectrum
            GenerateLineSpectrum();
            if (_lightScanTask.IsCompleted)
            {
                if (!_lightInitialized)
                {
                    _lightsOn = _lightsController.GetLightsByPowerStatus(true);

                    if (_lightsOn.Count > 0)
                    {
                        _lineSpectrum.StartColor = _lightsOn[0].CurrentColor;
                        _flowColor = _lineSpectrum.StartColor;
                        r          = new ColorChannelShifter(_lineSpectrum.StartColor.R);
                        b          = new ColorChannelShifter(_lineSpectrum.StartColor.B);
                        g          = new ColorChannelShifter(_lineSpectrum.StartColor.G);

                        b.GoingUp         = true;
                        _lightInitialized = true;
                    }
                }

                if (_lightInitialized && _lightsOn.Count > 0 && _lineSpectrum.EnableLights)
                {
                    if (_lineSpectrum.UseFlow)
                    {
                        var shifters = new List <ColorChannelShifter> {
                            r, g, b
                        };
                        _flowColor = UnitTest1.Flow(shifters, _lightsController, 2);
                        _lightsOn.SetColors(_flowColor.AdjustPercentage(_lineSpectrum.MaxPercent));
                    }
                    else
                    {
                        _lightsOn.SetColors(_lineSpectrum.StartColor.AdjustPercentage(_lineSpectrum.MaxPercent));
                    }


                    if (_lineSpectrum.DelayMS > 0)
                    {
                        System.Threading.Thread.Sleep(_lineSpectrum.DelayMS);
                    }
                }
            }
            GenerateVoice3DPrintSpectrum();
        }
Example #9
0
        static void Main(string[] args)
        {
            var publicador = new Publicador();

            Console.WriteLine(" \n1:Subir código: \n2: Compilar: \n3:Ejecución de pruebas unitarias: \n4. Instalar versión: \n5. Correo de notificación: \n \nSelecciona una opción: \n");
            string opt;

            opt = Console.ReadLine();

            switch (opt)
            {
            case "1":
                var subirCodigo = new SubirCodigo();
                publicador.AgregaPublicador(subirCodigo);
                publicador.TareaRealizada("");
                break;

            case "2":
                var compilar = new Compilar();
                publicador.AgregaPublicador(compilar);
                publicador.TareaRealizada("");
                break;

            case "3":
                var unitTest = new UnitTest1();
                publicador.AgregaPublicador(unitTest);
                publicador.TareaRealizada("");
                break;

            case "4":
                var instalarVersion = new InstalarVersion();
                publicador.AgregaPublicador(instalarVersion);
                publicador.TareaRealizada("");
                break;

            case "5":
                var notificar = new CorreoElectroncio();
                publicador.AgregaPublicador(notificar);
                publicador.TareaRealizada("");
                break;

            default:
                break;
            }
        }
Example #10
0
        public static void Main()
        {
            //Console.WriteLine("Welcome to Bridge.NET");

            UnitTest1.RunTests();

            // After building (Ctrl + Shift + B) this project,
            // browse to the /bin/Debug or /bin/Release folder.

            // A new bridge/ folder has been created and
            // contains your projects JavaScript files.

            // Open the bridge/index.html file in a browser by
            // Right-Click > Open With..., then choose a
            // web browser from the list

            // This application will then run in the browser.
        }
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                Xamarin.Forms.Forms.Init(e);

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();

            UnitTest1 ut1 = new UnitTest1();
            ut1.TestMethod1Async();
        }
Example #12
0
        static void Main(string[] args)
        {
            UnitTest1 tests = new UnitTest1();

            tests.IsInSilentMode = true;
            tests.NumberOfRuns   = 2;

            string logFile = Path.GetTempPath() + "test.logger.txt";


            Parallel.For(0, 3, (i) =>
            {
                tests.BeforeEach();

                tests.TestMethod1();

                tests.AfterEach();
                tests.AfterAll();
            });
        }
Example #13
0
 public CaixaEletronicoControllerTest()
 {
     mockService = new Mock <ICaixaEletronicoService>();
     controller  = new CaixaEletronicoController(mockService.Object);
     teste       = new UnitTest1();
 }
Example #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            var o = new UnitTest1();

            o.TestMethod1();
        }
        public void Testcase2()
        {
            UnitTest1 test2 = new UnitTest1();

            test2.TC_2_verifyAccessibleViaDifferentBrowsers();
        }
 public OperacoesCaixaEletronicoTest()
 {
     mockService = new Mock <IOperacoesCaixaEletronicoService>();
     controller  = new OperacoesCaixaEletronicoController(mockService.Object);
     testes      = new UnitTest1();
 }
        public void TestCase1()
        {
            UnitTest1 test1 = new UnitTest1();

            test1.TC_1_verifyTopDanmarkIsAppearingFirstInSearch();
        }
Example #18
0
 public void createBoardTest([PexAssumeUnderTest] UnitTest1 target, int[] boardSize)
 {
     target.createBoard(boardSize);
     // TODO: add assertions to method UnitTest1Test.createBoardTest(UnitTest1, Int32[])
 }
 public void IsValidEmailTest([PexAssumeUnderTest] UnitTest1 target)
 {
     target.IsValidEmailTest();
     // TODO: add assertions to method UnitTest1Test.IsValidEmailTest(UnitTest1)
 }