Skip to content

C#: Re-factor to allow better unit testing. - #22468

Draft
michaelnebel wants to merge 8 commits into
github:mainfrom
michaelnebel:csharp/refactorfeedmanager
Draft

C#: Re-factor to allow better unit testing.#22468
michaelnebel wants to merge 8 commits into
github:mainfrom
michaelnebel:csharp/refactorfeedmanager

Conversation

@michaelnebel

@michaelnebel michaelnebel commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

In this PR we

  • Re-factor the FeedManager to enable unit testing.
  • Add some unit tests.

This is in preparation for using feeds configured via the dependabot proxy as "base" feed(s) (instead of the current hardcoded public nuget.org feed).

@github-actions github-actions Bot added the C# label Aug 31, 2026
@michaelnebel
michaelnebel force-pushed the csharp/refactorfeedmanager branch from 08d2f0e to b31ae61 Compare August 31, 2026 11:24
Comment on lines +30 to +33
catch (Exception exc)
{
logger.LogWarning($"Failed to get directory of '{path}': {exc}");
}
Comment on lines +87 to +100
catch (Exception exc)
{
if (exc is TaskCanceledException tce &&
tce.CancellationToken == cts.Token &&
cts.Token.IsCancellationRequested)
{
logger.LogInfo($"Didn't receive answer from NuGet feed '{feed}' in {timeoutMilliSeconds}ms.");
timeoutMilliSeconds *= 2;
continue;
}

logger.LogInfo($"Querying NuGet feed '{feed}' failed. The reason for the failure: {exc.Message}");
return false;
}
@michaelnebel
michaelnebel force-pushed the csharp/refactorfeedmanager branch from 98f0019 to 446e52e Compare August 31, 2026 13:21
@michaelnebel
michaelnebel force-pushed the csharp/refactorfeedmanager branch from 446e52e to b76f793 Compare August 31, 2026 13:23
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants