Flash0ver / F0.Minesweeper

Source of truth for a Blazor implementation of Minesweeper.
MIT License
6 stars 0 forks source link

fix(components): fixes automatic uncovering of cells #60

Closed dev-in-disguise closed 3 years ago

dev-in-disguise commented 3 years ago

Cells which are uncovered automatically due to the 0 adjacent mines feature are now re-rendered correctly. Cells in the status covered and flagger which are tried to be uncovered automatically due to the 0 adjacent mines feature are no longer tried to be uncovered in the ui.

fixes #49 , fixes #51

mcNicolescu commented 3 years ago

Hi Manuel

My preferred solution for such scenarios is a small factory interface, that can be injected and has a Create method It serves both purposes without modifications to the code base For testing purpose, we just inject the "testable" factory

It may lead to a few lines of code more than the ctor overload

KR

mcNicolescu commented 3 years ago

Even if we don't inject the factory, the important part is that being an interface, the Create method of the factory can be mocked easily in a test. ;)