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
Registration & Breakfast
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
Managing Cloud Storage Accounts using Logic Apps
Viknaraj Manogararajah
Data visualization using Python
Sekhar Srinivasan
Going Cross platform with AR Foundation
Vivek Sharma
Keynote
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
Lunch
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
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
Tea Break
Introduction to PowerBI
Aakash Maurya
Build Advanced SPFx solutions with React and Graph API
Siddharth Vaghasia
Build Business Intelligence Analyst (BIA) Skills
Sundaram Subramanian
Deep dive of Power Platform – AI BUILDER
Prasham Sabadra
Panel 1
What's new in SharePoint development
Vipul Jain
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
Deploying serverless API's with .Net core 3.0 on AWS & Azure
Amey Vartak
Panel 3
Blockchain with .NET Core (Ark)
Anshu Kumari
Closing Note & Prize Distribution
Dev Track
Cloud Track
Architecture Track
Emerging Tech Track
Registration & Breakfast
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
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
Keynote
.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
Lunch
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
Speed up your .Net Core Website
Sourabh Somani
Azure
Magnus Mårtensson
Demystifying Open Distro for Elasticsearch
Suman Debnath
Future of Data
Shivam Ahuja
Tea Break
gRPC with C# and .Net Core
Mangesh Gaherwar
Panel 1
Essentials of Cloud security
Parveen Malik
Power platform and Dynamics 365
Deepesh Somani
Microservices - the gRPC Way
Viswanatha Swamy
Panel 2
Reserved
Reserved
Closing Note & Prize Distribution
Building readable C# tests with FluentAssertions
The cloud, data and DevOps sessions at C# Corner Annual Conference 2020 address systems at scale, but unit tests remain the quietest layer of software delivery. They also carry much of the burden of preventing regressions. When an assertion merely says that two values differ, a developer must reconstruct the intended behaviour, inspect the fixture and decide whether the test or implementation is wrong. Clear C# unit tests reduce that cost by expressing expectations in readable domain language.
FluentAssertions is a C# assertion library that gives tests a fluent API over expected results. Instead of separating the subject, condition and message across framework-specific methods, a developer can express an outcome as a sentence: a value should be greater than zero, a collection should contain one matching item, or an operation should throw a particular exception. Its failure output exposes the assertion chain that failed, making diagnosis faster and test intent easier to review.
These benefits matter across Australia’s technology market. Sydney’s banking and fintech employers, Melbourne’s sizeable software and cloud consulting sector, and Brisbane’s government technology projects all rely on Microsoft platforms and disciplined change controls. Australian teams handling personal information must also account for the Privacy Act 1988 and the Australian Privacy Principles. Tests built with synthetic customer records and explicit privacy-sensitive expectations support those obligations without turning every unit test into a compliance exercise.
Why readable assertions matter
Readable assertions are a form of executable documentation. A test named Expired_token_is_rejected already communicates part of the expected behaviour, while a chain such as token.IsExpired.Should().BeTrue() makes the remaining expectation immediately visible. This is especially useful when a developer reviews a failure without knowing the history of the feature. The code answers what should have happened, not merely which method returned an unexpected result.
Failure messages determine how quickly a team can respond to a broken build. A raw mismatch between false and true offers little context. A stronger message identifies the subject, expected condition and relevant values. FluentAssertions builds that context into many common assertions, producing diagnostics that show which part of a chained expectation failed. The result is less time spent reading stack traces and more time correcting the faulty logic.
Readable does not mean verbose. Assertions should still describe observable behaviour rather than private implementation details. Repeating every property of a complex object can obscure the reason for the test and make refactoring unnecessarily difficult. The best C# unit tests use a small number of precise assertions, arranged so their meaning remains obvious to another developer.
Designing expressive assertion chains
The basic FluentAssertions pattern starts with the subject and applies Should() followed by the expected outcome. This creates a consistent vocabulary across a test suite and removes the need to remember the argument order of several framework assertion methods.
using FluentAssertions;
[Fact]
public void Apply_discount_uses_the_gold_customer_rate()
{
var quote = QuoteBuilder.For(CustomerTier.Gold).Build();
quote.Discount.Should().Be(0.20m);
}
Chaining becomes valuable when an expectation has more than one level. Null checks can flow directly into assertions about a returned object, while collection assertions can narrow the result before examining an item. This style keeps related information together and reduces intermediate variables that exist only to support the test.
var result = await repository.GetAsync(orderId);
result.Should().NotBeNull()
.Which.Total.Should().BeGreaterThan(0);
Precision matters when several assertions could appear to cover the same behaviour. Type-specific checks are generally preferable to generic equality when they express the actual contract. FluentAssertions provides assertions for strings, numbers, dates, enumerables, exceptions and many other common subjects, allowing each expectation to use terminology suited to its data.
action.Should().Throw<InvalidOperationException>()
.WithMessage("*approved*");
A short reason can be included when the expected value would otherwise be ambiguous. It should explain a domain rule rather than restate the assertion. “Discounts must use the agreed rate” provides useful context; “the test failed” does not. Care is needed with exception-message assertions because wording changes can create brittle tests. Matching a stable fragment or checking a structured error code may be more durable.
AssertionScope is useful when several properties describe one outcome and the developer wants to see every mismatch in a single run. Grouping related checks can expose multiple regressions without repeatedly executing the test.
using (new AssertionScope())
{
quote.Total.Should().Be(1250m);
quote.Currency.Should().Be("AUD");
}
Using FluentAssertions across .NET test frameworks
FluentAssertions complements xUnit, NUnit and MSTest rather than replacing their runners, discovery mechanisms or lifecycle features. A team can introduce its assertion style while retaining the framework that already handles fixtures, parallel execution and test reporting. This makes gradual adoption practical for established .NET solutions, including legacy applications that cannot change every test at once.
Test structure still determines readability. A clear arrange, act and assert sequence helps the fluent syntax communicate intent. Arrange the smallest fixture needed for the scenario, perform one meaningful action and assert the resulting behaviour. Repeated setup across many tests can move into a builder or factory, but overly abstract fixture builders can hide important conditions. The test should remain understandable when read independently.
FluentAssertions also helps keep asynchronous and validation scenarios expressive. An awaited operation can be assigned to a named result before assertions begin, while argument-validation tests can state the required exception and message fragment directly. Avoid mixing await calls into a long assertion chain, since doing so makes failures harder to locate and can complicate exception handling.
For data-intensive Australian systems, assertion tests should use synthetic or de-identified records whenever personal information could appear in diagnostics. Clear failure messages are valuable only when they remain safe to store in build logs. Replacing names, addresses and account identifiers with plausible test values preserves readability while avoiding unnecessary exposure under privacy and security controls.
Comparing built-in and fluent assertion styles
Built-in framework assertions remain suitable for small, straightforward tests. They require no additional package and provide direct access to functions such as Assert.Equal, Assert.True and Assert.Single. Their limitations become more noticeable in suites with domain-specific conditions, nested collections or repeated validation messages, where the framework’s method signatures can look disconnected from the expected behaviour.
A mixed approach can work well, especially during migration. Existing tests may continue using their original framework assertions while new tests adopt a consistent FluentAssertions style. Over time, teams can replace individual assertions when they touch the relevant code. A hybrid suite is easier to improve than an arbitrary mixture, so the chosen convention should be documented in the repository’s testing guidance.
| Concern | xUnit built-in assertions | FluentAssertions |
|---|---|---|
| Core syntax | Separate methods such as Assert.Equal and Assert.True |
Subject-first chains beginning with Should() |
| Failure context | Usually reports expected and actual values | Adds the subject and identifies the failed part of the chain |
| Collection checks | Uses methods such as Assert.Single and Assert.Contains |
Supports expressive assertions such as ContainSingle and OnlyContain |
| Dependencies | Included with the xUnit framework | Requires a separate package with a pinned version |
| Best fit | Small tests with simple expectations | Larger suites needing domain language and detailed diagnostics |
Practices that keep C# assertions maintainable
Readable assertions are a team convention rather than a one-off formatting choice. The strongest suites use the same vocabulary, meaningful test names and predictable fixture patterns. Code review can then focus on whether the expected behaviour is correct, rather than debating several ways to phrase the same assertion.
Dependency decisions deserve the same attention as production libraries. Pinning the FluentAssertions version gives builds reproducibility, while checking its licence against the organisation’s commercial-use policy avoids procurement surprises. Teams should also test upgrades against their supported .NET versions before adopting them across a large suite.
- Keep each test focused on one observable behaviour, grouping closely related assertions with
AssertionScopewhen multiple failures would be useful. - Name tests and assertions around business outcomes so a failed test communicates the expected rule without requiring implementation knowledge.
- Prefer the most specific assertion available, such as type, range, collection membership or exception checks, instead of general object equivalence.
- Build deterministic fixtures with synthetic data, and keep environment-specific behaviour behind injected dependencies so unit tests remain fast and portable.
- Pin the FluentAssertions package version, review its commercial-use licence and verify each upgrade against the solution’s target .NET frameworks.
1, CBD, Maharaj Surajmal Road, Near Yamuna Sports Complex, Delhi, 110032
GENERAL QUERIES
Manish Tewatia
manish@csharpcon.com
+91-9718-431-042
TICKET QUERIES
Atul Gupta
conference@csharpcon.com
+91-9910-125-804