<commit_before><commit_msg>view test<commit_after>/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (<EMAIL>).
 * See LICENSE for details.
 */

package com.almasb.fxgl.input.view

import com.almasb.fxgl.input.KeyTrigger
import com.almasb.fxgl.input.MouseTrigger
import javafx.scene.input.KeyCode
import javafx.scene.input.MouseButton
import javafx.scene.paint.Color
import org.hamcrest.CoreMatchers.hasItem
import org.hamcrest.CoreMatchers.not
import org.hamcrest.MatcherAssert.assertThat
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test

/**
 *
 * @author <NAME> (<EMAIL>)
 */
class ViewTest {

    @Test
    fun `Key view`() {
        val view = KeyView(KeyCode.A, Color.WHITE, 15.0)
    }

    @Test
    fun `MouseButton view`() {
        val view = MouseButtonView(MouseButton.PRIMARY, Color.BLUE, 20.0)
    }

    @Test
    fun `Trigger view`() {
        val view = TriggerView(KeyTrigger(KeyCode.C))
        val nodes = arrayListOf(view.children)

        assertTrue(nodes.isNotEmpty())

        view.trigger = MouseTrigger(MouseButton.SECONDARY)

        assertTrue(view.children.isNotEmpty())

        nodes.forEach {
            assertThat(view.children, not(hasItem(it)))
        }
    }
}
{'fraction_non_alphanumeric': 0.12243285939968404, 'fraction_numerical': 0.004739336492890996, 'mean_word_length': 3.1677631578947367, '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': '3019769', 'n_tokens_mistral': 430, 'n_tokens_neox': 418, 'n_words': 80}