Skip to content

Commit

Permalink
Add discard variable sot all unused returns
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand committed Apr 21, 2024
1 parent 3643298 commit 4a95a7d
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task AwsGreengrassComponentDialog_ClickOnCancel_DialogCanceled()
};

IDialogReference dialogReference = null;
await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassComponentDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassComponentDialog>(string.Empty, parameters));

// Act
cut.Find("#greengrass-component-cancel").Click();
Expand Down Expand Up @@ -76,7 +76,7 @@ public async Task AwsGreengrassComponentDialog_CreateAWSComponentAndSubmit_EdgeM
};

IDialogReference dialogReference = null;
await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassComponentDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassComponentDialog>(string.Empty, parameters));

// Act
cut.WaitForElement("#greengrass-component-recipe-json").Change(inputJsonRecipe);
Expand Down Expand Up @@ -128,7 +128,7 @@ public async Task AwsGreengrassComponentDialog_EditAWSComponentAndSubmit_EdgeMod
};

IDialogReference dialogReference = null;
await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassComponentDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassComponentDialog>(string.Empty, parameters));

// Act
cut.WaitForElement("#greengrass-component-recipe-json").Change(newJsonRecipe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task AwsGreengrassPublicComponentsDialog_AfterOnInitializedAsync_Pu
};

// Act
await cut.InvokeAsync(() => service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
cut.WaitForAssertion(() => cut.FindAll("table tbody tr").Count.Should().Be(10));

// Assert
Expand All @@ -77,7 +77,7 @@ public async Task AwsGreengrassPublicComponentsDialog_ClickOnCancel_DialogCancel
};

IDialogReference dialogReference = null;
await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
cut.WaitForAssertion(() => cut.FindAll("table tbody tr").Count.Should().Be(10));

// Act
Expand Down Expand Up @@ -110,7 +110,7 @@ public async Task AwsGreengrassPublicComponentsDialog_ClickOnSubmitWithoutSelect
};

IDialogReference dialogReference = null;
await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
cut.WaitForAssertion(() => cut.FindAll("table tbody tr").Count.Should().Be(10));

// Act
Expand Down Expand Up @@ -143,7 +143,7 @@ public async Task AwsGreengrassPublicComponentsDialog_ClickOnSubmitAfterSelectin
};

IDialogReference dialogReference = null;
await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<AwsGreengrassPublicComponentsDialog>(string.Empty, parameters));
cut.WaitForAssertion(() => cut.FindAll("table tbody tr").Count.Should().Be(10));

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task ModuleDialogTestMustBeRenderedOnShow()
};

// Act
await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));

cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ModuleName)}").OuterHtml.Should().Contain(moduleName));
Expand Down Expand Up @@ -94,7 +94,7 @@ public async Task ClickOnSubmitShouldUpdateModuleValues()
};

// Act
await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));

cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());

Expand Down Expand Up @@ -138,7 +138,7 @@ public async Task ForAWSModuleDialogTestMustBeRenderedOnShow()
};

// Act
await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));

cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ModuleName)}").OuterHtml.Should().Contain(moduleName));
Expand Down Expand Up @@ -179,7 +179,7 @@ public async Task ForAWSClickOnSubmitShouldUpdateModuleValues()
};

// Act
await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ModuleDialog>(string.Empty, parameters));

cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task DeleteDeviceConfigurationShouldDeleteConfiguration()

IDialogReference dialogReference = null;

await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<DeleteDeviceConfiguration>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<DeleteDeviceConfiguration>(string.Empty, parameters));
cut.WaitForAssertion(() => cut.Find("#delete-device-configuration"));

// Act
Expand Down Expand Up @@ -101,7 +101,7 @@ public async Task DeleteConcentratorPageShouldProcessProblemDetailsExceptionWhen
}
};

