public void Read_WrongUserFilePath_ReturnsException()
        {
            string directoryPath = "x:\\WrongFilePath";
            UserFileReader fileReader = new UserFileReader(directoryPath);

            fileReader.Read();
        }
Esempio n. 2
0
        public IEnumerable<User> GetUsers(string path ="")
        {
            UserFileReader fileReader = new UserFileReader(path);
            var users = fileReader.Read();

            AppendUsersWithNoFollowers(users);

            return users.OrderBy(x => x.Key).Select(x => new User(x.Key, x.Value));
        }
        public void Read_ValidUserFile_ReturnsDictionaryOfUsers()
        {
            string directoryPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;
            UserFileReader fileReader = new UserFileReader(directoryPath);

            Dictionary<string,List<string>> results = fileReader.Read();

            Assert.AreEqual(2, results.Count);
            Assert.IsFalse(results.ContainsKey("Martin"));
            Assert.IsTrue(results["Ward"].Contains( "Martin"));
        }