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

Move http calls from UI layer to dedicated client services #898

Merged

Conversation

hocinehacherouf
Copy link
Contributor

@hocinehacherouf hocinehacherouf commented Jul 3, 2022

Description

What's new?

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

@codecov
Copy link

codecov bot commented Jul 3, 2022

Codecov Report

Merging #898 (57d1aec) into main (526137f) will increase coverage by 0.15%.
The diff coverage is 83.44%.

@@            Coverage Diff             @@
##             main     #898      +/-   ##
==========================================
+ Coverage   83.00%   83.15%   +0.15%     
==========================================
  Files         154      162       +8     
  Lines        5300     5484     +184     
==========================================
+ Hits         4399     4560     +161     
- Misses        901      924      +23     
Impacted Files Coverage Δ
...ent/Pages/DeviceModels/DeleteDeviceModelPage.razor 0.00% <0.00%> (ø)
...Portal/Client/Pages/Devices/DeleteDevicePage.razor 0.00% <0.00%> (ø)
.../Client/Pages/Devices/LoRaWAN/EditLoraDevice.razor 0.00% <0.00%> (ø)
...ent/Pages/EdgeDevices/CreateEdgeDeviceDialog.razor 25.00% <0.00%> (ø)
....Portal/Client/Pages/EdgeModels/ModuleDetail.razor 0.00% <ø> (ø)
...ent/Pages/DeviceModels/CreateDeviceModelPage.razor 66.22% <36.36%> (-3.58%) ⬇️
...onfigurations/CreateDeviceConfigurationsPage.razor 51.96% <37.50%> (-0.09%) ⬇️
...Portal/Client/Pages/Devices/CreateDevicePage.razor 63.52% <45.45%> (+0.88%) ⬆️
...ent/Pages/DeviceModels/DeviceModelDetailPage.razor 72.00% <50.00%> (-2.83%) ⬇️
.../Client/Pages/EdgeDevices/EdgeDeviceListPage.razor 67.16% <50.00%> (ø)
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 526137f...57d1aec. Read the comment docs.

@hocinehacherouf hocinehacherouf force-pushed the feature/858_move_http_calls_to_dedicated_services branch from c96bfca to 3edd4ba Compare July 3, 2022 20:38
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IList<DeviceTag>>>();
var tags = m.Content as ObjectContent<IList<DeviceTag>>;
_ = tags.Value.Should().BeEquivalentTo(expectedDeviceTags);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [tags](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<Concentrator>>();
var body = m.Content as ObjectContent<Concentrator>;
_ = body.Value.Should().BeEquivalentTo(concentrator);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<Concentrator>>();
var body = m.Content as ObjectContent<Concentrator>;
_ = body.Value.Should().BeEquivalentTo(concentrator);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<DeviceDetails>>();
var body = m.Content as ObjectContent<DeviceDetails>;
_ = body.Value.Should().BeEquivalentTo(device);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<DeviceDetails>>();
var body = m.Content as ObjectContent<DeviceDetails>;
_ = body.Value.Should().BeEquivalentTo(device);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IList<DevicePropertyValue>>>();
var body = m.Content as ObjectContent<IList<DevicePropertyValue>>;
_ = body.Value.Should().BeEquivalentTo(deviceProperties);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<LoRaDeviceDetails>>();
var body = m.Content as ObjectContent<LoRaDeviceDetails>;
_ = body.Value.Should().BeEquivalentTo(device);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<LoRaDeviceDetails>>();
var body = m.Content as ObjectContent<LoRaDeviceDetails>;
_ = body.Value.Should().BeEquivalentTo(device);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
// Arrange
var deviceModel = Fixture.Create<DeviceModel>();
var content = new MultipartFormDataContent();

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable

Disposable 'MultipartFormDataContent' is created here but is not disposed.
{
ModelId = Fixture.Create<string>()
};
var content = new MultipartFormDataContent();

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable

Disposable 'MultipartFormDataContent' is created here but is not disposed.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<DeviceModel>>();
var body = m.Content as ObjectContent<DeviceModel>;
_ = body.Value.Should().BeEquivalentTo(expectedDeviceModel);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<DeviceModel>>();
var body = m.Content as ObjectContent<DeviceModel>;
_ = body.Value.Should().BeEquivalentTo(expectedDeviceModel);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IList<DeviceProperty>>>();
var body = m.Content as ObjectContent<IList<DeviceProperty>>;
_ = body.Value.Should().BeEquivalentTo(expectedDeviceModelProperties);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<MultipartFormDataContent>>();
var body = m.Content as ObjectContent<MultipartFormDataContent>;
_ = body.Value.Should().BeEquivalentTo(content);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<LoRaDeviceModel>>();
var body = m.Content as ObjectContent<LoRaDeviceModel>;
_ = body.Value.Should().BeEquivalentTo(expectedDeviceModel);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<LoRaDeviceModel>>();
var body = m.Content as ObjectContent<LoRaDeviceModel>;
_ = body.Value.Should().BeEquivalentTo(expectedDeviceModel);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IList<DeviceModelCommand>>>();
var body = m.Content as ObjectContent<IList<DeviceModelCommand>>;
_ = body.Value.Should().BeEquivalentTo(expectedCommands);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<MultipartFormDataContent>>();
var body = m.Content as ObjectContent<MultipartFormDataContent>;
_ = body.Value.Should().BeEquivalentTo(content);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
@hocinehacherouf hocinehacherouf force-pushed the feature/858_move_http_calls_to_dedicated_services branch from e841205 to 5e0d36e Compare July 6, 2022 22:46
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IoTEdgeDevice>>();
var body = m.Content as ObjectContent<IoTEdgeDevice>;
_ = body.Value.Should().BeEquivalentTo(device);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
{
_ = m.Content.Should().BeAssignableTo<ObjectContent<IoTEdgeDevice>>();
var body = m.Content as ObjectContent<IoTEdgeDevice>;
_ = body.Value.Should().BeEquivalentTo(device);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [body](1) may be null here because of [this](2) assignment.
@hocinehacherouf hocinehacherouf marked this pull request as ready for review July 7, 2022 08:04
@hocinehacherouf hocinehacherouf requested a review from a team as a code owner July 7, 2022 08:04
@hocinehacherouf hocinehacherouf merged commit 13e48be into main Jul 7, 2022
@hocinehacherouf hocinehacherouf deleted the feature/858_move_http_calls_to_dedicated_services branch July 7, 2022 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant