Skip to content

Conversation

@codomposer
Copy link

Add Unit Tests for Chip Control

Summary

This PR adds comprehensive unit tests for the Chip control, which previously had no test coverage.

Changes

  • ✅ Added ChipTests.cs with 14 unit tests covering all functionality of the Chip control
  • ✅ Tests follow the existing testing patterns used in the repository (TUnit framework)
  • ✅ All tests use STAThreadExecutor for WPF compatibility

Test Structure

Each test follows the pattern:

  1. Create a Chip instance
  2. Assert default values
  3. Set property values
  4. Assert the values are correctly set/retrieved

Event and command tests:

  1. Create a Chip instance and apply default style
  2. Set up event handlers or commands
  3. Simulate user interaction (button click)
  4. Assert expected behavior occurred

Contribution by Gittensor, learn more at https://gittensor.io/

@codomposer
Copy link
Author

hi @Keboo
can you please check this pull request?

@Keboo
Copy link
Member

Keboo commented Nov 14, 2025

Thank you for the contribution. However, for most of the controls we do the testing through the UI test framework XAMLTest. The test project is MaterialDesignThemes.UITests. Testing at that level ensure that the WPF templates and styles also are tested rather than testing the control classes directly.

@Keboo Keboo added the Waiting on feedback Additional information is needed. Stale items with this label may be closed. label Nov 14, 2025
@codomposer
Copy link
Author

Thank you for the contribution. However, for most of the controls we do the testing through the UI test framework XAMLTest. The test project is MaterialDesignThemes.UITests. Testing at that level ensure that the WPF templates and styles also are tested rather than testing the control classes directly.

I've pushed update based on your feedback, can you please check it?

@codomposer
Copy link
Author

@Keboo

@codomposer codomposer closed this Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting on feedback Additional information is needed. Stale items with this label may be closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants