Commit fddd302e authored by Kyle Muldoon's avatar Kyle Muldoon

tests generated and passsing

parent 8eb735be
package hellocucumber; package hellocucumber;
import io.cucumber.java.en.Given; import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When; import io.cucumber.java.en.When;
import io.cucumber.java.en.Then;
import static org.junit.Assert.*; import static org.junit.Assert.*;
class IsItFriday {
static String isItFriday(String today) {
return "Friday".equals(today) ? "TGIF" : "Nope";
}
}
public class StepDefinitions { public class StepDefinitions {
private String today;
private String actualAnswer;
} @Given("today is Sunday")
public void today_is_Sunday() {
today = "Sunday";
}
@Given("today is Friday")
public void today_is_Friday() {
today = "Friday";
}
@When("I ask whether it's Friday yet")
public void i_ask_whether_it_s_Friday_yet() {
actualAnswer = IsItFriday.isItFriday(today);
}
@Then("I should be told {string}")
public void i_should_be_told(String expectedAnswer) {
assertEquals(expectedAnswer, actualAnswer);
}
}
\ No newline at end of file
Feature: Is it Friday yet?
Everybody wants to know when it's Friday
Scenario: Sunday isn't Friday
Given today is Sunday
When I ask whether it's Friday yet
Then I should be told "Nope"
Scenario: Friday is Friday
Given today is Friday
When I ask whether it's Friday yet
Then I should be told "TGIF"
\ No newline at end of file
/Users/kmuldoon/Dev/practice/testing/cucumber/hellocucumber/src/test/java/hellocucumber/RunCucumberTest.java
/Users/kmuldoon/Dev/practice/testing/cucumber/hellocucumber/src/test/java/hellocucumber/StepDefinitions.java
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="2" failures="0" name="hellocucumber.RunCucumberTest" time="0.163" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="15.0.2+7"/>
<property name="sun.boot.library.path" value="/usr/local/Cellar/openjdk/15.0.2/libexec/openjdk.jdk/Contents/Home/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/Users/kmuldoon/Dev/practice/testing/cucumber/hellocucumber"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="java.vendor.url" value="https://openjdk.java.net/"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="path.separator" value=":"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/Users/kmuldoon/Dev/practice/testing/cucumber/hellocucumber"/>
<property name="java.vm.compressedOopsMode" value="Zero based"/>
<property name="java.runtime.version" value="15.0.2+7"/>
<property name="os.arch" value="x86_64"/>
<property name="java.io.tmpdir" value="/var/folders/zf/2zcdxd9n5_x4yy56r74hr20w0000gp/T/"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Mac OS X"/>
<property name="classworlds.conf" value="/usr/local/Cellar/maven/3.6.3_1/libexec/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/Users/kmuldoon/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
<property name="maven.conf" value="/usr/local/Cellar/maven/3.6.3_1/libexec/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="59.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.15.7"/>
<property name="library.jansi.path" value="/usr/local/Cellar/maven/3.6.3_1/libexec/lib/jansi-native"/>
<property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="user.home" value="/Users/kmuldoon"/>
<property name="user.timezone" value="America/Chicago"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.specification.version" value="15"/>
<property name="user.name" value="kmuldoon"/>
<property name="java.class.path" value="/usr/local/Cellar/maven/3.6.3_1/libexec/boot/plexus-classworlds-2.6.0.jar"/>
<property name="java.vm.specification.version" value="15"/>
<property name="sun.arch.data.model" value="64"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher test"/>
<property name="java.home" value="/usr/local/Cellar/openjdk/15.0.2/libexec/openjdk.jdk/Contents/Home"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.version" value="15.0.2"/>
<property name="java.vendor" value="N/A"/>
<property name="maven.home" value="/usr/local/Cellar/maven/3.6.3_1/libexec"/>
<property name="file.separator" value="/"/>
<property name="java.version.date" value="2021-01-19"/>
<property name="java.vendor.url.bug" value="https://bugreport.java.com/bugreport/"/>
<property name="sun.io.unicode.encoding" value="UnicodeBig"/>
<property name="sun.cpu.endian" value="little"/>
<property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
</properties>
<testcase classname="Is it Friday yet?" name="Sunday isn&apos;t Friday" time="0.16"/>
<testcase classname="Is it Friday yet?" name="Friday is Friday" time="0.003"/>
</testsuite>
\ No newline at end of file
-------------------------------------------------------------------------------
Test set: hellocucumber.RunCucumberTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.463 sec
Feature: Is it Friday yet?
Everybody wants to know when it's Friday
Scenario: Sunday isn't Friday
Given today is Sunday
When I ask whether it's Friday yet
Then I should be told "Nope"
Scenario: Friday is Friday
Given today is Friday
When I ask whether it's Friday yet
Then I should be told "TGIF"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment