Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 private APIController()
 {
     this.objSuggestionRepository = new SuggestionRepository();
 }
        public void AddSuggestion(Suggestion suggestion, string filePath)
        {
            var repo = new SuggestionRepository();

            repo.AddSuggestion(suggestion, filePath);
        }
Esempio n. 7
0
 public SuggestionController()
 {
     repo = new SuggestionRepository();
 }