# Dboone323 Tools Automation Swift Testing

> Swift Testing Expert (Project-Specific)

- Skill: `tomevault-io/dboone323-tools-automation-swift-testing` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/dboone323-tools-automation-swift-testing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/dboone323-tools-automation-swift-testing/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/dboone323-tools-automation-swift-testing

---


# Swift Testing Expert (Project-Specific)

Testing expertise tailored for the iOS/macOS apps in this monorepo.

## Project Test Structure

```
ProjectName/
├── ProjectName/           # Source files
├── ProjectNameTests/      # Unit tests
└── ProjectNameUITests/    # UI tests (if applicable)
```

## Test Conventions

### File Naming

- Test file: `[SourceFile]Tests.swift`
- Example: `GameScene.swift` → `GameSceneTests.swift`

### Test Function Naming

```swift
func test_[unit]_[scenario]_[expectedResult]()
// Example:
func test_scoreManager_addPoints_incrementsScore()
```

### Standard Patterns

```swift
import XCTest
@testable import ProjectName

final class ComponentTests: XCTestCase {
    var sut: Component!  // System Under Test

    override func setUp() {
        super.setUp()
        sut = Component()
    }

    override func tearDown() {
        sut = nil
        super.tearDown()
    }

    func test_method_condition_expectedResult() {
        // Arrange

        // Act

        // Assert
    }
}
```

### Async Testing

```swift
func test_asyncMethod_succeeds() async throws {
    let result = try await sut.fetchData()
    XCTAssertNotNil(result)
}
```

### Memory Safety

```swift
// Use [weak self] in closures
Task { [weak self] in
    guard let self else { return }
    await self.performWork()
}
```

## Running Tests

```bash
# Via Xcode
Cmd+U  # Run all tests

# Via command line
xcodebuild test -scheme ProjectName -destination 'platform=iOS Simulator,name=iPhone 16'
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/dboone323) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

