How to Unit Test Private Methods in MS Test

Before we start to see, how a private method can be unit tested using the MS Test? Let us discuss whether it is a good idea to test a private method or not? Often I have seen there are two school of thoughts,

  1. Private methods should be tested.
  2. Private methods should not be tested.

To put these things in perspective, let us consider a system under test (SUT) Salary class as shown in the listing below.

image

A system under test Salary class has two functions:

  1. The CalculateSal method is a public method and it takes two parameters to calculate the salary
  2. The isValidwd method is a private method and it takes one parameter. This function returns true if the number of working days are more than 8, or else it returns false.
  3. The CalculateSal method first checks whether the number of working days is valid or not using the private method isValidWd.
  4. If the number of working days is valid, then salary is calculated by the multiplication of basic salary and the number of working days, or else it is fixed at $1000.

Read full article on the Infragistics blog

How to create an Azure-based real time Chat Application using Firebase and jQuery

In this post, we’re going to show you step by step instructions on how to create a Chat application that’s similar to a group chat messenger where many people at any given time can read and send messages with the group. In this example we’re going to use the following technologies:

  1. Firebase
  2. HTML
  3. Bootstrap
  4. jQuery

Eventually we will host the application on the Microsoft Azure website, and we’ll use Visual Studio IDE to develop the application.

You can see the real time chat application we are going to build in this article live at: http://igchatapp.azurewebsites.net/chat.html . Feel free to chat with us at this URL!

Setting up Firebase

Register on https://www.firebase.com/ and login to access the Firebase portal. In the right hand side, you’ll find the option to create a new app. Give your app a name and the URL to create a new app in Firebase.

Read the full article on the Infragistics blog

Hosted workshop on SPA using AngularJS for BirlaSoft

On Saturday 18th July, for Infragistics, I delivered a workshop on Single Page Application using AngularJS for BirlaSoft . A special thanks to C-SharpCorner Delhi Chapter for arranging the workshop.

clip_image002

5 Hrs. long workshop was attended by around 45 engineers. We learnt about the following topics,

  • Introduction of AngularJS
  • Controller and $scope
  • Views and Routing in AngularJS
  • Directives
  • ASP.NET Web API
  • CORS in Web API
  • Ignite UI with AngularJS

We were mange to create an end to end AngularJS based Single Page application performing CRUD operation using the ASP.NET Web API.

Audience participations was highly energetic and some of their feedback are motivating for us. One of such feedback is below:

clip_image002[6]

clip_image003

Overall it was productive Saturday for all of us and I personally had fun time teaching engineers of BirlaSoft.

clip_image005

Once again big thank you to Infragistics and C# Corner Delhi chapter for the opportunity. If you are interested in such workshop for your organization, feel free to reach us.

Join Infragistics Webinar – How to Write Unit Tests in C#

Register for the Webinar here

When: 10th July, 3 PM IST

Where: online

Along with learning 3 of you may win cool Infragistics goodies.

Once again Infragistics is happy to host another webinar in India time zone for the developers. On 10th July at 3 PM in the comfort of your office/home desk, you have an opportunity to lean step by step – How to write Unit Test in C#

image

Register for the Webinar here

In the webinar I will walk you through,

  • Setting up a the test project
  • Write your first unit test using MS Test
  • Setting up environment for NUnit test
  • Write unit tests using the NUnit.
  • Understanding Red – Green Tests, Test Setup, Test Teardown, etc.;
  • Creating a calculator application using the TDD.

Register for the Webinar here

We will try to go as slow as possible in the webinar and learn the basics of Unit testing. 3 active participants among you can win cool Infragistics goodies.

I am excited to see you in the webinar.

Delhi developers join me to learn SOLID principles and win Infragistics goodies on 4th July in C# corner Noida office

Register here to attend! It’s free!

clip_image002

Yes you heard it right, tomorrow (4th July) along with learning SOLID principles with me, you may have a chance to win Infragistics cool goodies. You have a chance to win cool Infragistics bag or pen drives on your active participation in the session.

Learn more about Infragistics here

clip_image004

Event is happening under the umbrella of C-Sharpcorner Delhi chapter at their office on 4th July starting from 9 AM.

Event location is :

clip_image006

Register here to attend! It’s free!

About the Topic

SOLID principles are the five basic principles of object-oriented programming and design. Systems created using these principles are easy to extend and maintain over time, making them a wise choice. But where do you begin to learn about them?

In this 2 hrs session, we’ll explore all of the basic SOLID principles, including:

  • The Single responsibility principle;
  • The Open Closed principle;
  • The Liskov substitution principle;
  • The Interface segregation principle; and
  • The Dependency Inversion

Additionally, you’ll learn how to create a system by adhering to the SOLID principles we explore, using C# as a language to understand the principles.

Register here to attend! It’s free!

Hope to see you tomorrow in the event and big thanks to C# corner team for arranging this.