Assuming that we have a bigger Microsoft .NET project that has a structure like this:

  -- SubProject1
  -- SubProject1\SubProject1.sln
  -- SubProject1.Tests
  -- SubProject1.Tests\SubProject1.Tests.csproj
  -- SubProject2
  -- SubProject2\SubProject1.sln
  -- SubProject2.Tests
  -- SubProject2.Tests\SubProject2.Tests.csproj
  -- SubProject3
  -- SubProject3\SubProject1.sln
  -- SubProject3.Tests
  -- SubProject3.Tests\SubProject2.Tests.csproj

we can build it at once using MSBuild. Lets create a builder.proj file

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="" >
	<Solution Include="**\*.sln" />
	<TestAssemblies Include="**\**\bin\**\*Tests.dll"/>
<Target Name="Build">
  <MSBuild Projects="@(Solution)" Targets="Build"/>
<Target Name="Test">
  <Exec Condition=" '@(TestAssemblies)' != ''"
          Command="Mstest.exe /resultsfile:results.trx @(TestAssemblies ->'/testcontainer:"%(RecursiveDir)%(Filename)%(Extension)"', ' ')"
          ContinueOnError="true" IgnoreExitCode="true" />

and then we can execute

msbuild /t:Build builder.proj -- building the project
msuilbd /t:Test builder.proj -- running all tests