1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-12-21 03:10:06 +01:00
Files
app/tests/feature/FeatureTestCase.swift
2025-10-09 16:21:46 +02:00

42 lines
1.0 KiB
Swift

//
// FeatureTestCase.swift
// Feature Tests
//
// Created by Nico Verbruggen on 07/11/2022.
// Copyright © 2023 Nico Verbruggen. All rights reserved.
//
import XCTest
class FeatureTestCase: XCTestCase {
// TODO: make fake filesystem accessible via test case
public func assertFileSystemHas(
_ path: String,
file: StaticString = #filePath,
line: UInt = #line,
fs: TestableFileSystem
) {
XCTAssertTrue(fs.files.keys.contains(path), file: file, line: line)
}
public func assertFileSystemDoesNotHave(
_ path: String,
file: StaticString = #filePath,
line: UInt = #line,
fs: TestableFileSystem
) {
XCTAssertFalse(fs.files.keys.contains(path), file: file, line: line)
}
public func assertFileHasContents(
_ path: String,
contents: String,
file: StaticString = #filePath,
line: UInt = #line,
fs: TestableFileSystem
) {
XCTAssertEqual(contents, fs.files[path]?.content, file: file, line: line)
}
}