public ActionResult DeleteConfirmed(int id) { QTest qTest = db.QTests.Find(id); db.QTests.Remove(qTest); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
public void Can_wait_for() { int counter = 0; QTest.QWaitFor( () => { counter++; return(counter == 5); }, TimeSpan.FromSeconds(5)).Should().BeTrue(); counter.Should().Be(5); }
// 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)); }
// 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)); }
// [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")); }
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); }
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); }
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); }
public void Can_wait_for_timeout() { QTest.QWaitFor(() => { return(false); }, TimeSpan.FromSeconds(1)).Should().BeFalse(); }
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); }
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); }
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); }
protected bool ExecApplicationWithTimeout(int timeoutMs) { var testContext = TypeCreator.Create(typeof(TestContext)) as TestContext; return(QTest.QWaitFor(() => testContext.Quited, timeoutMs)); }
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); }
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); }
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); }
public void AddKeyEvent(QTest.KeyAction action, char ascii) { interceptor.Invoke("addKeyEvent$$", "addKeyEvent(QTest::KeyAction, char)", typeof(void), typeof(QTest.KeyAction), action, typeof(char), ascii); }
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); }
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); }
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); }
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); }
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); }