Skip to content

Commit

Permalink
Move some tests do a different target
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Sep 13, 2024
1 parent c609cf2 commit 4a92a88
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
18 changes: 0 additions & 18 deletions Tests/SpeziSchedulerTests/SchedulerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
//

import Spezi
import SpeziLocalStorage
@_spi(TestingSupport)
@testable import SpeziScheduler
import SpeziSecureStorage
import XCTest
import XCTSpezi

Expand Down Expand Up @@ -179,20 +177,4 @@ final class SchedulerTests: XCTestCase {
XCTAssertEqual(components1.minute, 30)
XCTAssertEqual(components1.second, 49)
}

@MainActor
func testSchedulerSampleData() throws {
let container = try SchedulerSampleData.makeSharedContext()

let scheduler = Scheduler(testingContainer: container)
withDependencyResolution {
scheduler
}

let results = try scheduler.queryTasks(for: Date.yesterday..<Date.tomorrow)
XCTAssertEqual(results.count, 1, "Received unexpected amount of tasks in query.")

let events = try scheduler.queryEvents(for: Date.yesterday..<Date.tomorrow)
XCTAssertEqual(events.count, 1, "Received unexpected amount of events in query.")
}
}
28 changes: 28 additions & 0 deletions Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// This source file is part of the Stanford Spezi open-source project
//
// SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//

@testable import SpeziSchedulerUI
import XCTest

final class SchedulerSampleDataTests: XCTestCase {
@MainActor
func testSchedulerSampleData() throws {
let container = try SchedulerSampleData.makeSharedContext()

Check failure on line 15 in Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package / Test using xcodebuild or run fastlane

cannot find 'SchedulerSampleData' in scope

Check failure on line 15 in Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package watchOS / Test using xcodebuild or run fastlane

cannot find 'SchedulerSampleData' in scope

let scheduler = Scheduler(testingContainer: container)

Check failure on line 17 in Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package / Test using xcodebuild or run fastlane

cannot find 'Scheduler' in scope

Check failure on line 17 in Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package watchOS / Test using xcodebuild or run fastlane

cannot find 'Scheduler' in scope
withDependencyResolution {

Check failure on line 18 in Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package / Test using xcodebuild or run fastlane

cannot find 'withDependencyResolution' in scope

Check failure on line 18 in Tests/SpeziSchedulerUITests/SchedulerSampleDataTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test Swift Package watchOS / Test using xcodebuild or run fastlane

cannot find 'withDependencyResolution' in scope
scheduler
}

let results = try scheduler.queryTasks(for: Date.yesterday..<Date.tomorrow)
XCTAssertEqual(results.count, 1, "Received unexpected amount of tasks in query.")

let events = try scheduler.queryEvents(for: Date.yesterday..<Date.tomorrow)
XCTAssertEqual(events.count, 1, "Received unexpected amount of events in query.")
}
}

0 comments on commit 4a92a88

Please sign in to comment.