Skip to content

torbacz/NetRefsTest

Repository files navigation

NetRefsTest

A fluent API for unit testing all sorts of .Net project files.

Inspired by Inspired by the NetArchTest and FluentAssertions

Supported .Net versions

Version Supported
.Net6 Yes
.netFramework Yes
nanoFramework Yes

Supported features

  • Check if project has package reference
  • Check if project has additional file included

Code samples

Validate the project file to see if it contains the package

var project = IProject.FromFile(ProjectPath);
project.Should().ContainPackage(PackageName);
project.Should().ContainPackage(PackageName, PackageVersion)

Validate the projects in directory to see if it contains the package

var allFiles = IProjects.SearchFiles(SearchPath, "*.csproj", SearchOption.AllDirectories);
var projects = IProjects.FromFiles(allFiles);
projects.Should().ContainPackage(PackageName);
projects.Should().ContainPackage(PackageName, PackageVersion)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages