New to site?


Lost password? (X)

Already have an account?


(X)

Presents

#CSHARPCON20

The C# Corner Annual Conference 2020 is a three-day annual event for software professionals and developers.

3
DAYS
72
SPEAKERS
65
SESSIONS

Magnus Mårtensson
Microsoft Regional Director, Azure MVP, CEO Loftysoft

Avirag Jain
Director & CTO R Systems

Mahesh Chand
Founder C# Corner, CEO Mindcracker

Chris Gali
CEO & Co-Founder Graphite

Subinder Khurana
Chief Architect StoryProcess, Founder NASSCOM DeepTech Club

Bryan Rishforth
Investor, Chairman Graphite

Bryn Everson
Director Biz Dev Graphite

Raj Tiwari
Digital Transformation Leader, Futurist and Visionary

Joseph Guadagno
Microsoft MVP, Lead Quicken Loans

Nikita Sachdev
Entrepreneur, Blockchain Enthusiast & Advisor, Social Media Influencer

Doug Wagner
COO & Founder Adapt Technical Group

Ritesh Modi
Architect, Senior Evangelist, Cloud Architect

Crystal Wenrick
Director Communications Mindcracker

Allen O’Neill
Microsoft MVP, Consulting Engineer/Architect

Praveen Kumar
CEO MCN Solutions

Chris Love
Founder Love2Dev, Microsoft MVP, Author

Sanjay Vyas
Microsoft Regional Director, Microsoft MVP, Founder & CEO SkillLabs Technologies

Veena Sarda
Deep Learning Consultant, Author

Sekhar Srinivasan
C# Corner MVP, Microsoft Certified Trainer, Pluralsight Author

Lalit Bansal
Founder & CEO - EIY SYS

Navdeep Garg
CEO Revinfotech

Prakash Tripathi
Tech Manager/Leader, Microsoft MVP, Blogger

Bhavna Jain
Breakthrough Consultant

Naveen Sharma
Enterprise Architect, Leadership Coach, Author

Vidya Vrat Agarwal
Principal Architect, Microsoft MVP, Author

Sheetal Agarwal
Founder Clownselors, Medical Clown, Trainer

Abhishek Kant
Founder GTM Catalyst

Vishnu Saran
Founder & CEO VoiceQube

Sandeep Soni
Founder & CEO Deccansoft, Microsoft Certified Trainer

Parveen Malik
AVP InfoSec & Vulnerability Management, Information Security Expert

Nitin Pandit
Microsoft MVP, Developer Evangelist, Author

Niloshima Srivastava
C# Corner MVP, Tech Architect, Trainer, Blogger

Bala Chirtsabesan
Senior Software Engineer at Microsoft, Author

Manoj Mittal
Sr. Technical Architect, C# Corner MVP, Author

Chandni Di
Co-Founder Voice of Slum

Vithal Wadje
Technical Lead, Microsoft MVP, Author

Shivam Ahuja
Founder SkillCircle, Business Mentor

Chervine Bhiwoo
Solution Architect, Microsoft MVP, Author

Saurabh Jain
Vice President Paytm, Founder Fun2Do Labs, Author

Vinay Solanki
Head IoT at Lenovo, Founder IoT-NCR

Anshu kumari
Founder Blockchainkids, Inventor, Trainer

Amit Singal
CEO Startup Buddy

Dev Pratap
Co-Founder & CEO Voice of Slum

Amey Vartak
Technology Consultant, Full Stack Developer, C# Corner MVP, Author

Viswanatha Swamy
Principal Software Engineer, C# Corner MVP, Author

Sanket Verma
Research Engineer @ Ballistics (Forensics) and Chair, PyData Delhi

Sourabh Somani
Lead Developer, Microsoft MVP, Author

Abhishek Mishra
Software Architect, C# Corner MVP, Author

Siddharth Vaghasia
Technical Consultant, C# Corner MVP, Blogger

Bassam Alugili
Senior Software Specialist, Database Expert

S Ravi Kumar
Solution Architect, C# Corner MVP, Author

Sundaram Subramanian
Full Stack Developer, C# Corner MVP, Speaker

Deepesh Somani
Solution Architect, Microsoft MVP, Author

Debasis Saha
Technical Project Manager, C# Corner MVP, Blogger, Author

Vipul Jain
Software Architect, C# Corner MVP, Author

Akshay Patel
Technical Architect, Microsoft Certified Trainer, C# Corner MVP, Author

Stephen Simon
RPA Developer, Evangelist, Author

Vivek Sharma
Founder Kingster636, AR/VR Specialist

Jeetendra Gund
Technical Lead, C# Corner MVP, Author

Sujal Beniwal
AI Enthusiast, Student

M Viknaraj
Microsoft MVP, Azure Architect, Author

Prasham Sabadra
Software Architect, C# Corner MVP, Trainer, Author

