Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "57762AF5-A8FF-4150-91E6-2BCEFBF9D9C7"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C0C4C8BC-4DA1-4EFA-85AB-934C91668A7E"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TA SignalsTests/TA_SignalsTests.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "29"
endingLineNumber = "29"
landmarkName = "test_if_market_open()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "976781FE-6DE3-4D6A-BF83-9671015546F6"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TA SignalsTests/TA_SignalsTests.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "52"
endingLineNumber = "52"
landmarkName = "TA_SignalsTests"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "9300D18C-6EA0-43C9-BBB4-B7780AD6038D"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TA SignalsTests/TA_SignalsTests.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "51"
endingLineNumber = "51"
landmarkName = "TA_SignalsTests"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
51 changes: 37 additions & 14 deletions TA SignalsTests/TA_SignalsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,48 @@ import XCTest
@testable import TA_Signals

class TA_SignalsTests: XCTestCase {

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

func test_fetch_base_url(){

let url = AppConstants.baseURL
let expectedURL = "https://raw.githubusercontent.com/iamgabrielma/Python-for-stock-market-analysis/main/testData/"

XCTAssertEqual(url, expectedURL)

}

func test_if_market_open() throws {

let appSettings = TASettings()
let isMarketOpen = {
return appSettings.isMarketOpen
}
// Skip test if market is closed, as will fail:
try XCTSkipIf(!isMarketOpen(), "Skipping test, market is closed.")
XCTAssertEqual(isMarketOpen(), true)

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

func test_if_market_closed() throws {

let appSettings = TASettings()
let isMarketOpen = {
return appSettings.isMarketOpen
}
// Skip test if market is open, as will fail:
try XCTSkipIf(isMarketOpen(), "Skipping test, market is open.")
XCTAssertEqual(isMarketOpen(), false)

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.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
// WIP
// func test_json(){
//
//
// let stockDataFetcher = StocksDataFetcher()
// let response = stockDataFetcher.stocks.isEmpty
// XCTAssertEqual(response, false) // Fails, isEmpty = true . init value before fetching data?
//
// }

}