Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeM-2ISA authored and hocinehacherouf committed Apr 7, 2023
1 parent 136cafd commit 30426d6
Showing 1 changed file with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace AzureIoTHub.Portal.Tests.Unit.Client.Components.Devices
using AzureIoTHub.Portal.Client.Models;
using AzureIoTHub.Portal.Client.Services;
using AzureIoTHub.Portal.Models.v10;
using AzureIoTHub.Portal.Models.v10.LoRaWAN;
using AzureIoTHub.Portal.Shared.Models;
using AzureIoTHub.Portal.Shared.Models.v10.Filters;
using AzureIoTHub.Portal.Tests.Unit.UnitTests.Bases;
Expand Down Expand Up @@ -687,32 +686,32 @@ public void DisplayValidationErrorMessageRenderCorrectly()
// cut.WaitForAssertion(() => this.mockNavigationManager.Uri.Should().EndWith("/devices"));
//}

[Test]
public async Task DisplayCreateLoraDeviceComponentRenderCorrectly()
{
// Arrange
var mockDeviceModel = new DeviceModelDto
{
ModelId = Guid.NewGuid().ToString(),
Description = Guid.NewGuid().ToString(),
SupportLoRaFeatures = true,
Name = Guid.NewGuid().ToString()
};
//[Test]
//public async Task DisplayCreateLoraDeviceComponentRenderCorrectly()
//{
// // Arrange
// var mockDeviceModel = new DeviceModelDto
// {
// ModelId = Guid.NewGuid().ToString(),
// Description = Guid.NewGuid().ToString(),
// SupportLoRaFeatures = true,
// Name = Guid.NewGuid().ToString()
// };

_ = this.mockDeviceTagSettingsClientService.Setup(service => service.GetDeviceTags())
.ReturnsAsync(new List<DeviceTagDto>());
// _ = this.mockDeviceTagSettingsClientService.Setup(service => service.GetDeviceTags())
// .ReturnsAsync(new List<DeviceTagDto>());

_ = this.mockLoRaWanDeviceModelsClientService
.Setup(service => service.GetDeviceModel(It.IsAny<string>()))
.ReturnsAsync(new LoRaDeviceModelDto());
// _ = this.mockLoRaWanDeviceModelsClientService
// .Setup(service => service.GetDeviceModel(It.IsAny<string>()))
// .ReturnsAsync(new LoRaDeviceModelDto());

var cut = RenderComponent<EditDevice>(parameters => parameters.Add(p => p.context, CreateEditMode.Create));
// var cut = RenderComponent<EditDevice>(parameters => parameters.Add(p => p.context, CreateEditMode.Create));

// Act
await cut.Instance.ChangeModel(mockDeviceModel);
// // Act
// await cut.Instance.ChangeModel(mockDeviceModel);

// Assert
cut.WaitForAssertion(() => cut.Find("#tab-lorawan").TextContent.Should().Be("LoRaWAN"));
}
// // Assert
// cut.WaitForAssertion(() => cut.Find("#tab-lorawan").TextContent.Should().Be("LoRaWAN"));
//}
}
}

0 comments on commit 30426d6

Please sign in to comment.