public void TestCreatePlayer() { User user = new User(Guid.NewGuid(), "testuser", "user"); IDatabase db = new PostgreSQLDB("Mtcg", "mtcg"); Assert.IsTrue(db.CreatePlayer(user)); User us = db.ReadPlayer(user.ID); Assert.IsNotNull(us); Assert.AreEqual(us.ID, user.ID); }
public void TestLogin() { User user = new User(Guid.NewGuid(), "testuser", "user"); IDatabase db = new PostgreSQLDB("Mtcg", "mtcg"); Assert.IsTrue(db.CreatePlayer(user)); Server s = new Server(db); Server.UserDes us = new Server.UserDes(); us.Username = "******"; us.Password = "******"; Assert.IsTrue(s.Login(us)); }