Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix unit tests on IoTHub.Portal.Tests.Unit.Client.Services #2625

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading