public void GetSuggestionsTest() { var repo = new SuggestionRepository(); string filePath = @"C:\Users\Apprentice\Desktop\GitHub\KileyDowling\SGCorpHRV2\SGCorpHR\SGCorpHR.TEST\Suggestions\Suggestions.txt"; var suggestions = repo.GetAllSuggestions(filePath); var suggestion = suggestions.First(); Assert.AreEqual("Bob", suggestion.EmployeeName); }
public void RemoveSuggestionTest() { var repo = new SuggestionRepository(); int suggestionID = 3; string filePath = @"C:\Users\Apprentice\Desktop\GitHub\KileyDowling\SGCorpHRV2\SGCorpHR\SGCorpHR.TEST\Suggestions\Suggestions.txt"; repo.RemoveFile(suggestionID, filePath); var suggestions = repo.GetAllSuggestions(filePath); Assert.IsFalse(suggestions.Exists(s => s.SuggestionID == 3)); }
public void DeleteSuggestions(int suggestionID, string filePath) { var repo = new SuggestionRepository(); var response = new Response <List <Suggestion> >(); repo.RemoveFile(suggestionID, filePath); try { response.Success = true; } catch (Exception ex) { response.Message = ex.Message; } }
public void SubmitSuggestionTest() { var repo = new SuggestionRepository(); var suggestion = new Suggestion() { SuggestionText = "Test", EmployeeName = "Johnny" }; string filePath = @"C:\Users\Apprentice\Desktop\GitHub\KileyDowling\SGCorpHRV2\SGCorpHR\SGCorpHR.TEST\Suggestions\Suggestions.txt"; repo.AddSuggestion(suggestion, filePath); Assert.AreEqual("Johnny", suggestion.EmployeeName); }
private APIController() { this.objSuggestionRepository = new SuggestionRepository(); }
public void AddSuggestion(Suggestion suggestion, string filePath) { var repo = new SuggestionRepository(); repo.AddSuggestion(suggestion, filePath); }
public SuggestionController() { repo = new SuggestionRepository(); }