public void Test1_DoomsDayDevice_true()
 {
     //Arrange
       Allergy newAllergy = new Allergy(3, 0);
       newAllergy.AllgySuperdoom();
     //Assert
       Assert.Equal(8, newAllergy.GetTotal());
 }
 public HomeModule()
 {
     Get["/"] = _ => {
       return View["index.cshtml"];
     };
     Post["/panicmode"] =_=>{
       Allergy newAllergy = new Allergy(Request.Form["doom"], 0);
       newAllergy.AllgySuperdoom();
       return View["DDay.cshtml", newAllergy];
     };
 }
Пример #3
0
 public void Test1_DoomsDayDevice_true()
 {
     List<string> allgys = new List<string>(){};
       allgys[0] = "eggs";
       allgys[1] = "peanuts";
       allgys[2] = "shellfish";
       allgys[3] = "strawberries";
       //Arrange
       Allergy newAllergy = new Allergy(0);
     //Assert
       newAllergy = newAllergy.AllgySuperdoom(8);
       Assert.Equal(allgys, Allergy.GetAllgys());
 }
Пример #4
0
 public HomeModule()
 {
     Get["/"] = _ => {
       return View["index.cshtml"];
     };
     Post["/panicmode"] = parameters => {
       int allergyScore = 0;
       List<CheckBoxList> checkedBoxes = new List<CheckBoxList>() {};
       foreach (CheckBox checkbox in Request.Form["allgySuperstar"])
       {
     if (checkbox.Selected == true)
     {
       checkedBoxes.Add(checkbox);
     }
       }
       foreach (CheckBox checkbox in checkedBoxes)
       {
     allergyScore += checkbox.parameters.id;
       }
       Allergy newAllergy = new Allergy(0);
       allergyScore = newAllergy.AllgySuperdoom(allergyScore);
       return View["DDay.cshtml", newAllergy];
     };
 }