Skip to content

Commit 9e69a2d

Browse files
authored
Merge pull request #170 from nils-a/release/0.3.0
Release/0.3.0
2 parents f5afa8e + 8bb9521 commit 9e69a2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1614
-1475
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "0.38.5",
6+
"version": "1.3.0",
77
"commands": [
88
"dotnet-cake"
99
]

.github/renovate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [ "github>nils-a/renovate-config" ],
3+
"extends": [ "github>nils-org/renovate-config" ],
44
"packageRules": [
55
{
66
"matchPackageNames": ["cake.tool", "Cake.Core"],
77
"enabled": false
88
}
99
]
10-
}
10+
}

.github/workflows/build.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
22-
os: [ windows-2019 ]
22+
os: [ windows-2022 ]
2323

2424
env:
2525
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
@@ -38,33 +38,37 @@ jobs:
3838
#WYAM_DEPLOY_REMOTE: ${{ github.event.repository.html_url }}
3939

4040
steps:
41-
- name: Checkout the repository
42-
uses: actions/checkout@v2.3.4
41+
- name: Checkout the repository
42+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
4343
- name: Fetch all tags and branches
4444
run: git fetch --prune --unshallow
4545
- name: Cache Tools
46-
uses: actions/cache@v2.1.6
46+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
4747
with:
4848
path: tools
4949
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
50+
- uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
51+
with:
52+
dotnet-version: |
53+
5.0.x
54+
6.0.x
55+
7.0.x
5056
- name: Build project
51-
uses: cake-build/cake-action@v1.3.0
57+
uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1.4.1
5258
with:
5359
script-path: recipe.cake
5460
target: CI
55-
verbosity: Diagnostic
56-
cake-version: 0.38.5
57-
cake-bootstrap: true
61+
cake-version: 1.3.0
5862
- name: Upload Issues
59-
uses: actions/upload-artifact@v2.2.4
63+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
6064
with:
6165
if-no-files-found: warn
6266
name: ${{ matrix.os }} Issues
6367
path: |
6468
BuildArtifacts/report.html
6569
BuildArtifacts/**/coverlet/*.xml
6670
- name: Upload Packages
67-
uses: actions/upload-artifact@v2.2.4
71+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
6872
if: runner.os == 'Windows'
6973
with:
7074
if-no-files-found: warn

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"allowPrerelease": true,
4+
"version": "7.0.401",
5+
"rollForward": "latestFeature"
6+
}
7+
}

recipe.cake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#load nuget:?package=Cake.Recipe&version=2.2.1
1+
#load nuget:?package=Cake.Recipe&version=3.1.1
22

33
var standardNotificationMessage = "Version {0} of {1} has just been released, it will be available here https://www.nuget.org/packages/{1}, once package indexing is complete.";
44

@@ -14,7 +14,9 @@ BuildParameters.SetParameters(
1414
shouldRunDotNetCorePack: true,
1515
preferredBuildProviderType: BuildProviderType.GitHubActions,
1616
twitterMessage: standardNotificationMessage,
17-
shouldRunIntegrationTests: false);
17+
shouldRunIntegrationTests: false,
18+
shouldRunCoveralls: false
19+
);
1820

1921
BuildParameters.PrintParameters(Context);
2022

src/JavaVersionSwitcher.Tests/ConfigurationServiceTests.cs

Lines changed: 94 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -6,119 +6,118 @@
66
using Shouldly;
77
using Xunit;
88

9-
namespace JavaVersionSwitcher.Tests
9+
namespace JavaVersionSwitcher.Tests;
10+
11+
public class ConfigurationServiceTests
1012
{
11-
public class ConfigurationServiceTests
13+
[Fact]
14+
public async Task SetConfiguration_throws_on_wrong_provider()
1215
{
13-
[Fact]
14-
public async Task SetConfiguration_throws_on_wrong_provider()
15-
{
16-
// arrange
17-
using var fixture = new ConfigurationServiceFixture();
18-
const string providerName = "non-existent-provider";
16+
// arrange
17+
using var fixture = new ConfigurationServiceFixture();
18+
const string providerName = "non-existent-provider";
1919

20-
// act
21-
// ReSharper disable once AccessToDisposedClosure
22-
async Task Act() => await fixture.Service.SetConfiguration(providerName, null, null);
20+
// act
21+
// ReSharper disable once AccessToDisposedClosure
22+
async Task Act() => await fixture.Service.SetConfiguration(providerName, null, null);
2323

24-
// assert
25-
(await Should.ThrowAsync<KeyNotFoundException>((Func<Task>)Act))
26-
.Message
27-
.ShouldSatisfyAllConditions(
28-
m => m.ShouldStartWith("No ConfigurationProvider"),
29-
m => m.ShouldContain(providerName));
30-
}
24+
// assert
25+
(await Should.ThrowAsync<KeyNotFoundException>((Func<Task>)Act))
26+
.Message
27+
.ShouldSatisfyAllConditions(
28+
m => m.ShouldStartWith("No ConfigurationProvider"),
29+
m => m.ShouldContain(providerName));
30+
}
3131

32-
[Fact]
33-
public async Task SetConfiguration_throws_on_wrong_setting()
34-
{
35-
// arrange
36-
const string providerName = "provider";
37-
using var fixture = new ConfigurationServiceFixture();
38-
fixture.WithConfigurationProvider(providerName);
39-
const string setting = "non-existent-setting";
32+
[Fact]
33+
public async Task SetConfiguration_throws_on_wrong_setting()
34+
{
35+
// arrange
36+
const string providerName = "provider";
37+
using var fixture = new ConfigurationServiceFixture();
38+
fixture.WithConfigurationProvider(providerName);
39+
const string setting = "non-existent-setting";
4040

41-
// act'
42-
// ReSharper disable once AccessToDisposedClosure
43-
async Task Act() => await fixture.Service.SetConfiguration(providerName, setting, null);
41+
// act'
42+
// ReSharper disable once AccessToDisposedClosure
43+
async Task Act() => await fixture.Service.SetConfiguration(providerName, setting, null);
4444

45-
// assert
46-
(await Should.ThrowAsync<KeyNotFoundException>((Func<Task>)Act))
47-
.Message
48-
.ShouldSatisfyAllConditions(
49-
m => m.ShouldStartWith("No Configuration with the name"),
50-
m => m.ShouldContain(setting));
51-
}
45+
// assert
46+
(await Should.ThrowAsync<KeyNotFoundException>((Func<Task>)Act))
47+
.Message
48+
.ShouldSatisfyAllConditions(
49+
m => m.ShouldStartWith("No Configuration with the name"),
50+
m => m.ShouldContain(setting));
51+
}
5252

53-
[Fact]
54-
public async Task SetConfiguration_writes_value_to_xml()
55-
{
56-
// arrange
57-
const string providerName = "pName";
58-
const string settingsName = "settingsName";
59-
const string value = "a value";
60-
using var fixture = new ConfigurationServiceFixture();
61-
fixture.WithConfigurationProvider(providerName, settingsName);
53+
[Fact]
54+
public async Task SetConfiguration_writes_value_to_xml()
55+
{
56+
// arrange
57+
const string providerName = "pName";
58+
const string settingsName = "settingsName";
59+
const string value = "a value";
60+
using var fixture = new ConfigurationServiceFixture();
61+
fixture.WithConfigurationProvider(providerName, settingsName);
6262

63-
// act'
64-
await fixture.Service.SetConfiguration(providerName, settingsName, value);
63+
// act'
64+
await fixture.Service.SetConfiguration(providerName, settingsName, value);
6565

66-
// assert
67-
var xml = fixture.ReadXml(providerName, settingsName);
68-
xml.Value.ShouldBe(value);
69-
}
66+
// assert
67+
var xml = fixture.ReadXml(providerName, settingsName);
68+
xml.Value.ShouldBe(value);
69+
}
7070

71-
[Fact]
72-
public async Task GetConfiguration_returns_empty_for_not_set_setting()
73-
{
74-
// arrange
75-
const string providerName = "pName";
76-
const string settingsName = "settingsName";
77-
using var fixture = new ConfigurationServiceFixture();
78-
fixture.WithConfigurationProvider(providerName, settingsName);
71+
[Fact]
72+
public async Task GetConfiguration_returns_empty_for_not_set_setting()
73+
{
74+
// arrange
75+
const string providerName = "pName";
76+
const string settingsName = "settingsName";
77+
using var fixture = new ConfigurationServiceFixture();
78+
fixture.WithConfigurationProvider(providerName, settingsName);
7979

80-
// act'
81-
var actual = await fixture.Service.GetConfiguration(providerName, settingsName);
80+
// act'
81+
var actual = await fixture.Service.GetConfiguration(providerName, settingsName);
8282

83-
// assert
84-
actual.ShouldBe(string.Empty);
85-
}
83+
// assert
84+
actual.ShouldBe(string.Empty);
85+
}
8686

87-
[Fact]
88-
public async Task GetConfiguration_returns_the_value_from_xml()
89-
{
90-
// arrange
91-
const string providerName = "pName";
92-
const string settingsName = "settingsName";
93-
const string expected = "some value";
94-
using var fixture = new ConfigurationServiceFixture();
95-
fixture.WithConfigurationProvider(providerName, settingsName);
96-
fixture.EnsureSetting(providerName, settingsName, expected);
87+
[Fact]
88+
public async Task GetConfiguration_returns_the_value_from_xml()
89+
{
90+
// arrange
91+
const string providerName = "pName";
92+
const string settingsName = "settingsName";
93+
const string expected = "some value";
94+
using var fixture = new ConfigurationServiceFixture();
95+
fixture.WithConfigurationProvider(providerName, settingsName);
96+
fixture.EnsureSetting(providerName, settingsName, expected);
9797

98-
// act'
99-
var actual = await fixture.Service.GetConfiguration(providerName, settingsName);
98+
// act'
99+
var actual = await fixture.Service.GetConfiguration(providerName, settingsName);
100100

101-
// assert
102-
actual.ShouldBe(expected);
103-
}
101+
// assert
102+
actual.ShouldBe(expected);
103+
}
104104

105-
[Fact]
106-
public async Task SetConfiguration_removes_empty_settings()
107-
{
108-
// arrange
109-
const string providerName = "pName";
110-
const string settingsName = "settingsName";
111-
using var fixture = new ConfigurationServiceFixture();
112-
fixture.WithConfigurationProvider(providerName, settingsName);
113-
fixture.EnsureSetting(providerName, settingsName, "some value");
105+
[Fact]
106+
public async Task SetConfiguration_removes_empty_settings()
107+
{
108+
// arrange
109+
const string providerName = "pName";
110+
const string settingsName = "settingsName";
111+
using var fixture = new ConfigurationServiceFixture();
112+
fixture.WithConfigurationProvider(providerName, settingsName);
113+
fixture.EnsureSetting(providerName, settingsName, "some value");
114114

115-
// act'
116-
await fixture.Service.SetConfiguration(providerName, settingsName, null);
115+
// act'
116+
await fixture.Service.SetConfiguration(providerName, settingsName, null);
117117

118-
// assert
119-
var xml = fixture.ReadXml();
120-
xml.Parent.ShouldBeNull("this should be the root node.");
121-
xml.Elements().Count().ShouldBe(0);
122-
}
118+
// assert
119+
var xml = fixture.ReadXml();
120+
xml.Parent.ShouldBeNull("this should be the root node.");
121+
xml.Elements().Count().ShouldBe(0);
123122
}
124123
}

0 commit comments

Comments
 (0)