Skip to content

Commit

Permalink
[Update] It should be deleted before creating in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grady Zhuo committed Jun 22, 2024
1 parent 472d904 commit 8d46128
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@
@testable import EventStoreDB
import SwiftProtobuf
import XCTest
import GRPC

final class EventStoreDBPersistentSubscriptionTests: XCTestCase {
let streamName = "testing"
let groupName = "mytest"

func testCreate() async throws {
let settings = ClientSettings.localhost()
let subscriptionClient = try PersistentSubscriptionsClient(channel: GRPCChannelPool.with(settings: settings), callOptions: settings.makeCallOptions())
let streamSelector: EventStoreDB.Selector<EventStoreDB.Stream.Identifier> = .specified(streamName: streamName)
try await subscriptionClient.deleteOn(stream: streamSelector, groupName: groupName)


let client = EventStoreDBClient(settings: settings)
try await client.createPersistentSubscription(to: "testing", groupName: "mytest", options: .init())
try await client.createPersistentSubscription(to: "testing", groupName: "mytest")

let subscriptions = try await subscriptionClient.list(stream: streamSelector)
XCTAssertEqual(subscriptions.count, 1)
}

func testSubscribe() async throws {
Expand Down

0 comments on commit 8d46128

Please sign in to comment.