null
null
CC#
Created by Natty on 11/23/2023 in #help
How do I properly unit test a post request?
system under test
14 replies
CC#
Created by Natty on 11/23/2023 in #help
How do I properly unit test a post request?
When unit testing, you should only mock the external dependencies of your system under test. So in your case, _facilityService is the sut and everything else is an external dependency, even the database call. For that matter, any test that contains some kind of I/O, network hop etc. is considered an integration test.
14 replies
CC#
Created by froxerbbq on 11/30/2022 in #help
❔ Upgrading a solution from .net core 3.1 to .net 6.0
https://learn.microsoft.com/en-us/dotnet/standard/frameworks maybe try with <TargetFramework>net6.0</TargetFramework>
5 replies
CC#
Created by null on 10/5/2022 in #help
Refactor constructor to be used with DI [Answered]
to be honest, the code await Task.CompletedTask is just a placeholder, not actually used.
36 replies
CC#
Created by null on 10/5/2022 in #help
Refactor constructor to be used with DI [Answered]
Could you elaborate on that? Any resources or documentation?
36 replies
CC#
Created by null on 10/5/2022 in #help
Refactor constructor to be used with DI [Answered]
but I need the ability to retrieve a value from the appsettings
36 replies
CC#
Created by null on 10/5/2022 in #help
Refactor constructor to be used with DI [Answered]
my goal is to inject the database caller, without needing to create a new instance in the WeatherForecastController
36 replies