Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building Microservices with .NET Core

You're reading from  Building Microservices with .NET Core

Product type Book
Published in Jun 2017
Publisher Packt
ISBN-13 9781785887833
Pages 274 pages
Edition 1st Edition
Languages
Authors (3):
Gaurav Aroraa Gaurav Aroraa
Profile icon Gaurav Aroraa
Lalit Kale Lalit Kale
Profile icon Lalit Kale
Manish Kanwar Manish Kanwar
Profile icon Manish Kanwar
View More author details

Table of Contents (10) Chapters

1. What Are Microservices? 2. Building Microservices 3. Integration Techniques 4. Testing Strategies 5. Deployment 6. Security 7. Monitoring 8. Scaling 9. Reactive Microservices 10. Creating a Complete Microservice Solution

Tests in action


Until now, we have discussed test strategies and various types of microservice tests. We've also discussed how to test and what to test. In this section, we will see tests in action; we will implement tests with the use of:

  • Visual Studio 2017 RC or later
  • .NET Core
  • ASP.NET Core API
  • xUnit and MS tests
  • The Moq framework 

 Getting ready with the test project

We will test our microservice application: FlixOne bookstore. With the help of code examples, we will see how to perform unit tests, stubbing, and mocking.

Note

We created the FlixOne bookstore application in Chapter 2, Building Microservices.

Before we start writing tests, we should set up a test project in our existing application. There are a few simple steps we can take with this test project setup:

  • Using Visual Studio, add a new .NET Core (class library) project to your existing solution
  • You can alternatively use the cli command to add the new project--open the bash command or the Visual Studio command prompt and execute dotnet...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}