protected void SubmitNewText(object sender, EventArgs e) { //insert trigger ScreenShotActions data = new ScreenShotActions(); TextTrigger textTrigger = new TextTrigger() { triggerString = TriggerTB.Text, userName = UserDropDownList.Text, }; data.insertTextTrigger(textTrigger); //refresh the triggers to bring back down the new trigger RefreshTriggers(data); //clear text boxes for a new trigger to be entered Clear(TriggerTB); }
public void textTriggerFullTest() { //insert ScreenShotActions target = new ScreenShotActions(true); TextTrigger textTrigger = new TextTrigger(); textTrigger.userName = "******"; textTrigger.userEmail = "TEST@"; textTrigger.triggerString = "TEST"; Guid id = target.insertTextTrigger(textTrigger); Assert.IsNotNull(id); //update string newVal = "BAYAD WERDS"; var allTriggers = target.getAllTextTriggers(); TextTrigger outTrigger = allTriggers.First(t => t.id.Equals(id)); outTrigger.triggerString = newVal; target.updateTextTrigger(outTrigger); allTriggers = target.getAllTextTriggers(); outTrigger = allTriggers.First(t => t.id.Equals(id)); Assert.AreEqual(newVal, outTrigger.triggerString); //delete target.deleteTextTrigger(outTrigger.id); Assert.AreEqual(target.getAllTextTriggers().Count(t => t.id.Equals(id)), 0); }
public void insertTextTriggerTest() { ScreenShotActions target = new ScreenShotActions(true); TextTrigger textTrigger = new TextTrigger(); textTrigger.userName = "******"; textTrigger.userEmail = "TEST@"; textTrigger.triggerString = "TEST"; Guid actual = target.insertTextTrigger(textTrigger); Assert.IsNotNull(actual); }