Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            QTest qTest = db.QTests.Find(id);

            db.QTests.Remove(qTest);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "QTestID,FQTuserID,StartTime,EndTime,Score,QTNote,Status,TestTime,TimePerWord,Minutes,Seconds,Duration")] QTest qTest)
 {
     if (ModelState.IsValid)
     {
         qTest.FQTuserID       = userid;
         db.Entry(qTest).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //  ViewBag.FQTuserID = new SelectList(db.Users, "UserID", "Forename", qTest.FQTuserID);
     return(View(qTest));
 }
Пример #3
0
        public void Can_wait_for()
        {
            int counter = 0;

            QTest.QWaitFor(
                () =>
            {
                counter++;
                return(counter == 5);
            }, TimeSpan.FromSeconds(5)).Should().BeTrue();
            counter.Should().Be(5);
        }
Пример #4
0
        // GET: QTest/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            QTest qTest = db.QTests.Find(id);

            if (qTest == null)
            {
                return(HttpNotFound());
            }
            return(View(qTest));
        }
Пример #5
0
        // GET: QTest/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            QTest qTest = db.QTests.Find(id);

            if (qTest == null)
            {
                return(HttpNotFound());
            }
            //   ViewBag.FQTuserID = new SelectList(db.Users, "UserID", "Forename", qTest.FQTuserID);
            return(View(qTest));
        }
Пример #6
0
        // [ValidateAntiForgeryToken]
        public ActionResult Create(int[] TestWordsParameters, string title, int rstatus, int time)  //string Title, bool? TotalTime , bool? Second, DateTime? Time
        {
            //   string name = Request.Form["Title"].ToString();

            QTest test = new QTest();

            if (TestWordsParameters != null)
            {
                test.QTNote = title;

                if (rstatus == 1)
                {
                    test.Score    = time;
                    test.TestTime = true;
                }
                else if (rstatus == 2)
                {
                    test.Score       = time;
                    test.TimePerWord = true;
                }
                for (int j = 0; j < TestWordsParameters.Length; j++)
                {
                    var       r  = TestWordsParameters[j];
                    QuestTest wt = new QuestTest();
                    wt.FQuesterID = r;
                    test.QuestTests.Add(wt);  // parent.childs.Add(child obj)
                }
                test.FQTuserID = userid;

                db.QTests.Add(test);
                db.SaveChanges();
            }

            // ViewBag.FWTUserID = new SelectList(db.Users, "UserID", "Forename", wTest.FWTUserID);
            return(RedirectToAction("Create"));
        }
Пример #7
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void SendKeyEvent(QTest.KeyAction action, QWidget widget, Qt.Key code, string text, uint modifier)
 {
     staticInterceptor.Invoke("sendKeyEvent$#$$$", "sendKeyEvent(QTest::KeyAction, QWidget*, Qt::Key, QString, Qt::KeyboardModifiers)", typeof(void), typeof(QTest.KeyAction), action, typeof(QWidget), widget, typeof(Qt.Key), code, typeof(string), text, typeof(uint), modifier);
 }
Пример #8
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void QSkip(string message, QTest.SkipMode mode, string file, int line)
 {
     staticInterceptor.Invoke("qSkip$$$$", "qSkip(const char*, QTest::SkipMode, const char*, int)", typeof(void), typeof(string), message, typeof(QTest.SkipMode), mode, typeof(string), file, typeof(int), line);
 }
Пример #9
0
Файл: QTest.cs Проект: KDE/qyoto
 public static bool QExpectFail(string dataIndex, string comment, QTest.TestFailMode mode, string file, int line)
 {
     return (bool) staticInterceptor.Invoke("qExpectFail$$$$$", "qExpectFail(const char*, const char*, QTest::TestFailMode, const char*, int)", typeof(bool), typeof(string), dataIndex, typeof(string), comment, typeof(QTest.TestFailMode), mode, typeof(string), file, typeof(int), line);
 }
Пример #10
0
 public void Can_wait_for_timeout()
 {
     QTest.QWaitFor(() => { return(false); }, TimeSpan.FromSeconds(1)).Should().BeFalse();
 }
Пример #11
0
 public void AddKeyEvent(QTest.KeyAction action, Qt.Key qtKey, uint modifiers, int msecs)
 {
     interceptor.Invoke("addKeyEvent$$$$", "addKeyEvent(QTest::KeyAction, Qt::Key, Qt::KeyboardModifiers, int)", typeof(void), typeof(QTest.KeyAction), action, typeof(Qt.Key), qtKey, typeof(uint), modifiers, typeof(int), msecs);
 }
Пример #12
0
 public void AddKeyEvent(QTest.KeyAction action, char ascii, uint modifiers)
 {
     interceptor.Invoke("addKeyEvent$$$", "addKeyEvent(QTest::KeyAction, char, Qt::KeyboardModifiers)", typeof(void), typeof(QTest.KeyAction), action, typeof(char), ascii, typeof(uint), modifiers);
 }
