O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing our C# code

Now that we have our SQL covered, let's go back to our C# code for a bit. There is not really anything to unit test, as we have little to no business logic. It is all just selecting data and returning it to the frontend. Great for E2E tests; not so great for unit testing. So, just as in Node.js, let's create an Order.cs file and pretend we need it for invoicing later. I have created a new folder in the project root and named it Invoicing. In it, I have placed two files, Order.cs and OrderLine.cs. Both are pretty straightforward.

The OrderLine class is pretty much the same as in JavaScript, except we can work with the decimal data type which does not have rounding errors and so we do not need to round. The methods GetSubTotal ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required