Convert getter/setter methods to properties, replace .equals() with ==, and use property references in assertions#36
Conversation
- Convert getCurrentMaxSpeed/setCurrentMaxSpeed to currentMaxSpeed property - Convert getCurrentTrackLength/setCurrentTrackLength to currentTrackLength property - Convert getCurrentNameString/setCurrentNameString to currentNameString property - Update all call sites in source and tests to use property syntax - All tests pass (629/659 active tests) - Code quality checks pass (ktlint, detekt) Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
- Convert Point.equals() to == in DefaultContext.kt (3 occurrences) - Convert Point.equals() to != in Cell.kt (1 occurrence) - All null-safety assertions remain unchanged - All tests pass (629/659 active tests) Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
bedaHovorka
left a comment
There was a problem hiding this comment.
there are some tweaks tip for asserts.
Is really all classes to rewrite? Don't you remember anything? @copilot
… assertions - Import assertk.assertions.prop in test files - Replace assertThat(object.property) with assertThat(object).prop(Type::property) - More type-safe and idiomatic Kotlin testing pattern - All tests pass (629/659 active tests) Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
I focused on the minimal necessary changes as requested:
All null checks remain unchanged as required. All 629 tests pass. |
|


Light cleanup to modernize Java-style patterns to idiomatic Kotlin syntax while preserving all existing behavior and null-safety.
Changes
Getter/setter methods → properties
Converted three method pairs in
EditingContextinterface to Kotlin properties:Updated implementations in
DefaultContextwith custom getter forcurrentNameStringto maintain null-coalescing behavior..equals() → == operator
Replaced explicit
.equals()calls with Kotlin equality operators in Point comparisons (4 occurrences inDefaultContext.ktandCell.kt).Property references in test assertions
Updated test assertions to use assertk's
prop()method with property references for type-safe assertions:This provides more idiomatic Kotlin testing with type-safe property references.
Impact
RailwayNetGridCanvas.kt, test filesAll null checks and assertions remain unchanged.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.