Skip to content

test: add unit tests for OsocModal#466

Merged
andoriyaprashant merged 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:test/osoc-modal
Jun 3, 2026
Merged

test: add unit tests for OsocModal#466
andoriyaprashant merged 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:test/osoc-modal

Conversation

@adityashirsatrao007

Copy link
Copy Markdown
Contributor

Description

Adds comprehensive unit tests for the OsocModal class.

Changes

  • Added test/osoc_modal_test.dart with tests covering:
    • Constructor field initialization
    • copyWith() with partial and full updates
    • toMap() serialization
    • fromMap() deserialization
    • toJson()/fromJson() round-trip
    • Equality operator (==) and hashCode
    • toString() output
    • Edge cases: empty skills list, zero spots, negative year

Related Issue

Contributes to #417 (improving test coverage and code quality)

Type of Change

  • New feature (adding tests)

Checklist

  • Tests pass locally
  • Code follows project style guidelines

Copilot AI review requested due to automatic review settings May 30, 2026 10:57
@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request! We'll review it as soon as possible.

@netlify

netlify Bot commented May 30, 2026

Copy link
Copy Markdown

Deploy Preview for aquamarine-kheer-83feda failed. Why did it fail? →

Name Link
🔨 Latest commit bc91211
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-kheer-83feda/deploys/6a1ac29aa1d7a60008259f8e

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds unit tests for the OsocModal data model to validate its core value-type behaviors (construction, copying, (de)serialization, and equality).

Changes:

  • Introduces a new test suite covering OsocModal constructor and copyWith.
  • Adds tests for toMap/fromMap and toJson/fromJson roundtrips.
  • Verifies toString, ==, and hashCode behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/osoc_modal_test.dart
Comment on lines +137 to +138
expect(model1.hashCode == model2.hashCode, isTrue);
expect(model1.hashCode == model3.hashCode, isFalse);
Comment thread test/osoc_modal_test.dart
Comment on lines +105 to +107
final expectedString =
'OsocModal(name: $testName, image_url: $testImageUrl, description: $testDescription, project_url: $testProjectUrl, year: $testYear)';
expect(model.toString(), expectedString);
@andoriyaprashant
andoriyaprashant merged commit 7189989 into andoriyaprashant:main Jun 3, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants