REMEMBER
REMEMBER
>> CalculatorInput.cs
- so here i jsut change this from array to a list where all inputdata are stored
here. i change it to list because with list i dont need
to specify the size and just add and add to the list. because do not now how
many the user will input
>> CalculatorManager.cs
- so here I change the foreach to aggregate. Aggregate is already existing in
c#
- aggregate is a function for list. which accept callback
- Callback - is like a parameter but accept another function that will be
executed by aggregate function
- i, j = yung aggregate function tumatangap sya ng call back function na may
parameters na i and j
- so what the code does is add the values of i and j
CONFIDENTIAL & RESTRICTED
>> Openfiles.ca
- next lets go here in openfile class
- so here this just read the context of the file as a string
- then it created an instance of calculatorinput
- then this converted the json file. the
- json file is converted to object and assign to the calculator input
- then return the calculate input
- for this. i created another method which
can write the obje and convert it to json.
- then save it to file
- yung mga nainput ko dito mapupunta
>>UNIT TEST
- here input will be stored
- since inputdata array we store all inputs. we passed new instance inputdata
because inputdata array are list of inputdata
- para magkapag store ng value kay inputdata we need to pass a new instance
of input data. kaya nag pasa lng here ng new input data
- kaya need magpasa kasi hindi makakapag store ng number or operation
kung walang instance ng input data sa loob ng list ng inputdata
- here we access the new instance by index 0 then add the operation +
- this is the input numbers
- yung ni read ko
- inputData.Numbers this is variable pwede yung operation and numbers
mismo or yung variable na lng