.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World")
- .And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion);
+ .And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion)
+ .And.NotHaveStdErr();
// Verify running from within the working directory
Command.Create(appExe)
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World")
- .And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion);
+ .And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion)
+ .And.NotHaveStdErr();
}
}
auto err = GetLastError();
if (err != ERROR_ENVVAR_NOT_FOUND)
{
- trace::error(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(GetLastError()));
+ trace::warning(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(err));
}
return false;
}
auto buf = new char_t[length];
if (::GetEnvironmentVariableW(name, buf, length) == 0)
{
- trace::error(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(GetLastError()));
+ auto err = GetLastError();
+ if (err != ERROR_ENVVAR_NOT_FOUND)
+ {
+ trace::warning(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(err));
+ }
return false;
}