Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Jul 1, 2024
1 parent 05e07fd commit af807ea
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions CalciumTests/CalciumTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

@testable import CalciumApp
import CalciumCommon
import ComposableArchitecture
import XCTest

Expand All @@ -18,8 +19,11 @@ class CalciumTests: XCTestCase {
let screen = MainScreen(
store: store
)
store.send(.pressButton(.digit(.one)))
XCTAssertEqual(screen.store.state.displayingText, CalculatorButton.digit(.one).displayingValue)
store.send(.pressButton(.SomeDigit(digit: .one)))
XCTAssertEqual(
screen.store.state.displayingText,
CalciumCommon.CalculatorButton.SomeDigit(digit: .one).displayingValue
)
}

@MainActor
Expand All @@ -30,10 +34,10 @@ class CalciumTests: XCTestCase {
let screen = MainScreen(
store: store
)
store.send(.pressButton(.digit(.one)))
store.send(.pressButton(.operation(.plus)))
store.send(.pressButton(.digit(.two)))
store.send(.pressButton(.operation(.equals)))
store.send(.pressButton(.SomeDigit(digit: .one)))
store.send(.pressButton(.SomeOperation(operation: .plus)))
store.send(.pressButton(.SomeDigit(digit: .two)))
store.send(.pressButton(.SomeOperation(operation: .equals)))

try await Task.sleep(nanoseconds: 1_000_000_000)

Expand Down

0 comments on commit af807ea

Please sign in to comment.