How to apply TDD / BDD methodology to create Excel files from C # using data from Oracle database

I am starting a new project where I have to create and process several Excel files based on some data in an Oracle database. I want to learn and apply TDD / BDD methodologies in this project to improve my programming habits and the project itself.

However, I'm not sure what I should do, where to start? I am looking for a guide or roadmap to make sure that I really apply these concepts properly.

What do i need to check? If I was unable to install some DI or Mock tools, do I have any code to correctly create the TDD / BDD approach?

The reason I say it may be unable to install the software is because not all software is allowed in the company.

So far I have installed nUnit. I am not sure if I need other tools or code framework / libraries.

Thanks.

+7
source share
2 answers

IMO, if you are a beginner and want to learn TDD and BDD, this may not be the best project to start with.

TDD and BDD work great when working with objects. The farther you are from objects, the more difficult it becomes, because you are dealing with external dependencies that are painful to test. A good example is both database files and Excel. While it is quite simple to create an instance of the test object, set it to a known state and check its state after some operations, the same is difficult with, say, a database: you need to either use a real database, configure its state, and write additional code to check its status (this is more an integration approach), or use Mocks, which may not be the easiest way to get started.

My advice to start with would be to focus on parts of your application that deal exclusively with objects. In this context, NUnit and Mocking, such as Moq, are pretty much sufficient.

+1
source

I would look at mspec libraries through NuGet.

+1
source

All Articles