Пример #13
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void KeyEvent(QTest.KeyAction action, QWidget widget, char ascii, uint modifier, int delay)
 {
     staticInterceptor.Invoke("keyEvent$#$$$", "keyEvent(QTest::KeyAction, QWidget*, char, Qt::KeyboardModifiers, int)", typeof(void), typeof(QTest.KeyAction), action, typeof(QWidget), widget, typeof(char), ascii, typeof(uint), modifier, typeof(int), delay);
 }
Пример #14
0
        protected bool ExecApplicationWithTimeout(int timeoutMs)
        {
            var testContext = TypeCreator.Create(typeof(TestContext)) as TestContext;

            return(QTest.QWaitFor(() => testContext.Quited, timeoutMs));
        }
Пример #15
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void SendKeyEvent(QTest.KeyAction action, QWidget widget, Qt.Key code, char ascii, uint modifier)
 {
     staticInterceptor.Invoke("sendKeyEvent$#$$$", "sendKeyEvent(QTest::KeyAction, QWidget*, Qt::Key, char, Qt::KeyboardModifiers)", typeof(void), typeof(QTest.KeyAction), action, typeof(QWidget), widget, typeof(Qt.Key), code, typeof(char), ascii, typeof(uint), modifier);
 }
Пример #16
0
 public void AddKeyEvent(QTest.KeyAction action, Qt.Key qtKey)
 {
     interceptor.Invoke("addKeyEvent$$", "addKeyEvent(QTest::KeyAction, Qt::Key)", typeof(void), typeof(QTest.KeyAction), action, typeof(Qt.Key), qtKey);
 }
Пример #17
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void KeyEvent(QTest.KeyAction action, QWidget widget, char ascii)
 {
     staticInterceptor.Invoke("keyEvent$#$", "keyEvent(QTest::KeyAction, QWidget*, char)", typeof(void), typeof(QTest.KeyAction), action, typeof(QWidget), widget, typeof(char), ascii);
 }
Пример #18
0
 public void AddKeyEvent(QTest.KeyAction action, char ascii)
 {
     interceptor.Invoke("addKeyEvent$$", "addKeyEvent(QTest::KeyAction, char)", typeof(void), typeof(QTest.KeyAction), action, typeof(char), ascii);
 }
Пример #19
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void KeyEvent(QTest.KeyAction action, QWidget widget, Qt.Key key, uint modifier)
 {
     staticInterceptor.Invoke("keyEvent$#$$", "keyEvent(QTest::KeyAction, QWidget*, Qt::Key, Qt::KeyboardModifiers)", typeof(void), typeof(QTest.KeyAction), action, typeof(QWidget), widget, typeof(Qt.Key), key, typeof(uint), modifier);
 }
Пример #20
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void KeyEvent(QTest.KeyAction action, QWidget widget, Qt.Key key)
 {
     staticInterceptor.Invoke("keyEvent$#$", "keyEvent(QTest::KeyAction, QWidget*, Qt::Key)", typeof(void), typeof(QTest.KeyAction), action, typeof(QWidget), widget, typeof(Qt.Key), key);
 }
Пример #21
0
Файл: QTest.cs Проект: KDE/qyoto
 public static void MouseEvent(QTest.MouseAction action, QWidget widget, Qt.MouseButton button, uint stateKey, QPoint pos)
 {
     staticInterceptor.Invoke("mouseEvent$#$$#", "mouseEvent(QTest::MouseAction, QWidget*, Qt::MouseButton, Qt::KeyboardModifiers, QPoint)", typeof(void), typeof(QTest.MouseAction), action, typeof(QWidget), widget, typeof(Qt.MouseButton), button, typeof(uint), stateKey, typeof(QPoint), pos);
 }
Пример #22
0
 public QTestMouseEvent(QTest.MouseAction action, Qt.MouseButton button, uint modifiers, QPoint position, int delay)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QTestMouseEvent$$$#$", "QTestMouseEvent(QTest::MouseAction, Qt::MouseButton, Qt::KeyboardModifiers, QPoint, int)", typeof(void), typeof(QTest.MouseAction), action, typeof(Qt.MouseButton), button, typeof(uint), modifiers, typeof(QPoint), position, typeof(int), delay);
 }
Пример #23
0
 public QTestKeyEvent(QTest.KeyAction action, char ascii, uint modifiers, int delay)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QTestKeyEvent$$$$", "QTestKeyEvent(QTest::KeyAction, char, Qt::KeyboardModifiers, int)", typeof(void), typeof(QTest.KeyAction), action, typeof(char), ascii, typeof(uint), modifiers, typeof(int), delay);
 }