//[TestMethod] public void createalogofMessages() { /* * All tests start with a clean file to work against to ensure that no test affects any other. * This method creates the tweets file, removes the following files and creates a clean slate * for the subsequent test. * */ //get rid of the server/file if it exists.. TweetRepository.Deleterepository(); //Set up an array to contain a set of messages TweetMessageWriter tmw = new TweetMessageWriter(); //create those message and add them to the collection tmw.writeMessage(new tweetyMessage("Alice", "I love the weather today")); tmw.writeMessage(new tweetyMessage("Bob", "Damn! We lost!")); tmw.writeMessage(new tweetyMessage("Bob", "Good game though.")); tmw.writeMessage(new tweetyMessage("Charlie", "I'm in New York today! Anyone want to have a coffee?")); tweetMessageReader tmr = new tweetMessageReader(); Trace.WriteLine(tmr.ToString()); }
public void followTest() { //This will create a file called UserName_follows and return all the messages for that User //it will also create a message from lance indicating that he is following bob createalogofMessages(); followUser followAlice = new followUser("Bob", "Alice"); followUser followCharlie = new followUser("Bob", "Charlie"); followUser followed = new followUser(); tweetMessageReader tmr = new tweetMessageReader(); tmr.ReadFollowedUsers(followed.showFollowed("Bob")); Trace.WriteLine(tmr.ToString()); }