public void UsersInfoShouldReturnCorrectResults(string username, bool isAdmin) { var service = new RemoteDataService(); var result = service.UsersInfo(new[] { username }).Result.First(); Assert.IsNotNull(result, "result != null"); Assert.AreEqual(username, result.UserName, "Username received is not equal to the one requested!"); Assert.AreEqual(isAdmin, result.IsAdmin, "Admin status not correct!"); Assert.IsNotNull(result.AvatarUrl, "result.AvatarUrl != null"); Assert.IsTrue(RemoteFileExists(result.AvatarUrl), "Avatar does not exist!"); }
public void UsersInfoShouldReturnInformationForEveryUserGiven(int validCount, params string[] usernames) { var service = new RemoteDataService(); var result = service.UsersInfo(usernames).Result.ToList(); Assert.AreEqual(validCount, result.Count()); foreach (var user in result) { Assert.IsNotNull(user); } }