public void Test01_ProjectReferenceDoesNotExist() { var test = new Test(@"Test01_ProjectReferenceDoesNotExist\Project01\Project01.csproj", null); Exception exception = null; bool result = true; try { test.DeleteOutput(); result = test.Execute(); } catch(Exception ex) { exception = ex; } Assert.That(!result, "Any error should lead to negative result"); Assert.That(exception == null, "Exception {0} was not expected", exception); var fileExist = test.DeleteOutput(); Assert.That(!fileExist, "In case of error there should not be file generated"); }