Aakash Maurya
Senior Developer, C# Corner MVP, Speaker

Ankit Sharma
Senior Software Engineer, C# Corner MVP, Author

Mangesh Gaherwar
Team Lead, C# Corner MVP, Author

Viral Jain
Technical Consultant, C# Corner MVP, Author

Bhasker Das
Solution Architect, Evangelist

Manish Dwivedi
Associate Project Manager

Ck Nitin
Programmer, Author

Rohit Gupta
Technical Trainer, Author

Manish Tewatia
Full-stack Marketer, UX Designer

Bhavya Gaur
Technical Illustrator

Rohit Tomar
SEO/SMO Expert

Web Track

Cloud & Data Track

Dev Track

8am-9am

Registration & Breakfast

9am-10am

Future of Desktop Apps with JS (ElectronJs)

Nitin Pandit

Building Serverless Microservices Using Microsoft Azure

Vithal Wadje

Innovating RPA: A Robot for Every Person

Stephen Simon

10am-11am

Managing Cloud Storage Accounts using Logic Apps

Viknaraj Manogararajah

Data visualization using Python

Sekhar Srinivasan

Going Cross platform with AR Foundation

Vivek Sharma

11am-12pm

Keynote

12pm-1pm

Managing your Azure dependencies in ASP.NET Core apps using VS

Bala Chirtsabesan

Securing Applications on Intelligent Azure

Abhishek Mishra

Getting started with Blazor the Framework of Future

S Ravi Kumar

1pm-2pm

Lunch

2pm-2:45pm

Build Progressive Web Apps using Angular 9

Debasis Saha

Build and deploy to any platform using Azure DevOps

Chervine Bhiwoo

Deep Dive in Azure Service Bus

Akshay Patel

2:45pm-3:45pm

Build a Native Mobile Application using React Native and JavaScript

Joseph Guadagno

Making sense of Web Job, Web Job SDK and Functions in Azure

Prakash Tripathi

CloudFront Distribution in AWS

Viral Jain

3:45pm-4pm

Tea Break

4pm-4:30pm

Introduction to PowerBI

Aakash Maurya

Build Advanced SPFx solutions with React and Graph API

Siddharth Vaghasia

Build Business Intelligence Analyst (BIA) Skills

Sundaram Subramanian

4:30pm-5pm

Deep dive of Power Platform – AI BUILDER

Prasham Sabadra

Panel 1

What's new in SharePoint development

Vipul Jain

5pm-5:30pm

Build a SSO (Single Sign On) based Native JavaScript application with Microsoft Identity within 10 minutes

Manoj Mittal

Panel 2

Applications and working of AI

Veena Sarda

5:30pm-6pm

Deploying serverless API's with .Net core 3.0 on AWS & Azure

Amey Vartak

Panel 3

Blockchain with .NET Core (Ark)

Anshu Kumari

6pm-6:30pm

Closing Note & Prize Distribution

Dev Track

Cloud Track

Architecture Track

Emerging Tech Track

8am-9am

Registration & Breakfast

9am-10am

Creating Full-Stack Web Apps Using Server-Side Blazor

Ankit Sharma

Real time face recognition with MS Cognitive Services

Niloshima Srivastava

Building Scalable APIs with GraphQL

Jeetendra Gund

Future of development with AI and Blockchain

Navdeep Garg

10am-11am

Debugging Tips and Tricks with Visual Studio 2019

Joseph Guadagno

Azure Containers

Abhishek Kant

Enterprise Architecture

Naveen Sharma

Bot Framework - learn it fast and look like a boss!

Allen O’Neill

11am-12:30pm

Keynote

12:30pm-1:30pm

.Net Core & C# 8 Performance

David McCarter

Working with Azure kubernetes services

Ritesh Modi

Becoming an Architect

Vidyavrat Agarwal

Why Techies Need to Learn Product Management

Saurabh Jain

1:30pm-2:30pm

Lunch

2:30pm-3:30pm

Build a rules engine in .Net Core

Sanjay Vyas

Building CI and CD Pipeline using Azure DevOps

Sandeep Soni

Entity Framework Core - Tips and Tricks, Performance Optimization, and Tuning

Bassam Alugili

Hacking your way into Data Science

Sanket Verma

3:30-4:15pm

Speed up your .Net Core Website

Sourabh Somani

Azure

Magnus Mårtensson

Demystifying Open Distro for Elasticsearch

Suman Debnath

Future of Data

Shivam Ahuja

4:15pm-4:30pm

Tea Break

4:30pm-5:15pm

gRPC with C# and .Net Core

Mangesh Gaherwar

Panel 1

Essentials of Cloud security

Parveen Malik

Power platform and Dynamics 365

Deepesh Somani

5:15pm-6pm

Microservices - the gRPC Way

