Skip to content

Commit

Permalink
test: create create database scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Nov 28, 2023
1 parent 9c93fc2 commit a8537e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/src/test/java/expert/os/harperdb/ServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ void shouldReturnNPEWhenSchemaIsNull() {
Assertions.assertThrows(NullPointerException.class, () -> server.createTable("schema").table("table").id(null));
}

@Test
void shouldReturnNPEWhenCreateDatabaseIsNull() {
Server server = getServer();

Assertions.assertThrows(NullPointerException.class, () -> server.createDatabase(null));
}

@Test
void shouldCreateDatabase() {
Server server = getServer();

SoftAssertions.assertSoftly(softly -> {
softly.assertThat(server.createDatabase("database")).isTrue();
softly.assertThat(server.createDatabase("database")).isFalse();
});
}

@Test
void shouldCreateTable() {
Server server = getServer();
Expand Down

0 comments on commit a8537e4

Please sign in to comment.