Created
June 19, 2018 17:16
-
-
Save BatuhanKucukali/8ebb6f125029cec737c2b817f4784c6a to your computer and use it in GitHub Desktop.
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
@SpringBootTest | |
class TranslateServiceTest extends Specification { | |
@Autowired | |
TranslateService translateService | |
def "translate text expected succeed"() { | |
when: | |
def result = translateService.translate("Hello World", Language.ENGLISH, Language.SPANISH) | |
then: | |
result == "Hola Mundo" | |
} | |
def "translate text wrong source and target language expected null"() { | |
when: | |
def result = translateService.translate("Bonjour le monde", Language.FRENCH, Language.SPANISH) | |
then: | |
result == null | |
} | |
def "translate text expected null"() { | |
when: | |
def result = translateService.translate("", Language.ENGLISH, Language.SPANISH) | |
then: | |
result == null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment