﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Armin Kalajdzija Posts : TDD</title><link />http://developers.de/blogs/armin_kalajdzija/archive/tags/TDD/default.aspx<description>Tags: TDD</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>How to integrate JavaScript Unit Tests in Visual Studio Online</title><link />http://developers.de/blogs/armin_kalajdzija/archive/2015/09/22/how-to-integrate-javascript-unit-tests-in-visual-studio-online.aspx<pubdate>Tue, 22 Sep 2015 12:34:40 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1549176</guid><dc:creator>Armin Kalajdzija</dc:creator><slash:comments>0</slash:comments><wfw:commentrss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://developers.de/blogs/armin_kalajdzija/rsscomments.aspx?PostID=1549176</wfw:commentrss><comments>http://developers.de/blogs/armin_kalajdzija/archive/2015/09/22/how-to-integrate-javascript-unit-tests-in-visual-studio-online.aspx#comments</comments><description>&lt;p&gt;We all know the importance of Unit Testing and it should definitely have an important part of every Project, but we also know that todays Web Application have major parts of (at least UI) Logic implemented in diverse JavaScript libs that also needs to be Unit Tested and in also integrated in your Build Server Definitions.&lt;/p&gt;  &lt;p&gt;As I was searching for ways how to achieve that goal, I run upon the great Post from Mathew Aniyan (&lt;a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/07/09/javascript-unit-tests-on-team-foundation-service-with-chutzpah.aspx"&gt;link here&lt;/a&gt;) that describes how to use &lt;a href="https://github.com/mmanela/chutzpah"&gt;Chutzpah&lt;/a&gt;, JavaScript Unit Test Runner for Jasmine Unit Test Framework that comes with implemented Visual Studio Test Adapter. I was not 100% satisfied with the Solution, but I was more then happy to know that the Test Adapter of Chutzpah works on Visual Studio Online and that I don’t need to write any Command Lines in my Build Definition to run the Jasmine Specs (JavaScript Unit Tests) by myself.&lt;/p&gt;  &lt;p&gt;So lets take a look how I solved the JavaScript Unit Testing on my hosted Visual Studio Online Build Definition:&lt;/p&gt;  &lt;p&gt;1. Step was to create a new Test Project that will be used for JavaScript Unit Testing. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/solutionexplorer_5F00_1F5D5B81.png"&gt;&lt;img title="solutionexplorer" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="solutionexplorer" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/solutionexplorer_5F00_thumb_5F00_5808058E.png" width="293" height="426" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see, I named it Demo.Javascript.Test and structured it so that it has Folder &lt;strong&gt;Test&lt;/strong&gt; containing Specs Files and &lt;strong&gt;Sources&lt;/strong&gt; that will actually contain my JavaScript Sources that needs to be tested.     &lt;br /&gt;&lt;em&gt;(I strongly recommend not to copy your .js Sources from your Web Project to Test Project but to Link them to the Sources Folder)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;2. Step was to add Chutzpah and Jasmine-Test Nuget Packages to my Project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/nuget_5F00_0CA861CA.png"&gt;&lt;img title="nuget" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="nuget" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/nuget_5F00_thumb_5F00_0831E103.png" width="640" height="297" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;(I also recommend not to Check-In Packages to your TFS and to let your Build Server get the “fresh” version on every Build. On how to do that, read &lt;a href="https://docs.nuget.org/consume/package-restore/msbuild-integrated"&gt;this link&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;3. Step was modifying my Build Definition on Visual Studio Online and to reference Chutzpah Test Adapter so that VSTest can understand our JavaScript Specs files and test them correctly.    &lt;br /&gt;To do that, add new &lt;strong&gt;Visual Studio Test&lt;/strong&gt; runner to your Build Definition and configure it like here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/builddefinition_5F00_580A963F.png"&gt;&lt;img title="builddefinition" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="builddefinition" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/builddefinition_5F00_thumb_5F00_5327E283.png" width="569" height="402" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The only two things you need to configure are:    &lt;br /&gt;- &lt;strong&gt;Test Assembly Wildcard&lt;/strong&gt;, which was in my case all Files ending with Specs with .js extension, and in every Subfolder.     &lt;br /&gt;- &lt;strong&gt;Path to Custom Test Adapters&lt;/strong&gt;, which should be pointing to local Sources Directory $(Build.SourcesDirectory) and then the Packages folder.&lt;/p&gt;  &lt;p&gt;Really cool thing is that we &lt;strong&gt;don’t need to Check-In any binaries&lt;/strong&gt; and have to update them from time to time. This way, on every Build, the MSBuild will get the latest NuGet Packages (Chutzpah in our case) and we will be using the latest binaries in our Visual Studio Test Runner.&lt;/p&gt;  &lt;p&gt;Now, when you run the Hosted Build on your Visual Studio Online you should get Output like following:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/build_5F00_0BD28C91.png"&gt;&lt;img title="build" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="build" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/armin_5F00_kalajdzija/build_5F00_thumb_5F00_12859614.png" width="315" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In Logs of the Build Process you can then see all information about which Specs Files are tested and which Methods were being tested. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I hope I could save you some time or encourage you to add Unit Tests of your JavaScript Sources. Thanks to the Chutzpah Test Runner it is really simple do add Jasmine Unit Testing Framework to your Visual Studio Online which adds an Important feature to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1549176" width="1" height="1"&gt;</description><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/TDD/default.aspx">TDD</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/PhantomJS/default.aspx">PhantomJS</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Jasmine/default.aspx">Jasmine</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Unit+Testing/default.aspx">Unit Testing</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Chutzpah/default.aspx">Chutzpah</category></item><item><title>Technologies to learn in 2007</title><link />http://developers.de/blogs/armin_kalajdzija/archive/2007/07/03/technologies-to-learn-in-2007.aspx<pubdate>Tue, 03 Jul 2007 10:45:00 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1421</guid><dc:creator>Armin Kalajdzija</dc:creator><slash:comments>1</slash:comments><wfw:commentrss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://developers.de/blogs/armin_kalajdzija/rsscomments.aspx?PostID=1421</wfw:commentrss><comments>http://developers.de/blogs/armin_kalajdzija/archive/2007/07/03/technologies-to-learn-in-2007.aspx#comments</comments><description>&lt;p&gt;On many
blogs I have seen that people are talking about all new technologies and which
of them are the right one to invest the Time in. &lt;/p&gt;

