public void Setup()
 {
   _getList = new GetNegativeWordsList(new NegativeWordsDAL());
   _userState = new UserState
   {
     CurrentRequestType = UserState.RequestType.GetNegativeWords,
   };
 }
 public void Setup()
 {
   _read = new ReadContentWithNegativeWords();
   _userState = new UserState
   {
     CurrentRequestType = UserState.RequestType.ReadContent,
     NegativeWordsList = new List<string> { "swine", "bad", "nasty", "horrible" }
   };
 }
 public void Setup()
 {
   _analyse = new AnalyseContentForNegativeWords();
   _userState = new UserState
   {
     CurrentRequestType = UserState.RequestType.AnalyseContent,
     NegativeWordsList = new List<string> { "swine", "bad", "nasty", "horrible"}
   };
 }
    public static void Main(string[] args)
    {
      var contentManager = new ContentManager(new NegativeWordsDAL());
      var userState = new UserState
      {
        CurrentRequestType = UserState.RequestType.AnalyseContent,
        ContentInput = "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting."
      };

      contentManager.Manage(userState);

      Console.WriteLine("Scanned the text:");
      Console.WriteLine(userState.ContentOutput);
      Console.WriteLine("Total Number of negative words: " + userState.TotalNegativeWordsInContent);

      Console.WriteLine("Press ANY key to exit.");
      Console.ReadKey();
    }
    public UserState Manage(UserState value)
    {
      value = _getNegWordsList.Manage(value);

      switch (value.CurrentRequestType)
      {
        case UserState.RequestType.AnalyseContent:
          value = _analyse.Manage(value);
          break;
        case UserState.RequestType.ReadContent:
          value = _read.Manage(value);
          break;
        case UserState.RequestType.UpdateNegativeWords:
          value = _updateNegWordsList.Manage(value);
          break;
      }

      // Remove NegativeWordsList if not requested for Admin
      if (value.CurrentRequestType != UserState.RequestType.GetNegativeWords)
        value.NegativeWordsList = null;

      return value;
    }