Sha256: 27a83124e08bcd8779f25f2d5d541bbe8e310b114400f0af2bf931c087ed20c5

Contents?: true

Size: 938 Bytes

Versions: 4

Compression:

Stored size: 938 Bytes

Contents

import Foundation
import XCTest
import SwiftyJSON
import KituraNet

@testable import <%= application_name %>
@testable import StatsD

public class HealthHandlerTests: XCTestCase {
  var mockStatsD: MockStatsD?

  public override func setUp() {
    mockStatsD = MockStatsD()
  }

  public func testReturnsHTTPStatusOK() {
    HealthHandler.handle(statsD: mockStatsD!) {
      (status: HTTPStatusCode, data: JSON?) in
        XCTAssertEqual(HTTPStatusCode.OK, status)
    }
  }

  public func testReturnsValidResponse() {
    HealthHandler.handle(statsD: mockStatsD!) {
      (status: HTTPStatusCode, data: JSON?) in
        XCTAssertEqual("OK", data!["status_message"])
    }
  }
}

extension HealthHandlerTests {
  static var allTests: [(String, (HealthHandlerTests) -> () throws -> Void)] {
    return [
      ("testReturnsHTTPStatusOK", testReturnsHTTPStatusOK),
      ("testReturnsValidResponse", testReturnsValidResponse)
    ]
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
minke-generator-swift-0.5 lib/generators/swift/scaffold/src/Tests/<%= application_name %>/HealthHandlerTests.swift.erb
minke-generator-swift-0.4 lib/generators/swift/scaffold/src/Tests/<%= application_name %>/HealthHandlerTests.swift.erb
minke-generator-swift-0.2.2 lib/generators/swift/scaffold/src/Tests/<%= application_name %>/HealthHandlerTests.swift.erb
minke-generator-swift-0.2.1 lib/generators/swift/scaffold/src/Tests/<%= application_name %>/HealthHandlerTests.swift.erb