Skip to content

Instantly share code, notes, and snippets.

@aradzinski
Created July 16, 2019 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aradzinski/4d3431dd38373d316e29f43a65ead650 to your computer and use it in GitHub Desktop.
Save aradzinski/4d3431dd38373d316e29f43a65ead650 to your computer and use it in GitHub Desktop.
package org.nlpcraft.examples.lightswitch;
import org.junit.jupiter.api.*;
import org.nlpcraft.common.*;
import org.nlpcraft.model.test.*;
import java.io.*;
import static org.junit.jupiter.api.Assertions.*;
class LightSwitchTest {
private NCTestClient cli;
@BeforeEach
void setUp() throws NCException, IOException {
cli = new NCTestClientBuilder().newBuilder().build();
cli.open("nlpcraft.lightswitch.ex");
}
@AfterEach
void tearDown() throws NCException, IOException {
cli.close();
}
@Test
void test() throws NCException, IOException {
assertTrue(cli.ask("Turn the lights off in the entire house.").isOk());
assertTrue(cli.ask("Switch on the illumination in the master bedroom closet.").isOk());
assertTrue(cli.ask("Get the lights on.").isOk());
assertTrue(cli.ask("Please, put the light out in the upstairs bedroom.").isOk());
assertTrue(cli.ask("Set the lights on in the entire house.").isOk());
assertTrue(cli.ask("Turn the lights off in the guest bedroom.").isOk());
assertTrue(cli.ask("Could you please switch off all the lights?").isOk());
assertTrue(cli.ask("Dial off illumination on the 2nd floor.").isOk());
assertTrue(cli.ask("Please, no lights!").isOk());
assertTrue(cli.ask("Kill off all the lights now!").isOk());
assertTrue(cli.ask("No lights in the bedroom, please.").isOk());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment