In working with the sample projects in the the Azure SDK I wanted to make sure I understood how the Marketplace event flow was happening. If you do the tutorial in the Azure 1.4 it helps you connect an application so it can handle subscription events from the marketplace. There is a lot of code created for you though. Once I got it working I still did not really understand what the event flow was happening from the Marketplace to my application. The solution? Spend some time digging through all the code and application flow and create a nice little Visio to help visualize it. Below is the diagram I created. Hopefully, if you have used the tutorial this will help you understand how the components you created and configured actually get wired together.
I recently was setting up a repository in a project with an interface on all repositories that took a predicate. As part of this I needed to mock out this call so I could unit test my code. The vast majority of samples out there for mocking an expression predicate just is It.IsAny<> which is not very helpful as it does not test anything other then verify it got a predicate. What if you actually want to test that you got a certain predicate though? It is actually pretty easy to do but not very straight forward. Here is what you do for the It.IsAny<> approach in case someone is looking for that. this .bindingRepository.Setup(c => c.Get(It.IsAny<Expression<Func<UserBinding, bool >>>())) .Returns( new List<UserBinding>() { defaultBinding }.AsQueryable()); This example just says to always return a collection of UserBindings that contain “defaultBinding” (which is an object I setup previously). Here is what it looks like when you want to pass in an exp
Comments