public void GetUsers_WrongUserFilePath_ReturnsException() { string directoryPath = "x:\\WrongFilePath"; UserService userService = new UserService(); userService.GetUsers(directoryPath); }
public void AppendUsersWithNoFollowers_WhereAllUsersHaveFollowers_DictionaryDoesNotChange() { Dictionary<string, List<string>> users = new Dictionary<string, List<string>>(); users.Add("User1", new List<string>() { "User2", "User3" }); users.Add("User2", new List<string>() { "User1", "User3" }); users.Add("User3", new List<string>() { "User1", "User2" }); var userService = new UserService(); userService.AppendUsersWithNoFollowers(users); Assert.AreEqual(3, users.Count); }
public void AppendUsersWithNoFollowers_WhereUsersWithNoFollowersExists_AppendsToTheDictionary() { Dictionary<string, List<string>> users = new Dictionary<string, List<string>>(); users.Add("User1", new List<string>(){"User2", "User3"}); users.Add("User2", new List<string>(){"User1", "Followee"}); users.Add("User3", new List<string>() { "User1", "User2" }); var userService = new UserService(); userService.AppendUsersWithNoFollowers(users); Assert.AreEqual(4,users.Count); Assert.AreEqual(0, users["Followee"].Count); }
public void GetUsers_WhereParametersAreValid_ReturnsAlphabeticalListOfUsers() { string directoryPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName; var userService = new UserService(); var results = userService.GetUsers(directoryPath).ToList(); Assert.AreEqual(3, results.Count); Assert.AreEqual("Martin",results[1].Name); Assert.AreEqual(0, results[1].Followees.Count); Assert.AreEqual("Ward", results[2].Name); Assert.IsTrue(results[2].Followees.Contains("Alan")); }