Skip to content

Commit 67b69ab

Browse files
Update .NET version of tests project to 8.0
1 parent 062cf25 commit 67b69ab

File tree

6 files changed

+26
-17
lines changed

6 files changed

+26
-17
lines changed

azure-pipelines.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
variables:
22
buildConfiguration: 'Release'
3+
netSdkVersion: '8.x'
34

45
jobs:
56
- job: BuildAndRunCodeAnalysis
67
displayName: Build and run code analysis
78
pool:
89
vmImage: windows-latest
910
steps:
11+
- task: UseDotNet@2
12+
displayName: Set up .NET SDK
13+
inputs:
14+
version: $(netSdkVersion)
1015
- task: DotNetCoreCLI@2
1116
displayName: Build solution with code analysis
1217
inputs:
@@ -19,6 +24,10 @@ jobs:
1924
pool:
2025
vmImage: windows-latest
2126
steps:
27+
- task: UseDotNet@2
28+
displayName: Set up .NET SDK
29+
inputs:
30+
version: $(netSdkVersion)
2231
- task: DotNetCoreCLI@2
2332
displayName: Build solution
2433
inputs:

test/Atata.Configuration.Json.Tests/Atata.Configuration.Json.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77

test/Atata.Configuration.Json.Tests/CustomJsonConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class CustomJsonConfig : JsonConfig<CustomJsonConfig>
1212

1313
public string[] StringArrayValues { get; set; }
1414

15-
public List<string> StringListValues { get; } = new List<string>();
15+
public List<string> StringListValues { get; } = [];
1616

1717
public CustomSection Section { get; set; }
1818

19-
public List<CustomItemSection> Items { get; } = new List<CustomItemSection>();
19+
public List<CustomItemSection> Items { get; } = [];
2020

2121
public class CustomSection
2222
{

test/Atata.Configuration.Json.Tests/GeneralSettingsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void GeneralAndNUnit()
6060
[Test]
6161
public void ObsoleteNUnitProperties()
6262
{
63-
List<string> logEntries = new();
63+
List<string> logEntries = [];
6464

6565
using var context = AtataContext.Configure()
6666
.UseDriverInitializationStage(AtataContextDriverInitializationStage.None)

test/Atata.Configuration.Json.Tests/LogConsumerTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ public void Multiple_ViaSingleConfig()
1010
.ApplyJsonConfig("Configs/LogConsumers");
1111

1212
LogConsumerConfiguration[] expected =
13-
{
14-
new(new DebugLogConsumer { Separator = " - " }),
15-
new(new TraceLogConsumer(), LogLevel.Trace)
13+
[
14+
new LogConsumerConfiguration(new DebugLogConsumer { Separator = " - " }),
15+
new LogConsumerConfiguration(new TraceLogConsumer(), LogLevel.Trace)
1616
{
1717
MessageNestingLevelIndent = "_ ",
1818
MessageStartSectionPrefix = "S:",
1919
MessageEndSectionPrefix = "E:",
2020
},
21-
new(new NUnitTestContextLogConsumer(), LogLevel.Info, LogSectionEndOption.Exclude),
22-
new(new NLogConsumer { LoggerName = "somelogger" }, LogLevel.Warn, LogSectionEndOption.IncludeForBlocks),
23-
new(new CustomLogConsumer { IntProperty = 15 }, LogLevel.Error)
24-
};
21+
new LogConsumerConfiguration(new NUnitTestContextLogConsumer(), LogLevel.Info, LogSectionEndOption.Exclude),
22+
new LogConsumerConfiguration(new NLogConsumer { LoggerName = "somelogger" }, LogLevel.Warn, LogSectionEndOption.IncludeForBlocks),
23+
new LogConsumerConfiguration(new CustomLogConsumer { IntProperty = 15 }, LogLevel.Error)
24+
];
2525

2626
AssertLogConsumers(expected, builder.BuildingContext.LogConsumerConfigurations);
2727

@@ -36,10 +36,10 @@ public void Multiple_ViaMultipleConfigs()
3636
.ApplyJsonConfig("Configs/TraceLogConsumers");
3737

3838
LogConsumerConfiguration[] expected =
39-
{
40-
new(new DebugLogConsumer { Separator = " - " }),
41-
new(new TraceLogConsumer(), LogLevel.Trace)
42-
};
39+
[
40+
new LogConsumerConfiguration(new DebugLogConsumer { Separator = " - " }),
41+
new LogConsumerConfiguration(new TraceLogConsumer(), LogLevel.Trace)
42+
];
4343

4444
AssertLogConsumers(expected, builder.BuildingContext.LogConsumerConfigurations);
4545

test/Atata.Configuration.Json.Tests/ScreenshotConsumerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public void Multiple_ViaSingleConfig()
1010
.ApplyJsonConfig("ScreenshotConsumers");
1111

1212
IScreenshotConsumer[] expected =
13-
{
13+
[
1414
new FileScreenshotConsumer { FilePath = "/logs/{test-name}.txt" },
1515
new CustomScreenshotConsumer { IntProperty = 15 },
1616
new FileScreenshotConsumer { DirectoryPath = "/logs", FileName = "{test-name}" }
17-
};
17+
];
1818

1919
builder.BuildingContext.ScreenshotConsumers.Select(x => x.GetType()).Should().BeEquivalentTo(expected.Select(x => x.GetType()));
2020

0 commit comments

Comments
 (0)