Skip to content

Commit

Permalink
Fix unit tests #2624
Browse files Browse the repository at this point in the history
  • Loading branch information
hocinehacherouf committed Oct 26, 2023
1 parent 6bc4c65 commit 84a35df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public async Task SetDeviceModelModelPropertiesShouldSetDeviceModelModelProperti
var deviceModel = Fixture.Create<DeviceModelDto>();
var expectedDeviceModelProperties = Fixture.Build<DeviceProperty>().CreateMany(3).ToList();

_ = MockHttpClient.When(HttpMethod.Get, $"/api/models/{deviceModel.ModelId}/properties")
_ = MockHttpClient.When(HttpMethod.Post, $"/api/models/{deviceModel.ModelId}/properties")
.With(m =>
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IList<DeviceProperty>>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public async Task CreateIoTEdgeModelShouldCreateEdgeModel()
// Arrange
var expectedEdgeModel = Fixture.Create<IoTEdgeModel>();

_ = MockHttpClient.When(HttpMethod.Post, "api/edge/models")
_ = MockHttpClient.When(HttpMethod.Post, "/api/edge/models")
.With(m =>
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IoTEdgeModel>>();
Expand Down Expand Up @@ -105,7 +105,7 @@ public async Task UpdateIoTEdgeModelShouldUpdateEdgeModel()
// Arrange
var expectedEdgeModel = Fixture.Create<IoTEdgeModel>();

_ = MockHttpClient.When(HttpMethod.Put, $"api/edge/models/{expectedEdgeModel.ModelId}")
_ = MockHttpClient.When(HttpMethod.Put, $"/api/edge/models")
.With(m =>
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IoTEdgeModel>>();
Expand All @@ -132,7 +132,7 @@ public async Task DeleteIoTEdgeModelShouldDeleteEdgeModel()
// Arrange
var expectedEdgeModel = Fixture.Create<DeviceModelDto>();

_ = MockHttpClient.When(HttpMethod.Delete, $"api/edge/models/{expectedEdgeModel.ModelId}")
_ = MockHttpClient.When(HttpMethod.Delete, $"/api/edge/models/{expectedEdgeModel.ModelId}")
.Respond(HttpStatusCode.NoContent);

// Act
Expand Down Expand Up @@ -190,7 +190,7 @@ public async Task DeleteAvatarPropertiesShouldChangeAvatar()
// Arrange
var deviceModel = Fixture.Create<IoTEdgeModel>();

_ = MockHttpClient.When(HttpMethod.Post, $"/api/edge/models/{deviceModel.ModelId}/avatar")
_ = MockHttpClient.When(HttpMethod.Delete, $"/api/edge/models/{deviceModel.ModelId}/avatar")
.Respond(HttpStatusCode.NoContent);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public async Task SetDeviceModelCommandsShouldSetDeviceModelCommands()

var expectedCommands = Fixture.Build<DeviceModelCommandDto>().CreateMany(3).ToList();

_ = MockHttpClient.When(HttpMethod.Get, $"/api/lorawan/models/{deviceModelId.ModelId}/properties")
_ = MockHttpClient.When(HttpMethod.Post, $"/api/lorawan/models/{deviceModelId.ModelId}/commands")
.With(m =>
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IList<DeviceModelCommandDto>>>();
Expand Down

0 comments on commit 84a35df

Please sign in to comment.