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

Refactor DevicesControllerBase #986 #1172

Merged
merged 6 commits into from
Sep 13, 2022

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

@hocinehacherouf hocinehacherouf changed the title Refactor GetCredentials on DevicesControllerBase #986 Refactor DevicesControllerBase #986 Sep 8, 2022
@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Base: 87.92% // Head: 87.96% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (4652efd) compared to base (418ba4e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1172      +/-   ##
==========================================
+ Coverage   87.92%   87.96%   +0.03%     
==========================================
  Files         217      217              
  Lines        6923     6920       -3     
==========================================
  Hits         6087     6087              
+ Misses        836      833       -3     
Impacted Files Coverage Δ
...ortal/Server/Controllers/v1.0/DevicesController.cs 100.00% <100.00%> (ø)
...l/Server/Controllers/v1.0/DevicesControllerBase.cs 98.95% <100.00%> (+2.08%) ⬆️
...ntrollers/v1.0/LoRaWAN/LoRaWANDevicesController.cs 100.00% <100.00%> (ø)
...zureIoTHub.Portal/Server/Services/DeviceService.cs 94.62% <100.00%> (+0.50%) ⬆️

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.

var deviceId = Guid.NewGuid().ToString();

_ = this.mockRegistryManager.Setup(c => c.GetTwinAsync(It.Is<string>(x => x == deviceId)))
.ReturnsAsync((Twin)null);

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [Twin](2) - the conversion can be done implicitly.
@kbeaugrand kbeaugrand force-pushed the feature/986_refactor_device_controller_base branch from 5236326 to 456520c Compare September 9, 2022 17:42
@audserraCGI audserraCGI force-pushed the feature/986_refactor_device_controller_base branch from d790ce7 to 224fb72 Compare September 13, 2022 10:03
var service = CreateService();
var deviceId = Guid.NewGuid().ToString();
_ = this.mockRegistryManager.Setup(c => c.GetDeviceAsync(It.IsAny<string>()))
.ReturnsAsync((Device)null);

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [Device](2) - the conversion can be done implicitly.
@audserraCGI audserraCGI marked this pull request as ready for review September 13, 2022 15:12
@audserraCGI audserraCGI requested a review from a team as a code owner September 13, 2022 15:12
@audserraCGI audserraCGI marked this pull request as draft September 13, 2022 15:20
@audserraCGI audserraCGI marked this pull request as ready for review September 13, 2022 15:37
@hocinehacherouf hocinehacherouf merged commit d5778d2 into main Sep 13, 2022
@hocinehacherouf hocinehacherouf deleted the feature/986_refactor_device_controller_base branch September 13, 2022 17:31
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.

Refactor DevicesControllerBase
2 participants