ZcashLightClientKit/Tests/OfflineTests/NotesRepositoryTests.swift

41 lines
1.1 KiB
Swift
Raw Normal View History

//
// NotesRepositoryTests.swift
// ZcashLightClientKit-Unit-Tests
//
// Created by Francisco Gindre on 11/18/19.
//
import XCTest
2022-02-28 09:03:20 -08:00
@testable import TestUtils
@testable import ZcashLightClientKit
2021-09-23 06:26:41 -07:00
// swiftlint:disable implicitly_unwrapped_optional
class NotesRepositoryTests: XCTestCase {
var sentNotesRepository: SentNotesRepository!
var receivedNotesRepository: ReceivedNoteRepository!
2021-09-23 06:26:41 -07:00
override func setUp() {
2021-09-23 06:26:41 -07:00
super.setUp()
sentNotesRepository = try! TestDbBuilder.sentNotesRepository()
receivedNotesRepository = try! TestDbBuilder.receivedNotesRepository()
}
override func tearDown() {
2021-09-23 06:26:41 -07:00
super.tearDown()
sentNotesRepository = nil
receivedNotesRepository = nil
}
func testSentCount() {
var count: Int?
XCTAssertNoThrow(try { count = try sentNotesRepository.count() }())
XCTAssertEqual(count, 13)
}
func testReceivedCount() {
var count: Int?
XCTAssertNoThrow(try { count = try receivedNotesRepository.count() }())
XCTAssertEqual(count, 22)
}
}