Skip to content

Commit

Permalink
add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sben65 authored and kbeaugrand committed Oct 26, 2022
1 parent e295506 commit 88f60fc
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,33 @@ public void ClickOnShowSystemModuleDetailShouldShowDialog()
cut.WaitForAssertion(() => MockRepository.VerifyAll());
}

[Test]
public void ClickOnShowSystemModuleDetailShouldShowDialogAndReturnIfAborted()
{
// Arrange
_ = SetupLoadEdgeModel();

var mockDialogReference = MockRepository.Create<IDialogReference>();
_ = mockDialogReference.Setup(c => c.Result).ReturnsAsync(DialogResult.Cancel());

_ = this.mockDialogService
.Setup(c => c.Show<SystemModuleDialog>(It.IsAny<string>(), It.IsAny<DialogParameters>(), It.IsAny<DialogOptions>()))
.Returns(mockDialogReference.Object);

// Act
var cut = RenderComponent<EdgeModelDetailPage>(ComponentParameter.CreateParameter("ModelID", this.mockEdgeModleId));

cut.WaitForAssertion(() => Assert.AreEqual(1, cut.FindAll("#editSystModuleButton_edgeAgent").Count));
var editEdgeAgentButton = cut.WaitForElement("#editSystModuleButton_edgeAgent");

cut.WaitForElement($"#{nameof(EdgeModelSystemModule.ImageUri)}").Change("image/test");

editEdgeAgentButton.Click();

// Assert
cut.WaitForAssertion(() => MockRepository.VerifyAll());
}

[Test]
public void DeleteAvatarShouldRemoveTheImage()
{
Expand Down

0 comments on commit 88f60fc

Please sign in to comment.