Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 1.52 KB

CONVENTION.md

File metadata and controls

75 lines (61 loc) · 1.52 KB

Development Conventions

Naming

  • Layouts (files)

    feature_name _ layout_type

    Examples

    • feedback_survey_activity
    • shipping_label_package_details_list_item
    • product_tag_list_item
    • product_download_details_fragment
    • feedback_survey_fragment
  • View IDs

    goal ViewType

    Examples

    • doneButton
    • headingTextView
    • choice1RadioButton
    • userNameEditText
    • successImageView
  • Drawables

    todo

  • Dimensions

    todo

  • Text Appearances

    todo

  • Extension functions

    todo

Testing

Unit Tests

  • General approach

    todo

  • Naming

    given something is, when something happens, then something is expected

    Examples

    fun `when the button is clicked, then the sum label is updated`() {
        val currentSum = sumLabel.text as Int
    
        // WHEN
        presenter.onButtonClick()
    
        // THEN
        assertThat(sumLabel.text).isEqualTo("${currentSum + 1}")
    }
    
    fun `given the button has 9 clicks, when the button is clicked, then the appropriate message is shown`() {
        // GIVEN
        repeat(9) { presenter.onButtonClick() }
    
        // WHEN
        presenter.onButtonClick()
    
        // THEN
        assertThat(messageLabel.text).isEqualTo("Wow, 10 clicks")
    }
    

UI Tests

todo

E2E

todo

Code organization

todo