Viswanatha Swamy

Panel 2

Reserved

Reserved

6pm-6:30pm

Closing Note & Prize Distribution

Testing C# Code with NUnit and Moq for a Reliable Unit Layer

When software teams in Sydney, Melbourne, Brisbane, Perth, Adelaide and other Australian tech hubs ship C# applications to production, they rely on unit tests to protect core business logic. A solid unit layer catches regressions early, makes refactoring safer and shortens feedback loops. The combination of NUnit and Moq has become a familiar pairing for .NET developers across the country, partly because the pair works smoothly with Visual Studio, Rider and the command line tooling that local teams already use.

NUnit acts as the test framework that discovers, organises and executes test methods. Moq provides a lightweight mocking library that builds test doubles on the fly. Together they help isolate the system under test from databases, file systems, REST endpoints and other moving parts. For Australian developers operating under the Privacy Act 1988 and the Notifiable Data Breaches scheme, isolating external systems in unit tests is more than a stylistic preference; it is a practical way to keep personal information out of test fixtures.

This walkthrough targets engineers who already write C# code and want a repeatable method for verifying behaviour at the unit level. It assumes familiarity with Visual Studio or JetBrains Rider, basic object-oriented programming and a working knowledge of dependency injection. Every snippet uses C# 10 syntax and targets .NET 6 or later, although most examples compile unchanged on .NET Framework projects that many Adelaide government departments and Brisbane enterprise codebases still maintain.

The article is laid out so a developer can read it from top to bottom during a long flight between Perth and Sydney, then apply the same patterns the next morning. Each section builds on the previous one, mixing theory with runnable examples and finishing with notes on continuous integration for Australian build infrastructure.

Building a Reliable Unit Layer in Modern C# Projects

Australian .NET meetups such as DDD Melbourne, Adelaide .NET, Brisbane .NET and the various Sydney Code Camp events frequently feature talks on testing, and a recurring recommendation is the NUnit plus Moq pairing. NUnit has decades of maturity, supports parallel execution, parameterised tests and a fluent assertion API through its own Constraint model or third-party libraries such as FluentAssertions. Moq, maintained by the Moq team on GitHub, leans on dynamic proxy generation from Castle.Core to create implementation classes for interfaces and sealed classes with virtual members.

The two libraries are not formally tied together, but they complement each other because both follow a convention-over-configuration philosophy. A developer writes a test method, decorates it with an attribute such as [Test], and uses a Mock<T> object to substitute dependencies. This style matches how Australian engineering culture values pragmatic tools that do not require large amounts of boilerplate before delivering value.

Setting Up the Solution with the dotnet CLI

A clean solution layout speeds up review and onboarding, especially for distributed teams that span Melbourne, Canberra and remote regional towns. Many Australian consultancies structure their repositories with a src folder for production projects and a tests folder mirroring the same folder names. A typical project uses three projects: the application library, a unit test project targeting net8.0 and a separate integration test project that talks to real services.

To add the packages, the dotnet CLI is the most portable option. From the root of the repository:

dotnet add tests/Acme.Billing.Tests package NUnit
dotnet add tests/Acme.Billing.Tests package NUnit3TestAdapter
dotnet add tests/Acme.Billing.Tests package Moq
dotnet add tests/Acme.Billing.Tests package Microsoft.NET.Test.Sdk

The Microsoft.NET.Test.Sdk package supplies the VSTest discovery protocol so Visual Studio Test Explorer, Rider's unit test runner and the command line dotnet test all share the same execution path. Adding a Directory.Build.props file at the solution root helps standardise target frameworks and language versions across all teams, including contractors working from Perth or Darwin. Engineers in Adelaide offices often run tests inside Docker containers so the local environment matches the CI runner image, avoiding the classic "works on my machine" complaint that surfaces in many retrospectives.

Comparing NUnit, xUnit and MSTest Side by Side

Before settling on NUnit, it helps to compare the mainstream test frameworks available in the .NET world. The table below summarises the trade-offs that Australian engineering leads weigh during framework selection sessions:

Feature NUnit xUnit MSTest
Moq compatibility Excellent via dynamic proxy Excellent Excellent
Parallel execution by default Configurable per fixture Yes, per class Yes, per class
Test attribute style [Test] [Fact], [Theory] [TestMethod]
Fluent assertions Constraint model Assert.Equal chain Assert.AreEqual chain
Parameterised tests [TestCase] [InlineData] [DataRow]
Licence MIT Apache 2.0 MIT / EULA

For greenfield projects in Sydney and Melbourne, NUnit's Constraint model reads almost like English and pairs well with Moq's lambda expressions. For existing codebases already on MSTest, Moq still works because mocking is independent of the test framework. The deciding factor is usually the team's familiarity with assertion syntax and how easily the framework integrates with Azure DevOps pipelines hosted in Australian regions.

