From 02dd5110cbeb2d7b9a2d090ccf9e016348e50c51 Mon Sep 17 00:00:00 2001 From: Fahad Heylaal Date: Mon, 2 Oct 2023 19:30:53 +0200 Subject: [PATCH] test types updated --- .vscode/settings.json | 3 +++ .../kotlin/com/featurevisor/types/Types.kt | 24 ++++++------------- 2 files changed, 10 insertions(+), 17 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d874984 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "prettier.enable": false +} diff --git a/src/main/kotlin/com/featurevisor/types/Types.kt b/src/main/kotlin/com/featurevisor/types/Types.kt index c641b51..ca684c2 100644 --- a/src/main/kotlin/com/featurevisor/types/Types.kt +++ b/src/main/kotlin/com/featurevisor/types/Types.kt @@ -350,6 +350,7 @@ data class ParsedFeature( */ data class FeatureAssertion( val description: String?, + val environment: EnvironmentKey?, // bucket weight: 0 to 100 val at: Weight, val context: Context, @@ -359,7 +360,7 @@ data class FeatureAssertion( ) data class TestFeature( - val key: FeatureKey, + val feature: FeatureKey, val assertions: Array, ) @@ -370,22 +371,11 @@ data class SegmentAssertion( ) data class TestSegment( - val key: SegmentKey, + val segment: SegmentKey, val assertions: Array, ) -data class Test( - val description: String?, - - // needed for feature testing - val tag: String?, - val environment: EnvironmentKey?, - val features: Array?, - - // needed for segment testing - val segments: Array?, -) - -data class Spec( - val tests: Array, -) +sealed class Test { + data class Feature(val value: TestFeature) : Test() + data class Segment(val value: TestSegment) : Test() +}