Created
March 16, 2023 22:49
-
-
Save frogggias/f7b685ebbb0239080727bdd8808a22a6 to your computer and use it in GitHub Desktop.
GenZ fairy tale unit test by GPT4
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
import org.junit.jupiter.api.Test | |
import org.junit.jupiter.api.Assertions.* | |
class FairyTaleTest { | |
@Test | |
fun `Once upon a time in a lit kingdom`() { | |
val kingdom = Kingdom("Vibeland") | |
val princess = InfluencerPrincess("Ava", followers = 100_000) | |
kingdom.addInhabitant(princess) | |
assertTrue(kingdom.inhabitants.contains(princess), "Influencer Princess should be in the kingdom") | |
assertTrue(princess.followers >= 100_000, "Influencer Princess should have at least 100k followers") | |
} | |
@Test | |
fun `An eco-friendly hero appears with his reusable straw`() { | |
val hero = EcoHero("Leo", reusableStraws = 50) | |
val dragon = Dragon("Drake") | |
hero.slay(dragon) | |
assertTrue(hero.dragonsSlain.contains(dragon), "Dragon should be slain by the eco-friendly hero") | |
assertTrue(hero.reusableStraws > 0, "EcoHero should have reusable straws") | |
} | |
@Test | |
fun `Influencer Princess and EcoHero started a podcast`() { | |
val princess = InfluencerPrincess("Ava", followers = 100_000) | |
val hero = EcoHero("Leo", reusableStraws = 50) | |
val podcast = Podcast("Saving the Kingdom and the Planet") | |
podcast.addHosts(princess, hero) | |
assertTrue(podcast.hosts.contains(princess), "Influencer Princess should be a podcast host") | |
assertTrue(podcast.hosts.contains(hero), "EcoHero should be a podcast host") | |
} | |
@Test | |
fun `And they lived happily ever after, going viral and fighting climate change`() { | |
val kingdom = Kingdom("Vibeland") | |
val princess = InfluencerPrincess("Ava", followers = 100_000) | |
val hero = EcoHero("Leo", reusableStraws = 50) | |
val royalWedding = kingdom.celebrateWedding(princess, hero) | |
assertEquals(princess, royalWedding.first, "Influencer Princess should be part of the royal wedding") | |
assertEquals(hero, royalWedding.second, "EcoHero should be part of the royal wedding") | |
val viralPosts = princess.createViralPosts(10) | |
assertTrue(viralPosts >= 10, "Influencer Princess should create at least 10 viral posts") | |
hero.plantTrees(1000) | |
assertTrue(hero.treesPlanted >= 1000, "EcoHero should plant at least 1000 trees") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment