I started getting more familiar with EF Core, although I don’t fully understand everything, I am able to grasp the main idea of how EF Core works, because I helped a friend who is doing his internship as well and was asked to use EF Core and had no idea how to use it. So, I was able to guide here and there which shows that I did learn something about EF Core after all.
If you find difficulties in understanding what I’m about to discuss refer to my previous blog by clicking on this link before proceeding https://www.tonghin.com.my/blog/2021/03/04/entity-framework-core-week/.
I finally have a better understanding of how tests work, and how to write a unit test in general.
A unit test compromises of 3 sections. Firstly, the arrange part which sets the environment for the test components. Next, act initiates the test or does the testing. Lastly, assert validates and verifies the result we expect to get by comparing our expected value to the value retrieved from the act section.
Last week, I wrote around 7 tests with the help of my supervisor, who guides me when I don’t understand or get stuck at one point or another.
Among the widely used assert extensions are First( ), Select( ) and Where( ). More information can be read from the below link https://www.tutorialsteacher.com/linq/what-is-linq.
The concept of Rollback( ), Commit( ) and Complete( ) in a transaction is among the things that I have been exposed to as well, whereby rollback undoes changes that have been committed into the database. Commit on the other hand, saves changes into the database, while complete saves the transaction, it does not update the database if commit was not initiated, as well as if complete was not written in the codes, updates that have been made wont be saved even during debugging of codes.
The keyword using in C# is used to ensure that the method dispose( ) is called after a method has been called, or or an object has been created and many other things. Dispose( ) is used to release unmanaged resources, but it does not free a managed memory.
That’s all for this week 🙂