await cut.InvokeAsync(() => this.dialogService?.Show<DeleteDeviceConfiguration>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => this.dialogService?.Show<DeleteDeviceConfiguration>(string.Empty, parameters));
cut.WaitForAssertion(() => cut.Find("#delete-device-configuration"));

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task ConnectionStringDialogMustBeRenderedOnShow()
};

// Act
await cut.InvokeAsync(() => service?.Show<ConnectionStringDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ConnectionStringDialog>(string.Empty, parameters));

// Assert
cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());
Expand Down Expand Up @@ -82,7 +82,7 @@ public async Task OnInitializedAsyncShouldProcessProblemDetailsExceptionWhenIssu
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<ConnectionStringDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<ConnectionStringDialog>(string.Empty, parameters));

var result = await dialogReference.Result;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task DeleteDevice_NonLoRaDevice_DeviceDeleted()
};

// Act
await cut.InvokeAsync(() => service?.Show<DeleteDevicePage>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<DeleteDevicePage>(string.Empty, parameters));
cut.WaitForElement("#delete-device").Click();

// Assert
Expand All @@ -81,7 +81,7 @@ public async Task DeleteDevice_LoRaDevice_LoRaDeviceDeleted()
};

// Act
await cut.InvokeAsync(() => service?.Show<DeleteDevicePage>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<DeleteDevicePage>(string.Empty, parameters));
cut.WaitForElement("#delete-device").Click();

// Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task ImportShouldDisplayLoadingDuringProcess()
};

// Act
await cut.InvokeAsync(() => this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));

// Assert
cut.WaitForState(() => cut.HasComponent<MudProgressCircular>());
Expand All @@ -88,7 +88,7 @@ public async Task WhenNoErrorsDuringImportShouldDisplaySuccessMessage()
};

// Act
await cut.InvokeAsync(() => this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
cut.WaitForState(() => !cut.HasComponent<MudProgressCircular>());

// Assert
Expand Down Expand Up @@ -120,7 +120,7 @@ public async Task WhenExceptionOccuresShouldCloseThePopup()
// Act
IDialogReference dialogReference = null;

await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));

// Assert
_ = dialogReference.Should().NotBeNull();
Expand Down Expand Up @@ -166,7 +166,7 @@ public async Task WhenErrorsDuringImportShouldDisplayErrorMessages()
};

// Act
await cut.InvokeAsync(() => this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
cut.WaitForState(() => !cut.HasComponent<MudProgressCircular>());

// Assert
Expand Down Expand Up @@ -213,7 +213,7 @@ public async Task ClickOnCloseShouldCloseTheDialog()

IDialogReference dialogReference = null;

await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ImportReportDialog>(string.Empty, parameters));

_ = dialogReference.Result.Should().NotBeNull()
.And.BeOfType<Task<DialogResult>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task Show_TelemetryLoaded_CanvasIsRendered()
};

// Act
await cut.InvokeAsync(() => service?.Show<LoRaDeviceTelemetryDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<LoRaDeviceTelemetryDialog>(string.Empty, parameters));
_ = cut.WaitForElement("canvas");

// Assert
Expand Down Expand Up @@ -84,7 +84,7 @@ public async Task Show_CancelDialog_DialogIsCancelled()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<LoRaDeviceTelemetryDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<LoRaDeviceTelemetryDialog>(string.Empty, parameters));
_ = cut.WaitForElement("canvas");
var deleteBtn = cut.Find("#cancel-telemetry-dialog");
deleteBtn.Click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public async Task ConnectionStringDialogMustShowEnrollmentCredentials()
};

// Act
await cut.InvokeAsync(() => this.dialogService?.Show<ConnectionStringDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => this.dialogService?.Show<ConnectionStringDialog>(string.Empty, parameters));
_ = cut.WaitForElement("div.mud-paper");

// Assert
Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task ConnectionStringDialogMustBeCancelledWhenProblemDetailsOccurs(
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ConnectionStringDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ConnectionStringDialog>(string.Empty, parameters));
var result = await dialogReference.Result;

