Skip to content

Commit

Permalink
Removed changelog (now in github); added basic ui- and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzaru committed Jul 9, 2023
1 parent 0b4f6d3 commit 33028ec
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 61 deletions.
61 changes: 0 additions & 61 deletions CHANGELOG.md

This file was deleted.

36 changes: 36 additions & 0 deletions ImageToBase64-Tests/ImageToBase64_Tests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// ImageToBase64_Tests.swift
// ImageToBase64-Tests
//
// Created by Martin Albrecht on 09.07.23.
// Copyright © 2023 Martin Albrecht <[email protected]>. All rights reserved.
//

import XCTest

final class ImageToBase64_Tests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
measure {
// Put the code you want to measure the time of here.
}
}

}
42 changes: 42 additions & 0 deletions ImageToBase64-UITests/ImageToBase64_UITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// ImageToBase64_UITests.swift
// ImageToBase64-UITests
//
// Created by Martin Albrecht on 08.07.23.
// Copyright © 2023 Martin Albrecht <[email protected]>. All rights reserved.
//

import XCTest

final class ImageToBase64_UITests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.

// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false

// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
33 changes: 33 additions & 0 deletions ImageToBase64-UITests/ImageToBase64_UITestsLaunchTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// ImageToBase64_UITestsLaunchTests.swift
// ImageToBase64-UITests
//
// Created by Martin Albrecht on 08.07.23.
// Copyright © 2023 Martin Albrecht <[email protected]>. All rights reserved.
//

import XCTest

final class ImageToBase64_UITestsLaunchTests: XCTestCase {

override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}

override func setUpWithError() throws {
continueAfterFailure = false
}

func testLaunch() throws {
let app = XCUIApplication()
app.launch()

// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}

0 comments on commit 33028ec

Please sign in to comment.