public void AddUserTest() { DataChamber data = new DataChamber(); DefaultDataGeneration filler = new DefaultDataGeneration(); DatabaseActions test = new DatabaseActions(data, filler); Users user = new Users(5, "Wojciech", "Mincikiewicz", 1996); test.AddUser(user); Assert.AreEqual(test.ReadUser(5), user); }
public void UpdateUsersTest() { DefaultDataGeneration filler = new DefaultDataGeneration(); DataChamber data = new DataChamber(); DatabaseActions test = new DatabaseActions(data, filler); Users newUser = new Users(1, "Test", "Testowy", 1908); test.UpdateUser(1, newUser); Assert.AreEqual(newUser, test.ReadUser(1)); }
public void DeleteUsersTest() { DefaultDataGeneration filler = new DefaultDataGeneration(); DataChamber data = new DataChamber(); DatabaseActions test = new DatabaseActions(data, filler); Users newUser = new Users(1, "Test", "Testowy", 1908); test.AddUser(newUser); Assert.AreEqual(test.ReadUser(5), newUser); test.DeleteUser(5); Assert.IsFalse(test.ReadAllUsers().Contains(newUser)); }
public void ReadUserTest() { DataChamber data = new DataChamber(); DefaultDataGeneration filler = new DefaultDataGeneration(); DatabaseActions test = new DatabaseActions(data, filler); Users readUser = test.ReadUser(3); //Users user4 = new Users(3, "Andrzej", "Paluch", 1996); Assert.AreEqual(readUser.getName(), "Andrzej"); Assert.AreEqual(readUser.getSurname(), "Paluch"); Assert.AreEqual(readUser.getId(), 3); Assert.AreEqual(readUser.getDate(), 1996); //Assert.AreEqual(readUser, user4); }