Well, if I searchfor a numberotherthan 42, soforexample, somecompletegibberishlongnumber, whichdoesn't haveanyentryinthenumbersAPIandsearchforthat, youcanseethatfoundisfalse, butwestillobtainsomekindof a reasonableresponsethatthisisanuninterestingnumber.
While I willnotpretendthat I amsomefunctionalprogrammingpro, atleastnotyet, youdon't needtoknowanyreallyadvancedstuffabouteithertype, whichis a functionalprogrammingconcept, willallowustoreturneithernumbertriviaorfailure, whichwearegoingtocreatenext.
Soforthat, touseequitableinthisabstractbaseclass, wehavetohave a constructorhere, whichwillaccept a listofproperties, whichwillequalconstdynamic, whichwillbeanemptylist.
Thenasyouhopefullyrememberfromthelastpart, andasissignifiedbythisdiagramhere, a repositoryfromwhich a usecasegetsitsdataisbothinsidethedomainlayerandinsidethedatalayeraswellatthesametime.
Ortobemoreprecise, thedefinitionof a repository, oraswearegoingtocallit, a repository's contractispresentinthedomainlayer.
Andtopassthismockedversionof a repositoryintothenownotyetexistentusecase, wearegoingtouse a methodcalledsetup, whichisavailableforeverytestthatyouwriteinDart.
Andifyoudon't wanttomissthenextpartandalsomoretutorialslikethis, definitelysubscribetothischannelandalsojointhenotificationsquadbyhittingthebellbuttontomakesureyougrowyourFluttercodingskillsbecausehereonResoCoder, I amdeterminedtoprovideyouwiththebestappdevelopmenttutorialsandresourcesoutthere.
Ifthisvideohelpedyouwithunderstandingatleastjust a bittest-drivendevelopmentprocess, anddonotworry, wearegoingtowritemany, manymoreteststhroughoutthisseries.
Givethisvideo a likeandalsoshareitwithourdeveloperswhowillsurelybenefitfromitaswell.
Leave a commentifyouhaveanythingtosay, anyquestionsregardingthistest-drivendevelopment, I willtrytoanswerthemtomybestability.
FollowmeonInstagram, I gounderthenameResoCodereverywheresothatyougetsomebehind-the-scenesnewsfromwhat I amcurrentlydoing, andseeyouinthenextvideo.