&lt;p&gt;This is a
list of the things that I definitely want to learn or to extend my knowledge in
this year:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;WCF (Windows Communication
Foundation): &lt;/b&gt;As we
all know, WCF integrates Remoting, WebServices, EnterpriseServices,
Transactions and much more stuff into a one Framework, what makes him one of
the .NET Technologies to be learned this year.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;ADO.NET and LINQ:&lt;/b&gt; How to talk to data store or
databases, and all other ADO.NET features is definitely MUST KNOW for every
developer. The next big thing in how to talk to data is LINQ with language
extensions and entity objects that &amp;quot;represent&amp;quot; mappings of data and its
relationships.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;TDD (Test Driven Development): &lt;/b&gt;Very important thing, in order to
successfully develop robust systems is to use tests and have a test protocol.
It is very important too, how to do the testing right and which test to write.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;WPF (Windows Presentation
Foundation): &lt;/b&gt;Beside
that the WPF is veeery cool, Microsoft has declared that WPF is the new way we
are going to make Applications in future. It is already build in Windows Vista
and many other important subsystems. So all that you learned about Windows
Forms, UI Elements or even pages in browser you can throw away.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;Application Security: &lt;/b&gt;The more you become an expert in
security, the better and secure will your applications be, and the higher your
pay will be too :)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;System.Net: &lt;/b&gt;TCP, UDP, HTTP and all other
protocols supported by System.Net (Networking) is very important part that you
need to know in order to connect the programs together and make them talk to
each other. When you get better in this area, you will surely be better equipped
to make the right kind of choices.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;7.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/b&gt;&lt;b&gt;Threading: &lt;/b&gt;I still think that I have some lacks
in my knowledge in System.Threading. I know that I am not the only developer t
hat thinks so, but that is definitely one part of .NET Framework where I will
need to invest some time some day.&lt;/p&gt;



&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1421" width="1" height="1"&gt;</description><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Security/default.aspx">Security</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/WPF/default.aspx">WPF</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/TDD/default.aspx">TDD</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/WCF/default.aspx">WCF</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/Threading/default.aspx">Threading</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://developers.de/blogs/armin_kalajdzija/archive/tags/.Net/default.aspx">.Net</category></item></channel></rss>