This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ActionType and adapt to review and #34
- Loading branch information
Showing
10 changed files
with
86 additions
and
100 deletions.
There are no files selected for viewing
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
15 changes: 7 additions & 8 deletions
15
src/test/scala/de/retest/guistatemachine/api/impl/StateImplSpec.scala
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 |
---|---|---|
@@ -1,34 +1,33 @@ | ||
package de.retest.guistatemachine.api.impl | ||
|
||
import de.retest.guistatemachine.api.{AbstractApiSpec, SutStateIdentifier} | ||
import de.retest.surili.commons.actions.ActionType | ||
|
||
class StateImplSpec extends AbstractApiSpec { | ||
private val rootElementA = getRootElement("a", 0) | ||
private val rootElementB = getRootElement("b", 0) | ||
private val sutStateA = createSutState(rootElementA) | ||
private val sutStateAIdentifier = new SutStateIdentifier(sutStateA) | ||
private val sutStateB = createSutState(rootElementB) | ||
private val sutStateBIdentifier = new SutStateIdentifier(sutStateB) | ||
|
||
"StateImpl" should { | ||
"not equal" in { | ||
val s0 = StateImpl(sutStateAIdentifier, 1) | ||
val s1 = StateImpl(sutStateBIdentifier, 1) | ||
val s0 = StateImpl(sutStateAIdentifier, Set(ActionType.fromAction(action0))) | ||
val s1 = StateImpl(sutStateBIdentifier, Set(ActionType.fromAction(action0))) | ||
s0.equals(s1) shouldEqual false | ||
s0.equals(10) shouldEqual false | ||
s0.hashCode() should not equal s1.hashCode() | ||
} | ||
|
||
"equal" in { | ||
val s0 = StateImpl(sutStateAIdentifier, 1) | ||
val s1 = StateImpl(sutStateAIdentifier, 2) | ||
val s0 = StateImpl(sutStateAIdentifier, Set(ActionType.fromAction(action0))) | ||
val s1 = StateImpl(sutStateAIdentifier, Set(ActionType.fromAction(action0), ActionType.fromAction(action1))) | ||
s0.equals(s1) shouldEqual true | ||
s0.hashCode() shouldEqual s1.hashCode() | ||
} | ||
|
||
"be converted into a string" in { | ||
val s0 = StateImpl(sutStateAIdentifier, 2) | ||
s0.toString shouldEqual "State[sutStateIdentifier=SutStateIdentifier[sutState=State[descriptor=[]], hash=0e4fd44f14d365fae3a7f3579b7ef013e1167e0f4ef6de418367b81edc63450d],neverExploredActionTypesCounter=2]" | ||
val s0 = StateImpl(sutStateAIdentifier, unexploredActionTypes) | ||
s0.toString shouldEqual "State[sutStateIdentifier=SutStateIdentifier[sutState=State[descriptor=[]], hash=0e4fd44f14d365fae3a7f3579b7ef013e1167e0f4ef6de418367b81edc63450d],unexploredActionTypes=Set(ActionType(elementPath=, type=de.retest.surili.commons.actions.NavigateToAction))]" | ||
} | ||
} | ||
} |
Oops, something went wrong.