Problem using class libraries in Unit tests
For a school project I need to use Unit tests in my project, however when I add the unit test project, I can not use the classes from a different class library.
I have set up the dependencies, so I dont know what I should do.
19 Replies
show your solution structure
and the dependencies for the test lib
I would suggest you structure it like this instead
do you mean in a different solution?
no, same solution
in terms of actual file structure on disk, it would be...
Ok I will try to do this
however, you shouldnt be having the problems you say you are
so there is something wrong
what .NET version are you using? Is it the same for test project and class libs?
i think 8.0
but here it says 4.8
but when i try to change it, i can not select 8.0
yeah thats your problem
.NET Framework isnt the same thing as just .NET
you need to delete your test project and create it from scratch with a .NET version, not a framework version
I highly recommend using xUnit
$newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
so this one is fine?
again, I highly recommend xunit
it has the most logical way of working, imho
YESSS IT WORKSS
thank youuu
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View