Christian Baltzer
5 years ago
4 changed files with 116 additions and 14 deletions
-
59src/main/java/com/ugsbo/Crypto/Payload.java
-
38src/test/java/com/ugsbo/Crypto/Crypt.java
-
31src/test/java/com/ugsbo/Crypto/DeCrypt.java
@ -0,0 +1,59 @@ |
|||
package com.ugsbo.Crypto; |
|||
|
|||
public class Payload { |
|||
|
|||
String offen; |
|||
String verschlüsselt; |
|||
String password; |
|||
|
|||
public Payload() { |
|||
|
|||
} |
|||
|
|||
|
|||
public String getOffen() { |
|||
return offen; |
|||
} |
|||
|
|||
|
|||
|
|||
public String getVerschlüsselt() { |
|||
return verschlüsselt; |
|||
} |
|||
|
|||
|
|||
|
|||
public String getPassword() { |
|||
return password; |
|||
} |
|||
|
|||
|
|||
|
|||
public void setOffen(String offen) { |
|||
this.offen = offen; |
|||
} |
|||
|
|||
|
|||
|
|||
public void setVerschlüsselt(String verschlüsselt) { |
|||
this.verschlüsselt = verschlüsselt; |
|||
} |
|||
|
|||
|
|||
|
|||
public void setPassword(String password) { |
|||
this.password = password; |
|||
} |
|||
|
|||
|
|||
public void verschlüsseln() { |
|||
|
|||
|
|||
} |
|||
|
|||
public void entschlüsseln() { |
|||
|
|||
|
|||
} |
|||
|
|||
} |
@ -1,17 +1,42 @@ |
|||
package com.ugsbo.Crypto; |
|||
|
|||
import static org.junit.Assert.*; |
|||
|
|||
import com.ugsbo.Crypto.*; |
|||
import org.junit.Before; |
|||
import org.junit.Test; |
|||
|
|||
public class DeCrypt { |
|||
|
|||
private Payload workingobjekt; |
|||
|
|||
@Before |
|||
public void setUp() throws Exception {} |
|||
public void setUp() throws Exception { |
|||
workingobjekt = new Payload(); |
|||
} |
|||
|
|||
@Test |
|||
public void test() { |
|||
fail("Not yet implemented"); |
|||
public void verschlüsseltIstAnders() { |
|||
|
|||
String eingabe = "TestText"; |
|||
|
|||
workingobjekt.setVerschlüsselt(eingabe); |
|||
workingobjekt.entschlüsseln(); |
|||
workingobjekt.getOffen(); |
|||
} |
|||
|
|||
@Test |
|||
public void entUndVerschlüsseln() { |
|||
|
|||
String eingabe = "TestText"; |
|||
String ergebnis; |
|||
|
|||
workingobjekt.setOffen(eingabe); |
|||
workingobjekt.verschlüsseln(); |
|||
workingobjekt.entschlüsseln(); |
|||
ergebnis = workingobjekt.getOffen(); |
|||
|
|||
assertEquals("das entschlüsselte Test Wort",ergebnis,eingabe); |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue