Skip to content

Commit 53972f5

Browse files
committed
C#: Move DotNetStub into its own file.
1 parent 0f2a7cf commit 53972f5

2 files changed

Lines changed: 33 additions & 27 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Semmle.Extraction.CSharp.DependencyFetching;
4+
5+
namespace Semmle.Extraction.Tests
6+
{
7+
internal class DotNetStub : IDotNet
8+
{
9+
private readonly IList<string> runtimes;
10+
private readonly IList<string> sdks;
11+
12+
public DotNetStub(IList<string> runtimes, IList<string> sdks)
13+
{
14+
this.runtimes = runtimes;
15+
this.sdks = sdks;
16+
}
17+
public bool AddPackage(string folder, string package) => true;
18+
19+
public bool New(string folder) => true;
20+
21+
public RestoreResult Restore(RestoreSettings restoreSettings) => new(true, Array.Empty<string>());
22+
23+
public IList<string> GetListedRuntimes() => runtimes;
24+
25+
public IList<string> GetListedSdks() => sdks;
26+
27+
public bool Exec(List<string> execArgs) => true;
28+
29+
public IList<string> GetNugetFeeds(string nugetConfig) => [];
30+
31+
public IList<string> GetNugetFeedsFromFolder(string folderPath) => [];
32+
}
33+
}

csharp/extractor/Semmle.Extraction.Tests/Runtime.cs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,6 @@
55

66
namespace Semmle.Extraction.Tests
77
{
8-
internal class DotNetStub : IDotNet
9-
{
10-
private readonly IList<string> runtimes;
11-
private readonly IList<string> sdks;
12-
13-
public DotNetStub(IList<string> runtimes, IList<string> sdks)
14-
{
15-
this.runtimes = runtimes;
16-
this.sdks = sdks;
17-
}
18-
public bool AddPackage(string folder, string package) => true;
19-
20-
public bool New(string folder) => true;
21-
22-
public RestoreResult Restore(RestoreSettings restoreSettings) => new(true, Array.Empty<string>());
23-
24-
public IList<string> GetListedRuntimes() => runtimes;
25-
26-
public IList<string> GetListedSdks() => sdks;
27-
28-
public bool Exec(List<string> execArgs) => true;
29-
30-
public IList<string> GetNugetFeeds(string nugetConfig) => [];
31-
32-
public IList<string> GetNugetFeedsFromFolder(string folderPath) => [];
33-
}
34-
358
public class RuntimeTests
369
{
3710
private static string FixExpectedPathOnWindows(string path) => path.Replace('\\', '/');

0 commit comments

Comments
 (0)