Bonjour hi this is a recorded version of a
live session from twitch it will be a very long video and that’s why I put
timestamps in the description so you could skip and go directly to the part
that interests you if you want to know exactly when I’m streaming go visit but for now let’s watch this session Bonjour hi welcome to the stream I’m Frank
Boucher your host and today it’s a very special
stream because it’s my longest streams ever so if you’re watching it uh-hum on
the archive on YouTube it will probably be two streams so the first part will be
right now so part one of you will be having unit tests in the project blind
2021 my text-based adventure game and then a wall for our next segment so part
two will be with Ted and I will be refactoring adding dependency injection
and the project and things like that so very interesting so four hours of things
that’s my plan will I be enough will have well I’ll be able to do it I don’t
know but we’ll try it so let’s cut that team put back some music let me know if
them music is too loud it may be too loud I don’t know is it let me run a
test it sounds ok let me know if in the chat if it’s too loud or I will change
it okay so I have way too many stuff open so I’m having a task so let me
quickly introduce if it’s your first time let’s take two
seconds to introduce the project the channel and things like that so I’m a
cloud advocate I work at Microsoft and on Friday every Friday I try to stream
and for me it’s my it’s my my treats I’m working on a project it’s a text-based
adventure game it’s in get up so here it is I think it’s too loud the music I’m
not sure let’s this way maybe won’t be better so the
project is in github it’s open to collaboration the project name in github
is Project Dover because it was created by Kevin Griffin’s and then I totally I
Jack his project and but I think he’s happy because it doesn’t have time to
work on it right now so the like I do all the work in my
session and when we’re done with a feature I do a PR and most of the time
it’s merged in the same day or so so we are working like we have a working game
right now and I have a call for creators so if you are if you would like to get
in I have right now a task I have multiple tasks that are available here
or also you can have a look in my go board so that’s the game so with a fancy
ASCII art that’s what the game looks like if you want to contribute you can
have a look to the glow board or the issue if you prefer sting in get up but
let me show you the the glow board since I will be working I want you to know oh
and I’m not sharing my stream my screen so let’s do let’s do fullscreen just
like that so better this way so let’s start again
so this is the get up that’s what’s the game look like with some art and stuff
like that pretty cool and now here you have the glow board or the issue page if
you open the glow board you will land on this page here and right now there’s a
add floorplan you can also I thought I had I thought I created that task for that
oh here know create your map yeah why it’s done it’s not done so that’s the task here it’s creating
from the room Jason that you have a file here that you can check or if you want
to if you prefer you can have it if you do clone this environment you will have
it in data so in the folder data you create a sub folder with the name of
your map and then you use the room that Jason as a template to create your map
so it’s kind of hopefully that makes sense so you have rooms rooms have exits
they have items name description and things like that no I don’t download it
already have it yeah so let me show you briefly the game what it look like and
then well today we’ll had unit tests our I’m planning to add unit tests using X
unit just few so on the next segment when Ted will be joining us we’ll be
able to have some stuff to create a dependency injection and like
restructure a little bit the code because since the beginning and I think
that’s that’s good I mean let’s open a new window so that’s the code right now
and I’m working and I have that question that come hey hello DVD gamer how are
you I hope you have a great holiday so I think it’s the first time I see you in
fact I learned a little bit your stream yesterday but yeah for me was late so I
was just like 10 minutes maybe so I didn’t say anything and just you know
watch you but yeah I hope you had a great holiday as always saying I’m
running right now in Visual Studio code because when I start coding this and I
want a game to be portable as much as I can right now I am running
on a Windows machine but I tend to work on a Linux machine so that’s why I’m
using Visual Studio code but everything is working also from Visual Studio IDE
the big visual studio event like in fact we’ll probably try it today when because
I want to try the new feature of visual talk 2019 and I forgot which version it
is I think three they had some feature in it for the unit tests to visualize
and things like that so I wanna see those so once I will have unit test then
I will you know open it and Visual Studio see if it worked of course and so yeah so let’s run the
game quickly see how things are working that’s running just f5 hopefully work
from from the first try I did work last time on a different PC so I’m not sure
if everything will be working and apparently yes so excellent because when
I try to run it from Visual Studio IDE I did some tests before and I know that
path of the images or stuff like that are not the same so we’ll need to fix
that so yeah so right now oh there’s one thing I didn’t do it
about we don’t need right now to have it but so yeah so you could start a new
game that will load the file right now so right now we have if I open let’s go
back here and just open from reveal from explorer I have a data folder and inside
those are or map right now I only have one in its
Bradley’s house and inside I have only one file name rooms that Jason if you
want you can create your own map you can do a PR if it’s like if you come like if
it I can load it I will hide it that’s for sure and the rule is just create a
sub folder with the name of your of course it must be friendly name and like
everything friendly name inside your map but name the folder the subfolder the
name of your map and then add the rooms that Jason or whatever filed a Jason
respecting that template and and yeah and it will be adding it so the load
save game are coming from the database right now the database is a MongoDB and
because I didn’t want to install Mongo and also because I’m always moving from
one part of the other I’m running Mongo in a docker container but I didn’t start
the hunker for my stream but I don’t think we need it today for the kind of
work we’re doing though we could have load testing the load of from a savegame
but yeah I don’t intend to do a 100% code coverage today so let’s just start
it so we’ll do one whoops one to start and then that’s a few feature I had it
since our last chain so now you have a kind of a quick very brief character
creation so here how can I call you you could say princess Captain Frank
whatever you want and then the game will use that as a name so for me let’s use
Frank and it also need to be unique because when will be and like that right
now it doesn’t and doesn’t have any validation but eventually will
to have some kind of validation because right now the name you have that’s how I
reached I found back your savegame meaning that if because I want that
gained eventually to be Oh stood somewhere in Azure and you can just play
so of course like you know if you’re running locally then there’s no problem
with that but when you’re online so eventually we’ll need to add some
validation there so happy to have you with us Frank
now let’s get started so outside Brad is how spread is in a single love home
there’s even trees and flowers on your left there’s there was a truck on some
blocks and now there’s only one exit and it’s north so you could type north or if
you’re super lazy and you don’t want to do any typos like I just did you can
type N and that works so now we are inside the house so we have three exit
south east west and now if I go south again then notice that and is it big
enough let me you know what make it bigger this way I think that’s better
right yeah and I need to I think to switch my my flip my screen I know it
so not is that now we don’t see the full description because we already saw that
room that’s a big room outside with very high ceiling
sorry so that’s kind of convenient it only shows the description once but if
we want to see more we can say a look and now it tells us again the
description great so now let’s go east and now here we like we see that it’s a
nice cozy living room on the north wall there’s a mirror mirror was my intention
to do the character creation at that time but then I was having a problem at
the beginning where I needed some kind of unique something to save the game
that’s why I has they this like that then at the beginning so I’m not sure
how we’ll be doing it and of course maybe you are somewhere likely I don’t
know like in the cavern you won’t have any mirror like if you create a map so
that’s why I let go that idea where like using a mirror to look at you and you
know so like you see yourself anyway and now we in the we can see that and
there’s a flashlight on table the middle of the room so now you can take the
flashlight if I type correctly will work flashlight and now the flashlight goes
in my inventory so if I do inventory to re now I see the players inventory
contain flashlight oh why it’s player should be Frank inventory hmm and the
living room has no inventory so that’s cool and now another thing also I add
was the status so it for summary so if you type X I think yes so there’s your
summary around the game there’s key event that are triggered finding the
flashlight was one its 100% comfortable in the map so when you ask the summary
it will list you the key event and that was in planning for when will a day I
wear the AI will you know make sense of all those key events and also we have a
map coverage so here I have 75% of the map I saw
the game coverage is the map coverage I will be interesting to have a game
coverage but that I think it’s a feature that could be later like way much later
we need to have more more fun stuff before and that’s it and of course you
could say save to save your game I won’t do that because it will fail because I
don’t have any database right now and what else I can show you I think that’s
it of course you can quit there it is that’s the game Oh TBD does the music is
too loud let me know because I change today’s music is coming from music bed
and yeah usually I stream the music but today I have it locally and I think it
will help me when I’m running from hotel with like limited Wi-Fi so trying to
find another solution and of course since I upload an archive all my session
I don’t want any license trouble so I found that service okay cool perfect oh you can’t you can’t
hear the music okay perfect then maybe it’s only for me then she’ll be
very well very very low okay so we need to add unit tests so I added an
extension in provision of that and it’s the dotnet Core tests Explorer so I
never use that extension so that will be interesting to see all or test and I’m
wondering if I add the tests from the S code or from visuals Jodi I think I will
try to do it from via exhausts your code and see if it loads in Visual Studio IDE
so will be kind of fun I think so right now I’m in the project though so I need
to go up a level so we’ll close this folder and whoa is it no I think I was for the door yeah I
wasn’t the good folder yeah rainy is Hugh okay cool so no I want the terminal a problem is right now everything is at
the root so maybe I should move first this project in a subfolder let’s create new that the feature a Refik I need to shut down this so I kept a few
alarms and notification on because just in case
Ted has tried to reach me I want to be sure I can hear him
yeah so feature unit test should be good and that will be come from Ed’s
excellent so I think I think I’m on a folder SRC for the source
so then we’ll structure everything so let’s do that
as our SRC and now in Dade bench oh yeah bins okay that should move to inside SRC Roo
manager this this is this this package Microsoft brought Deb let’s bring it no
not licensed this yes yes yes all the classes contributing say their classes
classes this not sure what’s note that MD is but it’s a markdown so that’s all
those files shouldn’t be moving there so what’s note oh oh that was probably the
notes from Kevin I don’t know is me talk to Bob okay cool
that could stay there this will stay at the root so all those stay at the roots
excellent so now if I go and SRC now I should have only the solution and
the project should be in a folder I think should rename the project at the same
time why can’t so new folder that’s project over saw everything except the
solution should move in and of course the project itself now here I think okay can it’s so-so project over can
still run if I just try it five does it worked
oh yeah the vs code oops project over so vs code I’m busting everything expect problem
soon so I think those two folder should move here and I think I will need if I try to run
this right now because I’m at the recruit right just thinking where I should put that
you know that’s now like the full reef the full thing so it makes sense I can’t
get it in the vs code though like it won’t compile so if I open just the
sub-project that’s what it is right here so that will make more sense
and I’m expecting to be able to run it of course it doesn’t because it doesn’t
find a project so I’ll go in vs code here and add the information so let’s
move I think here so now we are just in the code project what so workspace folder what’s my workspace
folder should I keep it this way then because when I start the bug it’s the lounge so it’s that one what’s my workspace right now is it so I thought that would work but it
didn’t right so let’s try again I was the year I think it was trying but unable to open able to read the file so he’s looking for a program that’s yes
but the path here is wrong like here but where that’s come from maybe projects
the CS brush file let’s have a look again solution why do you take that path that’s only colors Oh do I still have
some I need to close them maybe so they
completely refresh that’s reopened from here so now I am an SRC if I do the net build
what happened so the build worked works if I run know okay yes oh there’s CSP art ya know and if I try to do it
this way No I did that many times why it’s not
working now that net whoops whoops keep that net run
and then should I or pass the path project I need to funny little exception could not find
the part okay that’s why ad but the error had no SRC media oh that’s oh yeah okay so that works now yeah so workspace it’s the open thing so
why it’s not working Oh unable to read the file or is it maybe
that message is wrong if I go in programs let’s just put this in comments right
now can I go like is it that file yeah okay so it was just the error
message cool it’s still working yeah great okay okay so now let’s have a look
just push this thing so what we did so everything moving source via scope
project over data media so I think I will push that right now say like moving
moving to project folder well stage everything great so now so now let’s add our unit test right
that’s what we are in for let’s clear this so now what I want to do is dot now
and it’s been a while so I have some documentation on the side but I will try
to do it by memory so I want to turn it new and it’s X unit the output not zero
oh the output will be you know will be project or its name name project go over
that test I think that’s what I want or yeah cool so now I want to add a reference to this
thing and that I’m not sure it’s something
like I read it but it’s that whoops that yeah and and it’s s Ellen or is it SMN and this I got it yeah excellent so now if I compile if I’ve
from the root if I do it that net build should build the two projects yeah yeah
there’s nothing in it yet but cool excellent so okay okay so now if I did
everything correctly I could open the project in July
ah before we go too far let’s let’s see if if it worked in if it’s working in
Visual Studio IDE so I should be able to from here double click on that or I
should close just in case that’s my I did close everything else yeah and I
missed the pop-up I had to pop up what’s the pop-up saying okay should I have a drumroll cool the two projects are loaded excellent okay so let’s run for a while
in this project let’s try let’s see what kind of thing a command parser command parser tester
yeah let’s let’s do that command parser tester so let’s run test
about this I have no test run tests like there is no test right unit deaths yeah okay cool
so I wanna take the name and that will be or let’s try to quit more I’m not sure if I should initialize at
the beginning it’s been so long how can let’s have a look at a few things here
I did some unit debt so fact this is prime this prime should
it’s all about also the naming and stuff that I’m not sure is prime input return
false so Prime service is a thing so instead of command parser test it
should be command posture should okay let’s try to do that rename so should return quit if I do buy the
let’s say parser and of course I will need to add the reference build dependencies yeah project
dependencies project over why why why why no I are you nuts
adjusting Oh I don’t understand why it’s not change
coming parser to blah blah blah No oh there is no okay
there is no build that dependency or should I put the build let’s keep it
that way there it is okay no it’s working okay so
now if I do parser this and I pass quit so I should do something like assert should I test both like yeah I should
write testing quit and Q like the short yeah the cert equal expected expected I’m expected and come in type come in quit I’m not sure of the naming of stuff but solook work quit didn’t work I think I will do a parser thing here
look I’m trying to to look at the
documentation here and it says you know like the this and then its prime service
is prime should hey thanks for the following sergeant be
payable be welcome welcome we are working on unit tests in core
and it’s been a while I’ve been a bad boy I’ve been dying that lets do is comment parser uh-huh okay now I understand okay it’s
the constructor of the thing okay so now it’s seemed departures and
departures and departure oops okay so quit didn’t work not sure why but actual unknown because I don’t okay Ivan but it’s
working I didn’t put the one letter so I should let’s add it right now you know what nope because I don’t want
to quit by accident let’s add a note so nobody had it so in fact I should test so equal unknown is prime input blah blah blah return
false it’s kind of long door so east west and south follow you w East your quiet chat today your quiet so
let’s add a few others so let’s do quit one did I Oh
exit I won’t exit it was exert if the input is exit should
return an end all so if exit or exit there is let’s do a unknown if you are known why it’s going well yeah no problem
I’m here for a while today so it’s a two two hours stream so no problem TBD see
you later maybe or another way another day so please manage Oh okay so let’s try nut t then let’s say I
don’t know are just one of a few of those can I just run this one so now let’s let’s run the take because
that will be interesting so take so just T egg or T should return why I was uh you know what I will I need a bio
break and I will refill my water so we’ll run an ad and I will be right back
well like probably a little bit after the ad but hello yeah so you need tests
okay so take now we need to take something but that will be interesting
so take a poll take phone oh yeah unknown sohcahtoa it should be I never tried to so split yeah shit shouldn’t work so it fell again same line so T phone
doesn’t work it’s returned unknown okay let’s let’s debug Oh that’s a problem it’s not equal to T it’s wonderful
I found bug adding test look like it’s working unit tests are useful you can
clip that look like it’s really working okay so how hmm
start with T space does it make sense 105 as I should trim it I think I won’t like I should trap those let’s move dis like that okay so now I’ve I have a few parts
thing it’s not perfect but I have this so let’s try to add another thing game
session I could do a lot of stuff with game session right and then Tory let’s do an inventory test vote my personal approach will be to split
the component first then have command Pat part the first cinnamon and then
argument all you mean for the unit test of the take something yeah like I just
want to have some unit test but obviously the tests here are kind of
dummy like like all the others make sense this tests here like need to
be smarter right now like it’s kind of yeah yeah it is it’s just a parser so it’s kind of
stupid I just want to have some tests so for the next part I will have some meat
to structure doing dependency injection and stuff and I don’t want to do too
much because once we start doing interfaces and stuff like that it will
be easier to test and mock and do things but so right now I just want a few
little little things but let’s try to do an inventory test so let’s come here I
forgot how to do it nope like this how do you add a new class and it will be inventory okay so now let’s close those to save
this open inventory the point of today TV gamer was to structure the code
because since the beginning I was focusing just to add features so it’s
all in the same folder so I want to add folder services and do dependency
injection and and that and I reached out to the life coder maybe you saw my my
question and the discord and tad suggests oh yeah we’ll help you and he
told me oh you know what just have few tests so we could you know start working
on that so that’s why I’m doing right now just to have some tests
of course the test should be a little bit more like right now it’s kind of
code coverage unit tests and it’s stupid but it’s the easiest one to do yeah
like unit tests should be more like business or like flow and my mind is
business like what it should be doing but you know so by default since this is room items
let’s try to check so let’s add a test public and all I was fact how can I add
like I don’t have would like to have a ate
add a new test create you notice I am in a test project Krieg unit is supported only in a non
project Oh what can I oh that’s cool it opened this I won’t exceed it for the solution really okay right-click on the project that will
contain the Union text okay yeah that’s why I wanna add it for the full solution
does it make any difference okay I’m here now if I do creating a
test that’s fine you know what I just want to
create a few things so it’s just fact and whatever okay oh okay let’s try to add something I made sense
remove item add item add item I will be interesting to capture the
console also so inventory add I am should oh there’s our friends so an item should you know what I will
take few seconds to do the setup with Ted and I will get back to you just
after so see you soon you

Leave a Reply

Your email address will not be published. Required fields are marked *