Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziodemaria committed Mar 20, 2023
1 parent 2b9c250 commit 752495d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
15 changes: 0 additions & 15 deletions Tests/OpenFeatureTests/HookSupportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,3 @@ final class HookSupportTests: XCTestCase {
XCTAssertEqual(hook.errorCalled, 1)
}
}
extension HookSupportTests {
class StringHookMock: StringHook {
private var value: EvaluationContext

init(key: String, value: String) {
let ctx = MutableContext()
ctx.add(key: key, value: .string(value))
self.value = ctx
}

public func before(ctx: HookContext<String>, hints: [String: Any]) -> EvaluationContext? {
return value
}
}
}
52 changes: 0 additions & 52 deletions Tests/OpenFeatureTests/OpenFeatureClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,4 @@ extension OpenFeatureClientTests {
numCalls += 1
}
}

class TestProvider: FeatureProvider {
var hooks: [OpenFeature.AnyHook] = []
var metadata: OpenFeature.Metadata = TestMetadata()
private var targetingKey: String

func onContextSet(oldContext: OpenFeature.EvaluationContext, newContext: OpenFeature.EvaluationContext) {
// no-op
}

func initialize(initialContext: OpenFeature.EvaluationContext) {
// no-op
}

init(targetingKey: String) {
self.targetingKey = targetingKey
}

func getBooleanEvaluation(key: String, defaultValue: Bool) throws
-> OpenFeature.ProviderEvaluation<Bool>
{
return ProviderEvaluation(value: true)
}

func getStringEvaluation(key: String, defaultValue: String) throws
-> OpenFeature.ProviderEvaluation<String>
{
return ProviderEvaluation(value: "")
}

func getIntegerEvaluation(key: String, defaultValue: Int64) throws
-> OpenFeature.ProviderEvaluation<Int64>
{
return ProviderEvaluation(value: 0)
}

func getDoubleEvaluation(key: String, defaultValue: Double) throws
-> OpenFeature.ProviderEvaluation<Double>
{
return ProviderEvaluation(value: 0.0)
}

func getObjectEvaluation(key: String, defaultValue: OpenFeature.Value)
throws -> OpenFeature.ProviderEvaluation<OpenFeature.Value>
{
return ProviderEvaluation(value: .null)
}
}

public struct TestMetadata: Metadata {
public var name: String? = "test"
}
}

0 comments on commit 752495d

Please sign in to comment.