Skip to content

Commit 38636d9

Browse files
Refactoring
1 parent 3e1fbd8 commit 38636d9

File tree

15 files changed

+36
-35
lines changed

15 files changed

+36
-35
lines changed

CSharpInteractive.Tests/Integration/Core/DotNetScript.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static CommandLine Create(params string[] lines) =>
1212

1313
public static CommandLine Create() =>
1414
new(
15-
Composition.Shared.Root.DotNetEnvironment.Path,
15+
Composition.Shared.Root.DotNetEnvironment.Value.Path,
1616
Path.Combine(Path.GetDirectoryName(typeof(DotNetScript).Assembly.Location)!, "dotnet-csi.dll"));
1717

1818
public static CommandLine CreateForScript(string scriptName, string? workingDirectory, IEnumerable<string> args, params string[] lines)
@@ -27,7 +27,7 @@ public static string GetWorkingDirectory()
2727
{
2828
var uniqueNameGenerator = new UniqueNameGenerator();
2929
var environment = Composition.Shared.Root.Environment;
30-
var tempDirectory = environment.GetPath(SpecialFolder.Temp);
30+
var tempDirectory = environment.Value.GetPath(SpecialFolder.Temp);
3131
return Path.Combine(tempDirectory, uniqueNameGenerator.Generate());
3232
}
3333
}

CSharpInteractive.Tests/Integration/NuGetTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void ShouldSupportRestore()
1818

1919
// When
2020
var nuget = Composition.Shared.Root.NuGet;
21-
var result = nuget.Restore(new NuGetRestoreSettings("IoC.Container").WithVersionRange(VersionRange.Parse("1.3.6")).WithTargetFrameworkMoniker("net5.0").WithPackagesPath(tempPath)).ToList();
21+
var result = nuget.Value.Restore(new NuGetRestoreSettings("IoC.Container").WithVersionRange(VersionRange.Parse("1.3.6")).WithTargetFrameworkMoniker("net5.0").WithPackagesPath(tempPath)).ToList();
2222

2323
// Then
2424
result.Count.ShouldBe(1);
@@ -32,7 +32,7 @@ public void ShouldSupportRestoreForDefaults()
3232

3333
// When
3434
var nuget = Composition.Shared.Root.NuGet;
35-
var result = nuget.Restore(new NuGetRestoreSettings("IoC.Container")).ToList();
35+
var result = nuget.Value.Restore(new NuGetRestoreSettings("IoC.Container")).ToList();
3636

3737
// Then
3838
result.Count.ShouldBeGreaterThan(0);

CSharpInteractive.Tests/Integration/TestTool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private static readonly (string, string)[] TeamCityVars =
2121
public static IProcessResult Run(in CommandLine commandLine)
2222
{
2323
var events = new List<Output>();
24-
var result = Composition.Shared.Root.CommandLineRunner.Run(commandLine, output =>
24+
var result = Composition.Shared.Root.CommandLineRunner.Value.Run(commandLine, output =>
2525
{
2626
output.Handled = true;
2727
events.Add(output);
@@ -70,7 +70,7 @@ private static IEnumerable<IServiceMessage> ParseMessagesInternal(this IEnumerab
7070
var parser = Composition.Shared.Root.ServiceMessageParser;
7171
foreach (var line in lines)
7272
{
73-
foreach (var message in parser.ParseServiceMessages(line))
73+
foreach (var message in parser.Value.ParseServiceMessages(line))
7474
{
7575
yield return message;
7676
}

CSharpInteractive/Core/BuildEngine.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public void LogMessageEvent(BuildMessageEventArgs e)
3636
switch (e.Importance)
3737
{
3838
case MessageImportance.High:
39-
log.Info([new Text(message)]);
40-
break;
41-
4239
case MessageImportance.Normal:
4340
log.Info([new Text(message)]);
4441
break;

CSharpInteractive/Core/FilePathResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ReSharper disable ClassNeverInstantiated.Global
2-
2+
// ReSharper disable RedundantExplicitParamsArrayCreation
33
namespace CSharpInteractive.Core;
44

55
using HostApi;

CSharpInteractive/Core/HostService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ReSharper disable UnusedMember.Global
22
// ReSharper disable ClassNeverInstantiated.Global
33
// ReSharper disable HeapView.PossibleBoxingAllocation
4-
4+
// ReSharper disable RedundantExplicitParamsArrayCreation
55
namespace CSharpInteractive.Core;
66

77
using HostApi;

CSharpInteractive/Core/Info.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ReSharper disable ClassNeverInstantiated.Global
2-
2+
// ReSharper disable RedundantExplicitParamsArrayCreation
33
namespace CSharpInteractive.Core;
44

55
using System.Reflection;

CSharpInteractive/Core/InteractiveRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ReSharper disable ClassNeverInstantiated.Global
22
// ReSharper disable SwitchStatementHandlesSomeKnownEnumValuesWithDefault
33
// ReSharper disable UnusedType.Global
4-
4+
// ReSharper disable RedundantExplicitParamsArrayCreation
55
namespace CSharpInteractive.Core;
66

77
using HostApi;

CSharpInteractive/Core/ProcessManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ReSharper disable ClassNeverInstantiated.Global
2-
2+
// ReSharper disable RedundantExplicitParamsArrayCreation
33
namespace CSharpInteractive.Core;
44

55
using System.Diagnostics;

CSharpInteractive/Core/StatisticsPresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ReSharper disable ClassNeverInstantiated.Global
2-
2+
// ReSharper disable RedundantExplicitParamsArrayCreation
33
namespace CSharpInteractive.Core;
44

55
using HostApi;

0 commit comments

Comments
 (0)