-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ishkawa/test-demo
Add testing demo
- Loading branch information
Showing
4 changed files
with
148 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
DataSourceKit.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0940" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "7F9AEDA9213BBBA10092854F" | ||
BuildableName = "Demo.app" | ||
BlueprintName = "Demo" | ||
ReferencedContainer = "container:DataSourceKit.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "7F9AEDBC213BBBA30092854F" | ||
BuildableName = "DemoTests.xctest" | ||
BlueprintName = "DemoTests" | ||
ReferencedContainer = "container:DataSourceKit.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "7F9AEDA9213BBBA10092854F" | ||
BuildableName = "Demo.app" | ||
BlueprintName = "Demo" | ||
ReferencedContainer = "container:DataSourceKit.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "7F9AEDA9213BBBA10092854F" | ||
BuildableName = "Demo.app" | ||
BlueprintName = "Demo" | ||
ReferencedContainer = "container:DataSourceKit.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "7F9AEDA9213BBBA10092854F" | ||
BuildableName = "Demo.app" | ||
BlueprintName = "Demo" | ||
ReferencedContainer = "container:DataSourceKit.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// VenuDetailViewControllerTests.swift | ||
// DemoTests | ||
// | ||
// Created by Yosuke Ishikawa on 2018/09/05. | ||
// Copyright © 2018年 Yosuke Ishikawa. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import Demo | ||
|
||
class VenuDetailViewControllerTests: XCTestCase { | ||
func testEmptyRelatedVenues() { | ||
let venue = Venue(photo: nil, name: "Kaminarimon") | ||
let review1 = Review(authorImage: nil, authorName: "Yosuke Ishikawa", body: "Foo") | ||
let review2 = Review(authorImage: nil, authorName: "Masatake Yamoto", body: "Bar") | ||
|
||
let data = VenueDetailViewController.Data( | ||
venue: venue, | ||
reviews: [ | ||
review1, | ||
review2, | ||
], | ||
relatedVenues: []) | ||
|
||
XCTAssertEqual(data.cellDeclarations, [ | ||
.outline(venue), | ||
.sectionHeader("Reviews"), | ||
.review(review1), | ||
.review(review2), | ||
]) | ||
} | ||
} |