/blahblah

Blah-Blah generates fake data for robust testing and developmental purposes

Primary LanguageKotlinMIT LicenseMIT

Blah-Blah


BlahBlah Banner

Blah-Blah is a Kotlin Multiplatform (KMP) library designed to generates fake data for robust testing and development. It can be used for things such as:

  • Unit Testing
  • Performance Testing
  • Building Demos
  • Working without a completed backend

Blah-Blah's flexibility and compatibility with Kotlin Multiplatform make it an essential tool for creating high-quality applications that are thoroughly tested and well-prepared for dynamic development demands.

Features

  • It generates realistic data, enabling effective scenario simulation without relying on actual data sources.
  • The library provides a solid foundation for robust testing by offering diverse datasets that mimic real-world scenarios.
  • Blah-Blah supports Kotlin Multiplatform.

Documentation 📖

Architecture

flowchart LR
    K[(Resource)] --> H[YAML Parser]
    H --> N[YAML Provider] --> F[BlahBlah Provider]
    F --> A[Module]
    A[Module] --> B[(BlahBlah)]
Loading

Modules

Setup

Add the dependency below into your module's build.gradle.kts file:

// For development

// It includes blah-blah fake.
implementation("io.github.behzodhalil:blahblah-fake:<latest-version>")
// If only need yaml parser
implementation("io.github.behzodhalil:blahblah-yaml:<latest-version>")

// For testing

// It includes blah-blah fake.
testImplementation("io.github.behzodhalil:blahblah-fake:<latest-version>")
// If only need yaml parser
testImplementation("io.github.behzodhalil:blahblah-yaml:<latest-version>")

Usage

Testing

class BlahBlahTest {

private lateinit var blah: BlahBlah

@BeforeTest
fun setup() {
    blah = blah()
  }

@Test
fun `check the blah blah works properly`() {
    val city = blah.address.city
    val state = blah.address.state

    assertNotNull(city)
    assertNotNull(state)
  }

@Test
fun `check the street address gets successfully`() {
    val streetAddress = blah.address.streetAddress


    assertNotNull(streetAddress)
    assertTrue(streetAddress.isDigit())
  } 
}

YamlParser

YamlParser for parsing YAML files and retrieving values organized in a specific structure.

interface YamlParser {
    fun values(): YamlResource
}

YamlProvider

YamlProvider for providing values fetched from YAML resources using specified keys.

interface YamlProvider {
    fun get(key: String): String
}

Provider

Provider representing a provider that retrieves content from a specified path. It is a bridge between module and yaml provider.

public interface Provider {
    public  fun get(path: Path): String
}

Path

Path representing a path to a resource.It is not Okio path.

public interface Path {
    public val value: String
}

License

License