Search in sources :

Example 21 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method addUserTestWrongArgument1.

@Test(expected = NullPointerException.class)
public void addUserTestWrongArgument1() throws CouldntSaveDataException {
    final CUserManager manager = CUserManager.get(m_sql);
    manager.addUser(null);
}
Also used : CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Example 22 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method editUserCorrectArgumentsTest.

@Test
public void editUserCorrectArgumentsTest() throws CouldntSaveDataException {
    final CUserManager manager = CUserManager.get(m_sql);
    final IUser user1 = manager.addUser("TWO");
    final IUser user2 = manager.editUserName(user1, "TWO AFTER EDIT");
    assertEquals("TWO", user1.getUserName());
    assertEquals("TWO AFTER EDIT", user2.getUserName());
    assertTrue(user1.getUserId() == user2.getUserId());
}
Also used : IUser(com.google.security.zynamics.binnavi.Gui.Users.Interfaces.IUser) CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Aggregations

CUserManager (com.google.security.zynamics.binnavi.Gui.Users.CUserManager)22 Test (org.junit.Test)20 IUser (com.google.security.zynamics.binnavi.Gui.Users.Interfaces.IUser)11 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)4 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)3 CComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.CComment)3 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)3 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)2 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)2 CUser (com.google.security.zynamics.binnavi.Gui.Users.CUser)2 CGroupNode (com.google.security.zynamics.binnavi.disassembly.CGroupNode)2 CModule (com.google.security.zynamics.binnavi.disassembly.Modules.CModule)2 MockModule (com.google.security.zynamics.binnavi.disassembly.Modules.MockModule)2 Date (java.util.Date)2 CModuleViewGenerator (com.google.security.zynamics.binnavi.Database.CModuleViewGenerator)1 SQLProvider (com.google.security.zynamics.binnavi.Database.Interfaces.SQLProvider)1 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)1 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)1 MockTagManager (com.google.security.zynamics.binnavi.Tagging.MockTagManager)1 CCodeNode (com.google.security.zynamics.binnavi.disassembly.CCodeNode)1