// Assert
Expand Down Expand Up @@ -118,7 +118,7 @@ public async Task ConnectionStringDialogMustBeClosedOnClickOnOk()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ConnectionStringDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<ConnectionStringDialog>(string.Empty, parameters));
cut.WaitForElement("#ok").Click();

var result = await dialogReference.Result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task EdgeDeviceDeleteConfirmationDialogMustDeleteDevice()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<EdgeDeviceDeleteConfirmationDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<EdgeDeviceDeleteConfirmationDialog>(string.Empty, parameters));
cut.Find("#delete").Click();
var result = await dialogReference.GetReturnValueAsync<bool>();

Expand Down Expand Up @@ -85,7 +85,7 @@ public async Task EdgeDeviceDeleteConfirmationDialogShouldProcessProblemDetailsE
};

// Act
await cut.InvokeAsync(() => this.dialogService?.Show<EdgeDeviceDeleteConfirmationDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => this.dialogService?.Show<EdgeDeviceDeleteConfirmationDialog>(string.Empty, parameters));
cut.Find("#delete").Click();

// Assert
Expand All @@ -111,7 +111,7 @@ public async Task EdgeDeviceDeleteConfirmationDialogMustBeCanceledOnClickOnCance
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<EdgeDeviceDeleteConfirmationDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = this.dialogService?.Show<EdgeDeviceDeleteConfirmationDialog>(string.Empty, parameters));
cut.Find("#cancel").Click();
var result = await dialogReference.Result;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public async Task ModuleLogsDialogParametersMustBeCorrect()
};

// Act
await cut.InvokeAsync(() => service?.Show<ModuleLogsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ModuleLogsDialog>(string.Empty, parameters));

// Assert
_ = cut.FindAll("tr").Count.Should().Be(4);
Expand Down Expand Up @@ -103,7 +103,7 @@ public async Task ModuleLogsShouldProcessProblemDetailsExceptionWhenIssueOccursO
};

// Act
await cut.InvokeAsync(() => service?.Show<ModuleLogsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => service?.Show<ModuleLogsDialog>(string.Empty, parameters));

// Assert
_ = cut.FindAll("tr").Count.Should().Be(2);
Expand Down Expand Up @@ -145,7 +145,7 @@ public async Task ModuleLogsMustCloseOnCLickOnCloseButton()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<ModuleLogsDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<ModuleLogsDialog>(string.Empty, parameters));
cut.Find("#close").Click();
var result = await dialogReference.Result;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task ClickOnDeleteButtonShouldCloseDialog()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<DeleteEdgeModelDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<DeleteEdgeModelDialog>(string.Empty, parameters));

var deleteBtn = cut.Find("#deleteButton");
deleteBtn.Click();
Expand Down Expand Up @@ -103,7 +103,7 @@ public async Task ClickOnDeleteButtonShouldProssessProblemDetailsException()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<DeleteEdgeModelDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<DeleteEdgeModelDialog>(string.Empty, parameters));

var deleteBtn = cut.Find("#deleteButton");
deleteBtn.Click();
Expand Down Expand Up @@ -135,7 +135,7 @@ public async Task ClickOnCancelButtonShouldCloseDialog()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<DeleteEdgeModelDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<DeleteEdgeModelDialog>(string.Empty, parameters));

var deleteBtn = cut.Find("#cancelButton");
deleteBtn.Click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task SystemModuleDialogMustCloseOnCLickOnCloseButton()
IDialogReference dialogReference = null;

// Act
await cut.InvokeAsync(() => dialogReference = service?.Show<SystemModuleDialog>(string.Empty, parameters));
_ = await cut.InvokeAsync(() => dialogReference = service?.Show<SystemModuleDialog>(string.Empty, parameters));

cut.Find("#SubmitButton").Click();
var result = await dialogReference.Result;
Expand Down
Loading

0 comments on commit 4a95a7d

Please sign in to comment.