<commit_before><commit_msg>Add test for biography fragment<commit_after>package com.antonioleiva.bandhookkotlin.ui.screens.detail

import android.test.AndroidTestCase
import android.text.Html
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import org.mockito.Mockito.*

/**
 * @author <EMAIL>
 * *         03/07/16.
 */
class BiographyFragmentTest : AndroidTestCase() {

    lateinit var layoutInflater: LayoutInflater
    lateinit var mainView: View
    lateinit var biographyTextView: TextView
    lateinit var biographyFragment: BiographyFragment

    override fun setUp() {
        super.setUp()

        layoutInflater = mock(LayoutInflater::class.java)
        mainView = mock(View::class.java)
        biographyTextView = TextView(context)

        `when`(layoutInflater.inflate(anyInt(), any(ViewGroup::class.java), anyBoolean()))
                .thenReturn(mainView)
        `when`(mainView.findViewById(anyInt())).thenReturn(biographyTextView)

        biographyFragment = BiographyFragment()

        biographyFragment.onCreateView(layoutInflater, null, null)
    }

    fun testBiographyText() {
        // Given
        val htmlText = "<b>bold text</b>"

        // When
        biographyFragment.setBiographyText(htmlText)

        // Then
        assertEquals(Html.fromHtml(htmlText).toString(), biographyFragment.getBiographyText())
    }
}
{'fraction_non_alphanumeric': 0.1020979020979021, 'fraction_numerical': 0.004195804195804196, 'mean_word_length': 3.457943925233645, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '3528799', 'n_tokens_mistral': 416, 'n_tokens_neox': 382, 'n_words': 74}