-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Needs Unit Tests #4
Comments
An xunit test class library has been added. However the services, contexts and helpers need to be mocked to ensure that we are properly testing everything |
Add unit tests for db model to view model mappers (i.e BookViewModelHelper) Example:
|
Since I've moved this project to .NET core 2.1 (2.1.301), the xunit test runner no longer runs. It quits out with an error:
This is a known issue and has been reported on the xunit repo. There is currently a work around by using the latest build from MyGet. I've TEMPORARILY gotten around this by including: <RuntimeFrameworkVersion>2.1.0-rc1</RuntimeFrameworkVersion> in the jay@Omoikane:~$ dotnet --list-sdks
2.1.300-rc1-008673 [/usr/share/dotnet/sdk]
2.1.301 [/usr/share/dotnet/sdk]
jay@Omoikane:~$ dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.0-rc1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Doing this allows all unit tests to be run (until a new build of xunit is released to NuGet) |
Using the xUnit.NET Test template (
dotnet new xunit
) add unit tests for the source code in thesrc
directory.Add the xUnit.NET test library to a directory at the root level (i.e. alongside the
src
directory) calledtests
The text was updated successfully, but these errors were encountered: