Severity: Warning
Files:
tests/Servy.UI.UnitTests/Services/FileDialogServiceTests.cs
tests/Servy.UI.UnitTests/Services/MessageBoxServiceTests.cs
tests/Servy.UnitTests/Services/ServiceCommandsTests.cs (5 of 9 tests)
Description:
These tests call methods on _mockService.Object and immediately verify those same calls on _mockService. This tests Moq's internal dispatch table, not any production code. The tests will always pass regardless of whether the real implementation exists, compiles, or behaves correctly. Zero production code coverage is produced.
Example pattern:
_mockFileDialogService.Setup(x => x.OpenFile(...)).Returns("test.exe");
var result = _mockFileDialogService.Object.OpenFile(...);
_mockFileDialogService.Verify(x => x.OpenFile(...), Times.Once);
Suggested fix:
Instantiate the real production class and test its actual behavior, or delete the mock-only tests and replace with integration tests.
Severity: Warning
Files:
tests/Servy.UI.UnitTests/Services/FileDialogServiceTests.cstests/Servy.UI.UnitTests/Services/MessageBoxServiceTests.cstests/Servy.UnitTests/Services/ServiceCommandsTests.cs(5 of 9 tests)Description:
These tests call methods on
_mockService.Objectand immediately verify those same calls on_mockService. This tests Moq's internal dispatch table, not any production code. The tests will always pass regardless of whether the real implementation exists, compiles, or behaves correctly. Zero production code coverage is produced.Example pattern:
Suggested fix:
Instantiate the real production class and test its actual behavior, or delete the mock-only tests and replace with integration tests.