Heyyyy, it’s me again and this week, I’ve come with new things to share with you all!
Well, I would say that my performance this week was way better than last week. Just imagine, during the first week, when I used to look at the pile of codes and scroll through them, my head spins and I start seeing things in two, hahahahaha, okay I’m exaggerating, but honestly, it was so much to swallow and understand especially with the fact that this is my first time to literally get exposed to these things, everything is brand new to me.
Firstly, I tried to use input binding in resource dictionary but still couldn’t do it, because the problem was raising from the data context, the resource dictionary was not able to get access to the data context of the file which contains the definition of the commands. Then, I tried using the data context concept but still no success. So, I asked my supervisor to move on, yes I did told him that, because I was already losing interest in doing the same thing over and over again. So, I was asked to write a test for the Escape key, well I would say that I only managed to do 50% of the task, I also learnt the difference between Setup and Verify when using Moqs.
Before having a look at the difference between Setup and Verify, a simple definition that can be given to Moqs is that they are objects which mimic or copy the behavior of a class or an interface and allows methods in the test to interact with them as if they were real. Hence, Setups are usually associated with the fact that we set a method and invoke a return that we expect to be returned when the method has been set up or initiated. On the other hand, verify deals with the concept of ensuring that a certain method gets invoked when the requirements are fulfilled, such that we want to verify that when method A is invoked B should be returned, if B is not returned hence our test fails. Unfortunately, the test I wrote was only for checking whether the command gets executed or not, but not whether the escape key was pressed, because the definition of the key was written in the .xaml file not the .cs file.
Next, I was given a new task, in which I had to create a module for invoices which is related to a system being created. I’ve also updated my dictionary of definitions, so initially I had the idea that data context meant giving access to the data in other classes when in reality it means a network connection created among data points in files. I have also learnt that the .sample files extension in projects are not supposed to be deleted but to be kept and used for references.
Lastly, I have also created tests to test the data being saved into the database. Basically, the tests I wrote were to ensure that the data types assigned to each attribute is correct and is the data type required, meaning a test method is written to check whether the attribute name is assigned a string data type, if the name is not assigned to string then the test fails, because the actual and expected data types are not the same.
Basically, that’s a summary of all what I did, see you all again next week. Make sure you read my upcoming blog, which is surely to be filled with new things to learn 🙂
