예제 #1
0
 public void CommandAttemptsToCreateKeyWithAlreadyExistingKey()
 {
     createRSAKey();
     createKey.setCommand(START_OF_COMMAND_CREATE + KEY_NAME + END_OF_COMMAND);
     Assert.AreEqual(true, createKey.verifyCommand());
     Assert.AreEqual("\nThis key already exists: " + KEY_NAME, createKey.action());
 }
예제 #2
0
 public void createRSAKey()
 {
     createKey.setCommand(CommandRSATest.START_OF_COMMAND_CREATE +
                          CommandRSATest.KEY_NAME + CommandRSATest.END_OF_COMMAND);
     Assert.AreEqual(true, createKey.verifyCommand());
     Assert.AreEqual(CommandRSATest.KEY_CREATION_MESSAGE +
                     CommandRSATest.KEY_NAME, createKey.action());
 }
예제 #3
0
    public void CommandListKeyWithTwoKey()
    {
        string keyName = "KeyOther";

        createRSAKey();
        CreateKey createKey = new CreateKey();

        createKey.setCommand(START_OF_COMMAND_CREATE + keyName + END_OF_COMMAND);
        Assert.AreEqual(true, createKey.verifyCommand());
        Assert.AreEqual(KEY_CREATION_MESSAGE + keyName, createKey.action());

        ListKey listKey = new ListKey();

        listKey.setCommand("RSA LIST");
        Assert.AreEqual(true, listKey.verifyCommand());
        Assert.AreEqual("\nKeys: " + "\n" + KEY_NAME + "\n" + keyName, listKey.action());
    }