p.armytank
✅ Event-Driven-Architecture Cons Issue
If the user is going to wait on the result of the action then using commands doesn't make sense. Just update the db and return the info in the response to the same request. The user will also then know if the order failed.
Commands are useful when the user doesn't immediately care about the result - for example generating the tracking number for the order.
16 replies
help understanding unit test and mocking, which of the two example are valid
I'm talking about the constructor for LocalServiceWraper. You would pass in the instance of IThirdPartyService to LocalServiceWraper's constructor, and then use that instance in TransformDoSomething.
10 replies
help understanding unit test and mocking, which of the two example are valid
Yes because you are not injecting IThirdPartyService into LocalServiceWraper. You should be using constructor injection to create the instance of ThirdPartyService. Then in your test you would pass your thirdPservicemock into the constructor of LocalServiceWraper.
10 replies
help understanding unit test and mocking, which of the two example are valid
Ok, now I understand better. So is LocalServiceWraper the class that you're trying to test? In that case method 2 is better - you want to use the concrete implementation. In method 1 you are just testing a mock, which is pointless.
10 replies
help understanding unit test and mocking, which of the two example are valid
Both seem okay to me. In TestMethod2 I would call localServiceMock a test implementation or stub rather than a mock but it's still a valid way to unit test.
Edit: I guess I'm assuming that LocalServiceWraperTest is created specifically for testing and is not your runtime implementation. It's hard to understand since all your classes have the word test/example in the name.
10 replies
what URL should Kestrel listen to in a docker container on Azure App Service
You need to give the app service an application setting for WEBSITES_PORT with the value of whatever port your container is listening on (8080 probably). You will also need to expose 8080 from the container.
https://stackoverflow.com/questions/48693878/how-do-you-expose-port-3000-using-an-azure-web-app-container
2 replies