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

Fix loading device model properties on a device #1249 #1253

Merged

Conversation

hocinehacherouf
Copy link
Contributor

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 Sep 16, 2022

Codecov Report

Base: 88.23% // Head: 88.22% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (23f68ce) compared to base (68ce3a6).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1253      +/-   ##
==========================================
- Coverage   88.23%   88.22%   -0.02%     
==========================================
  Files         222      222              
  Lines        6836     6826      -10     
==========================================
- Hits         6032     6022      -10     
  Misses        804      804              
Impacted Files Coverage Δ
...al/Server/Services/DeviceModelPropertiesService.cs 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

_ = this.mockTableClientFactory.Setup(c => c.GetDeviceTemplates())
.Returns(this.mockDeviceTemplatesTableClient.Object);
_ = this.mockDeviceModelRepository.Setup(repository => repository.GetByIdAsync(It.IsAny<string>()))
.ReturnsAsync((DeviceModel)null);

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [DeviceModel](2) - the conversion can be done implicitly.
Comment on lines +62 to +64
return deviceModelEntity == null
? throw new ResourceNotFoundException($"The device model {deviceModelId} doesn't exist")
: true;

Check notice

Code scanning / CodeQL

Unnecessarily complex Boolean expression

The expression 'A ? B : true' can be simplified to '!A || B'.
@hocinehacherouf hocinehacherouf marked this pull request as ready for review September 16, 2022 11:14
@hocinehacherouf hocinehacherouf requested a review from a team as a code owner September 16, 2022 11:14
@kbeaugrand kbeaugrand merged commit 800cecd into main Sep 16, 2022
@kbeaugrand kbeaugrand deleted the bugfix/1249_fix_loading_device_model_properties_on_device branch September 16, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Failed to get device model properties
2 participants