-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2 Scenario for Cso (csuszos,lyukasztas) and 1 for Szerelo (pump pickup) #3
- Loading branch information
Showing
12 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package BDDDir; | ||
|
||
import io.cucumber.java.en.Given; | ||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
import team01.Cso; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class CsoLyukasStepDefs { | ||
Cso cso; | ||
@Given("A cső jelenleg {string}") | ||
public void setupCso(String arg0) { | ||
cso = new Cso("cso"); | ||
switch (arg0) { | ||
case "lyukas": | ||
cso.Lyukaszt(); | ||
break; | ||
case "nemlyukas": | ||
break; | ||
case "ellenallo": | ||
cso.Lyukaszt(); | ||
cso.Javit(); | ||
break; | ||
} | ||
} | ||
|
||
@When("A csővet megpróbáljuk kilyuakasztani") | ||
public void holeCso() { | ||
cso.Lyukaszt(); | ||
} | ||
|
||
@Then("A cső ezután {string}") | ||
public void csoHasHole(String arg0) { | ||
if (cso.getMukodik()) { | ||
assertEquals(arg0, "nem lyukas"); | ||
} | ||
else { | ||
assertEquals(arg0, "lyukas"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package BDDDir; | ||
|
||
import io.cucumber.java.en.Given; | ||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
import team01.*; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class SzereloPumpatFelveszStepDefs { | ||
Szerelo szerelo; | ||
Mezo mezo; | ||
@Given("A szerelő egy {string} mezőn áll") | ||
public void setSzereloOnGivenMezo(String arg0) { | ||
szerelo= new Szerelo("szerelo"); | ||
switch (arg0) { | ||
case "pumpa": | ||
mezo = new Pumpa(0,new Cso("1"),new Cso("2"),"mezo"); | ||
break; | ||
case "cső": | ||
mezo = new Cso("mezo"); | ||
break; | ||
case "ciszterna": | ||
mezo = new Ciszterna(3,"mezo"); | ||
break; | ||
case "forrás": | ||
mezo = new Forras(3,"mezo"); | ||
break; | ||
} | ||
szerelo.setMezo(mezo); | ||
} | ||
|
||
@When("Megpróbál egy pumpát felvenni") | ||
public void szereloTryPickUpPump() { | ||
szerelo.PumpaFelvesz(); | ||
} | ||
|
||
@Then("A pumpa {string} a szerelőnél") | ||
public void szereloHasPump(String arg0) { | ||
if(szerelo.getVanPumpa()){ | ||
assertEquals(arg0, "van"); | ||
} | ||
else{ | ||
assertEquals(arg0, "nincs"); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Feature: A cső lyukasságának tesztelése | ||
Scenario Outline: A cső lyukasságának tesztelése | ||
Given A cső jelenleg "<lyukasztahtosag>" | ||
When A csővet megpróbáljuk kilyuakasztani | ||
Then A cső ezután "<eredmeny>" | ||
Examples: | ||
| lyukasztahtosag | eredmeny | | ||
| lyukas | lyukas | | ||
| nemlyukas | lyukas | | ||
| ellenallo | nem lyukas| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Feature: Szerelő megpróbál egy pumpát felvenni | ||
Scenario Outline: Szerelő megpróbál egy pumpát felvenni | ||
Given A szerelő egy "<mező>" mezőn áll | ||
When Megpróbál egy pumpát felvenni | ||
Then A pumpa "<van_vagy_nincs>" a szerelőnél | ||
Examples: | ||
| mező | van_vagy_nincs | | ||
|pumpa | nincs | | ||
|cső | nincs | | ||
|ciszterna| van | | ||
|forrás | nincs | |