<commit_before>//
//  ShotListViewReactorTests.swift
//  Drrrible
//
//  Created by <NAME> on 22/03/2017.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import XCTest

import RxCocoa
import RxExpect
import RxSwift
import RxTest

@testable import Drrrible

final class ShotListViewReactorTests: TestCase {

  func testIsRefreshing() {
    RxExpect() { test in
      let provider = MockServiceProvider()
      let reactor = ShotListViewReactor(provider: provider)
      test.input(reactor.action, [
        next(100, .refresh),
      ])
      test.assert(reactor.state.map { $0.isRefreshing })
        .filterNext()
        .equal([
          false,
          true,
          false,
        ])
    }
  }

  func testSections() {
    RxExpect { test in
      let provider = MockServiceProvider()
      provider.shotService = MockShotService(provider: provider).then {
        $0.shotsClosure = { _ in
          .just(List(items: [ShotFixture.shot1, ShotFixture.shot2]))
        }
      }

      let reactor = ShotListViewReactor(provider: provider)
      test.input(reactor.action, [
        next(100, .refresh),
      ])

      let sectionItemCount = reactor.state
        .map { $0.sections }
        .map { $0[0].items.count }
        .distinctUntilChanged()
      test.assert(sectionItemCount)
        .filterNext()<commit_msg>Remove unused test<commit_after>//
//  ShotListViewReactorTests.swift
//  Drrrible
//
//  Created by <NAME> on 22/03/2017.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import XCTest

import RxCocoa
import RxExpect
import RxSwift
import RxTest

@testable import Drrrible

final class ShotListViewReactorTests: TestCase {

  func testSections() {
    RxExpect { test in
      let provider = MockServiceProvider()
      provider.shotService = MockShotService(provider: provider).then {
        $0.shotsClosure = { _ in
          .just(List(items: [ShotFixture.shot1, ShotFixture.shot2]))
        }
      }

      let reactor = ShotListViewReactor(provider: provider)
      test.input(reactor.action, [
        next(100, .refresh),
      ])

      let sectionItemCount = reactor.state
        .map { $0.sections }
        .map { $0[0].items.count }
        .distinctUntilChanged()
      test.assert(sectionItemCount)
        .filterNext()
{'fraction_non_alphanumeric': 0.11018437225636524, 'fraction_numerical': 0.02019315188762072, 'mean_word_length': 2.421921921921922, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3316406', 'n_tokens_mistral': 760, 'n_tokens_neox': 692, 'n_words': 153}