public void FollowUserTest() { IChirpyRRepository repoistory = new ChirpyRSqlRepository("ChirpyRConnection", "dbo"); ChirpyRDataService target = new ChirpyRDataService(repoistory); ChirpyRUser user = repoistory.GetUserById("Test"); ChirpyRUser follow = repoistory.GetUserById("Test1"); target.FollowUser(user.UserId, follow.UserId); }
public void GetAllChirpsTest() { IChirpyRRepository repository = new ChirpyRSqlRepository("ChirpyRConnection", "dbo"); ChirpyRDataService target = new ChirpyRDataService(repository); IList<Chirp> expected = null; // TODO: Initialize to an appropriate value IList<Chirp> actual; actual = target.GetAllChirps(); Assert.AreNotEqual(expected, actual); }
public void AddChirpTest() { IChirpyRRepository repository = new ChirpyRSqlRepository("ChirpyRConnection", "dbo"); ChirpyRDataService target = new ChirpyRDataService(repository); Chirp newChirp = new Chirp { Text = "Test Chirp", ChirpTime = DateTime.Now, }; long notExpected = -1; long actual; actual = target.AddChirp(newChirp); Assert.AreNotEqual(notExpected, actual); }
public void RegisterUserTest() { IChirpyRRepository repository = new ChirpyRSqlRepository("ChirpyRConnection", "dbo"); ChirpyRDataService target = new ChirpyRDataService(repository); ChirpyRUser chirpUser = new ChirpyRUser { UserId = "Test", FullName = "Test User", Email = "*****@*****.**" }; long notExpected = 0; long actual; actual = target.RegisterUser(chirpUser); Assert.AreNotEqual(notExpected, actual); }
public void Register10Users() { IChirpyRRepository repository = new ChirpyRSqlRepository("ChirpyRConnection", "dbo"); ChirpyRDataService target = new ChirpyRDataService(repository); int created = 0; int failed = 0; for (int i = 0; i < 10; i++) { try { ChirpyRUser chirpUser = new ChirpyRUser { UserId = "Test" + i.ToString(), FullName = "Test User", Email = "Test"+i.ToString() + "@gmail.com" }; long actual; actual = target.RegisterUser(chirpUser); created++; } catch (ApplicationException ae) { failed++; } } Assert.AreEqual(10, created); }