Gorgo.Live.ToString()

Mariusz, Gorzoch tech Blog

Archive for October 2014

Expression Tree Visualizer for Visual Studio 2013

leave a comment »

If you start digging into Linq and Expression Trees then to make your life easier you should use ExpressionTreeVisualizer tool. First it was released as part of samples to Visual Studio 2008. Lucky there is upgraded version of it available on github with works with Visual Studio 2013. You can reach it under below link: https://github.com/Feddas/ExpressionTreeVisualizer

Once you get it to your station, then grab “ExpressionTreeVisualizer.dll” and place it under the folder “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\Debugger\Visualizers”. Next restart your visual studio and if you start debugging your app you should get:

2014-10-22 21-23-54

Now you can analyze your expression tool in more easy way.

Written by Mariusz Gorzoch

22 October 2014 at 21:27

Posted in Bez kategorii

Tagged with ,

Injection in Jasmine with anuglar-mock.js

leave a comment »

So, you’ve build your angular app service and now you would like to test it. Testing simple service without dependencies is not big deal, but when it goes to test services with have some dependencies then it is quite easy to get lost.

Let’s start with basic example, where our service is not depended on others:

http://jsfiddle.net/MariuszGorzoch/81o74pwq/2/

2014-10-06 11-41-00

above service didn’t have any dependencies, so let’s upgrade it:

http://jsfiddle.net/MariuszGorzoch/81o74pwq/5/

2014-10-06 11-40-23

as you can see above in order to inject dependency in our service we need to use $provide.value(‘{serviceWithAreTryingToMock}’, {MockImplementation}); Thanks to that we can mock whatever service we want.

Written by Mariusz Gorzoch

6 October 2014 at 11:49

Posted in Bez kategorii

Tagged with , ,