NUnit encourages the classic arrange-act-assert rhythm that many code reviewers expect to see in pull requests. The arrange phase sets up inputs, mocks and expected values, the act phase invokes the method under test and the assert phase checks the result. This rhythm is so familiar that Australian engineering leads often mention "the three A's" when mentoring junior developers in regional Queensland offices.

Using Moq to Isolate Dependencies

Mock objects replace real collaborators so the unit under test runs in isolation. Consider a small InvoiceService class that calculates a late fee for overdue accounts. The service depends on an IClock interface so tests can freeze time. Replacing a real DateTime.UtcNow call with a mock turns the test deterministic and protects the suite from time-of-day flakiness. Moq uses a fluent Setup chain to configure behaviour and a Verify chain to assert it.

Common Moq setup patterns seen in Australian codebases

  • Setup returning a canned value from a property or method call.
  • Throws simulating exception paths such as HttpRequestException or TaskCanceledException.
  • Callback capturing arguments passed into a method for later inspection.
  • Verify confirming a call happened exactly once, never or at least twice.

This style lets a unit test simulate a payment gateway returning a decline, an email service throwing a transient SMTP error or a repository reporting a concurrency conflict, all without hitting a real network. Banks in Sydney and Melbourne regularly mock AUSTRAC reporting endpoints so unit suites finish in seconds rather than minutes.

Verifying Behaviour Versus State

Two schools of thought compete inside Australian engineering circles: state-based testing and behaviour-based testing. State testing checks the observable output of the system under test, such as a calculated fee or a persisted entity. Behaviour testing checks that the right calls were made on collaborators in the right order. Both styles have a place.

For pure functions, state-based assertions are usually clearer. For workflow code that orchestrates external systems, behaviour checks shine. Moq supports both through its Returns, Throws and Verify APIs. The Verify method takes a Times constraint so a test can assert that an audit log was written exactly once, at least once or never.

A practical example is a NotifyCustomer method that should call an IEmailSender once with the correct subject line. The test could read:

_emailSender.Verify(s => s.Send(It.IsAny<string>(), "Payment overdue"), Times.Once);

Combining state and behaviour assertions in the same test is acceptable as long as each assertion relates to a single unit of intent. Splitting mixed concerns into separate tests keeps failures informative when a CI pipeline in an Azure region reports a red build at three in the morning.

Organising Tests with Categories and Parameters

Australian teams with large test suites adopt conventions from the broader .NET community to keep things manageable. NUnit supports several attributes that help structure tests beyond a single flat file. [Category] groups tests by feature area so a build agent can run only the smoke tests for a hot fix. [TestCase] supplies parameters so a single test method can cover many inputs. [OneTimeSetUp] and [OneTimeTearDown] handle expensive resources shared across the whole fixture.

Useful categories seen in Australian .NET projects

  • Smoke covering the critical path that runs on every commit.
  • Regression covering historical bug fixes.
  • Performance measuring throughput under load.
  • Security asserting authorisation and audit rules.

TestCase attributes help test boundary conditions. A method that validates Australian Business Numbers can use [TestCase("12345678901", ExpectedResult = true)] to confirm the checksum and [TestCase("123", ExpectedResult = false)] to reject short inputs. This style of data-driven testing is especially handy for finance teams in Sydney and Melbourne that deal with TFN, ABN and GST validation on a daily basis.

Continuous Integration and Australian Realities

Unit tests only deliver value when they run often. Australian build infrastructure spans Azure regions in Sydney and Melbourne, GitHub Actions runners hosted overseas and on-premises TeamCity servers in some banks. Pipeline configuration should run dotnet test on every pull request, publish TRX test results as build artefacts and fail the build when coverage drops below an agreed threshold.

Beyond CI, several local realities shape how unit tests are written. The Privacy Act 1988 and the Australian Privacy Principles encourage developers to avoid placing real customer data into test fixtures. Mocking identity providers, contact details and addresses is one way to comply with the Notifiable Data Breaches scheme. Australian timezone handling also matters: storing DateTime values with DateTimeKind.Utc and converting to Australian Eastern Standard Time, Australian Western Standard Time or Australian Central Standard Time only at the presentation layer avoids the famous daylight saving bug that surfaces twice a year.

Mocking time, identity and external APIs keeps unit tests fast, deterministic and compliant with local legislation. Combined with NUnit's discovery engine and a CI pipeline that runs on every push, this approach gives Australian software shops a unit layer they can trust during a long deployment window or a midnight release.

The Leela Ambience Convention Hotel

1, CBD, Maharaj Surajmal Road, Near Yamuna Sports Complex, Delhi, 110032

KNOW MORE

GENERAL QUERIES


Manish Tewatia

+91-9718-431-042

TICKET QUERIES


Atul Gupta

+91-9910-125-804