public void IsAllergy_AllAllergies_true() { //Arrange int allergyScore = 255; Allergies newAllergies = new Allergies(allergyScore); List <string> allList = new List <string> { "cats", "pollen", "chocolate", "tomatoes", "strawberries", "shellfish", "peanuts", "eggs" }; Assert.Equal(allList, newAllergies.IsAllergy()); }
public void IsAllergy_HighestAllergy_true() { //Arrange int allergyScore = 128; Allergies newAllergies = new Allergies(allergyScore); List <string> catList = new List <string> { "cats" }; Assert.Equal(catList, newAllergies.IsAllergy()); }
public void IsAllergy_AllergicToEggs_true() { //Arrange int allergyScore = 1; Allergies newAllergies = new Allergies(allergyScore); List <string> eggList = new List <string> { "eggs" }; //Assert Assert.Equal(eggList, newAllergies.IsAllergy()); }
public HomeModule() { Get["/"] = _ => { List <string> foundAllergies = new List <string> { }; return(View["allergyScore.cshtml", foundAllergies]); }; Post["/new-score"] = _ => { int newScore = int.Parse(Request.Form["allergyScore"]); Allergies newAllergy = new Allergies(newScore); List <string> model = newAllergy.IsAllergy(); Console.WriteLine("model-" + model[0]); return(View["allergyScore.cshtml", model]); }; }