Classes that I use as templates for Server Side Swift using Vapor.
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
import Console | |
import Routing | |
import HTTP | |
class FakeRouter: RouteBuilder { | |
public typealias Host = String | |
public typealias Method = String | |
public typealias Output = HTTP.Responder | |
private let console: Terminal |
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
// A view containing stacked title and message labels | |
// The entire layout is manually calculated every time the view has to be rendered or it's requested to re-layout | |
class SomeView: UIView { | |
let titleLabel = UILabel(frame: .zero) | |
let messageLabel = UILabel(frame: .zero) | |
// ...other subviews | |
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
// A view containing stacked title and message labels | |
// The labels have flexible width that changes accordingly to this view's size changes | |
class SomeView: UIView { | |
let titleLabel: UILabel | |
let messageLabel: UILabel | |
// ...other subviews | |
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
import XCTest | |
@testable import AppTests | |
XCTMain([ | |
testCase(PostsControllerTests.allTests), | |
]) |
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
import XCTest | |
@testable import App | |
class PostsControllerTests: XCTestCase { | |
func testExample() { | |
XCTAssertTrue(true) | |
} | |
} |
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
import PackageDescription | |
let package = Package( | |
name: "VaporApp", | |
targets: [ | |
Target(name: "Executable", dependencies: ["App"]) | |
], | |
dependencies: [ | |
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 5) | |
], |
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
public func respond(to request: Request, with responses: [ContentType : ResponseRepresentable]) throws -> ResponseRepresentable { | |
let contentType: ContentType | |
let _ = request.accept.prefers("html") | |
if let header = request.accept.first { | |
var requestedContentType = ContentType.from(string: header.mediaType) | |
if requestedContentType == .any { | |
if let requestContentType = request.contentType { | |
requestedContentType = ContentType.from(string: requestContentType) | |
} | |
else { |
In software engineering, graphical user interface testing is the process of testing a product's graphical user interface to ensure it meets its specifications. This is normally done through the use of a variety of test cases.
-- Wikipedia
UI Testing (also know as End-to-End Testing, or sometimes Integration Testing) helps with two aspects of software development:
- Regression Testing: to ensure that all possible user journeys - especially the edge cases, or for rarely visited screens - consistently funcion correctly across releases.
- New features development: to help determine 1. the minimum amount of work to be done to implement the feature, 2. that the new feature functions correctly, 3. helps ensuring the app is more accessible for people with disabilities. Moreover, done during development, UI Testing ensures immediate regression testing exposure.
OlderNewer