Skip to content

Commit

Permalink
SLVS-1387 Implement review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriela-trutan-sonarsource committed Oct 14, 2024
1 parent 0d530bd commit 2aca670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/ConnectedMode.UnitTests/SlCoreConnectionAdapterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

using System.Security;
using NSubstitute.ExceptionExtensions;
using SonarLint.VisualStudio.ConnectedMode.Persistence;
using SonarLint.VisualStudio.ConnectedMode.UI.Credentials;
using SonarLint.VisualStudio.ConnectedMode.UI.OrganizationSelection;
Expand Down Expand Up @@ -477,7 +476,7 @@ public async Task FuzzySearchProjectsAsync_ThrowsException_ReturnsFalse()

response.Success.Should().BeFalse();
response.ResponseData.Should().BeEmpty();
logger.LogVerbose(Resources.FuzzySearchProjects_Fails, sonarCloudConnection.Id, searchTerm, exception);
logger.Received(1).LogVerbose(Resources.FuzzySearchProjects_Fails, sonarCloudConnection.Id, searchTerm, exception);
}

private bool IsExpectedSonarQubeConnectionParams(ValidateConnectionParams receivedParams, string token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ await progressReporterViewModel.Received(1)
[TestMethod]
public void ProjectSearchTerm_WithEmptyTerm_ShouldRestoreInitialListOfProjects()
{
var viewModel = CreateInitializedTestSubjectWitNotMockedProgress();
var viewModel = CreateInitializedTestSubjectWithNotMockedProgress();
slCoreConnectionAdapter.FuzzySearchProjectsAsync(testSubject.ServerConnection, Arg.Any<string>()).Returns(new AdapterResponseWithData<List<ServerProject>>(true, []));

viewModel.ProjectSearchTerm = "myProject";
Expand All @@ -144,7 +144,7 @@ public void ProjectSearchTerm_WithEmptyTerm_ShouldRestoreInitialListOfProjects()
public void ProjectSearchTerm_WithTerm_ReturnsProjectFromSlCore()
{
var searchTerm = "myProject";
var viewModel = CreateInitializedTestSubjectWitNotMockedProgress();
var viewModel = CreateInitializedTestSubjectWithNotMockedProgress();
slCoreConnectionAdapter.FuzzySearchProjectsAsync(testSubject.ServerConnection, searchTerm).Returns(new AdapterResponseWithData<List<ServerProject>>(true, []));

viewModel.ProjectSearchTerm = searchTerm;
Expand All @@ -157,7 +157,7 @@ public void ProjectSearchTerm_WithTerm_ReturnsProjectFromSlCore()
public void ProjectSearchTerm_RaisesEvents()
{
var searchTerm = "proj1";
var viewModel = CreateInitializedTestSubjectWitNotMockedProgress();
var viewModel = CreateInitializedTestSubjectWithNotMockedProgress();
var eventHandler = Substitute.For<PropertyChangedEventHandler>();
viewModel.PropertyChanged += eventHandler;
slCoreConnectionAdapter.FuzzySearchProjectsAsync(testSubject.ServerConnection, searchTerm).Returns(new AdapterResponseWithData<List<ServerProject>>(true, []));
Expand Down Expand Up @@ -291,7 +291,7 @@ private void MockTrySonarQubeConnection(ConnectionInfo connectionInfo, bool succ
});
}

private ProjectSelectionViewModel CreateInitializedTestSubjectWitNotMockedProgress()
private ProjectSelectionViewModel CreateInitializedTestSubjectWithNotMockedProgress()
{
var viewModel = CreateTestSubjectWithNotMockedProgress();
viewModel.InitProjects(new AdapterResponseWithData<List<ServerProject>>(true, AnInitialListOfProjects));
Expand Down

0 comments on commit 2aca670

Please sign in to comment.