✅ Help with unit testing a save function on a simple windows form app
For some reason my unit test for my save function isn't writing any text to a text file (to ensure the text actually has been saved) i'm getting the error string.empty when trying to execute the Nunit Test
13 Replies
This is my save function im trying to test
here is the test itself
heres a repo to my entire project
What string is empty
What is the full error or failure and where in your test does it point to
one moment I will post it
Which is line 72 in TestSavw
Nevermind it's the areequal call
Are you able to verify that an exception does not occur when you try to write to the file?
Have you tried debugging the test with breakpoints?
when I try to write the file it works as expected
I will try my best to show
my time spent using the debugger is minimal
it's bad I know lol
It's worth figuring out how to use the debugger
It will save you a lot of waiting for help
You can step through the code one line at a time to see what is happening
!close
Closed!