2019-11-18 12:54:23 -08:00
|
|
|
//
|
|
|
|
// 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
|
2019-11-18 12:54:23 -08:00
|
|
|
@testable import ZcashLightClientKit
|
|
|
|
|
2023-01-18 08:09:04 -08:00
|
|
|
// swiftlint:disable implicitly_unwrapped_optional force_try
|
2019-11-18 12:54:23 -08:00
|
|
|
class NotesRepositoryTests: XCTestCase {
|
|
|
|
var sentNotesRepository: SentNotesRepository!
|
|
|
|
var receivedNotesRepository: ReceivedNoteRepository!
|
2021-09-23 06:26:41 -07:00
|
|
|
|
2019-11-18 12:54:23 -08:00
|
|
|
override func setUp() {
|
2021-09-23 06:26:41 -07:00
|
|
|
super.setUp()
|
2022-10-20 13:22:24 -07:00
|
|
|
sentNotesRepository = try! TestDbBuilder.sentNotesRepository()
|
|
|
|
receivedNotesRepository = try! TestDbBuilder.receivedNotesRepository()
|
2019-11-18 12:54:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
override func tearDown() {
|
2021-09-23 06:26:41 -07:00
|
|
|
super.tearDown()
|
2019-11-18 12:54:23 -08:00
|
|
|
sentNotesRepository = nil
|
|
|
|
receivedNotesRepository = nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func testSentCount() {
|
|
|
|
var count: Int?
|
|
|
|
XCTAssertNoThrow(try { count = try sentNotesRepository.count() }())
|
2022-10-21 09:54:53 -07:00
|
|
|
XCTAssertEqual(count, 13)
|
2019-11-18 12:54:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func testReceivedCount() {
|
|
|
|
var count: Int?
|
|
|
|
XCTAssertNoThrow(try { count = try receivedNotesRepository.count() }())
|
2022-10-21 09:54:53 -07:00
|
|
|
XCTAssertEqual(count, 22)
|
2019-11-18 12:54:23 -08:00
|
|
|
}
|
|
|
|
}
|