-
-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.2.0' into main
- Loading branch information
Showing
49 changed files
with
1,488 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"src" | ||
], | ||
"sdk": { | ||
"version": "6.0.102", | ||
"version": "6.0.202", | ||
"rollForward": "latestFeature" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Cake.Common.Tests/Fixtures/Tools/DotNet/Workload/Search/DotNetWorkloadSearcherFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Generic; | ||
using Cake.Common.Tools.DotNet.Workload.Search; | ||
|
||
namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Search | ||
{ | ||
internal sealed class DotNetWorkloadSearcherFixture : DotNetFixture<DotNetWorkloadSearchSettings> | ||
{ | ||
public string SearchString { get; set; } | ||
public IEnumerable<DotNetWorkload> Workloads { get; set; } | ||
|
||
public void GivenAvailableWorkloadsResult() | ||
{ | ||
ProcessRunner.Process.SetStandardOutput(new string[] | ||
{ | ||
"Workload ID Description", | ||
"-----------------------------------------------------", | ||
"maui .NET MAUI SDK for all platforms", | ||
"maui-desktop .NET MAUI SDK for Desktop", | ||
"maui-mobile .NET MAUI SDK for Mobile" | ||
}); | ||
} | ||
|
||
protected override void RunTool() | ||
{ | ||
var tool = new DotNetWorkloadSearcher(FileSystem, Environment, ProcessRunner, Tools); | ||
Workloads = tool.Search(SearchString, Settings); | ||
} | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
src/Cake.Common.Tests/Unit/Tools/DotNet/Workload/Search/DotNetWorkloadSearchTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Search; | ||
using Cake.Testing; | ||
using Xunit; | ||
|
||
namespace Cake.Common.Tests.Unit.Tools.DotNet.Workload.Search | ||
{ | ||
public sealed class DotNetWorkloadSearchTests | ||
{ | ||
public sealed class TheWorkloadSearchMethod | ||
{ | ||
[Fact] | ||
public void Should_Throw_If_Process_Was_Not_Started() | ||
{ | ||
// Given | ||
var fixture = new DotNetWorkloadSearcherFixture(); | ||
fixture.GivenProcessCannotStart(); | ||
|
||
// When | ||
var result = Record.Exception(() => fixture.Run()); | ||
|
||
// Then | ||
AssertEx.IsCakeException(result, ".NET CLI: Process was not started."); | ||
} | ||
|
||
[Fact] | ||
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() | ||
{ | ||
// Given | ||
var fixture = new DotNetWorkloadSearcherFixture(); | ||
fixture.GivenProcessExitsWithCode(1); | ||
|
||
// When | ||
var result = Record.Exception(() => fixture.Run()); | ||
|
||
// Then | ||
AssertEx.IsCakeException(result, ".NET CLI: Process returned an error (exit code 1)."); | ||
} | ||
|
||
[Fact] | ||
public void Should_Add_SearchString_Argument() | ||
{ | ||
// Given | ||
var fixture = new DotNetWorkloadSearcherFixture(); | ||
fixture.SearchString = "maui"; | ||
|
||
// When | ||
var result = fixture.Run(); | ||
|
||
// Then | ||
Assert.Equal("workload search maui", result.Args); | ||
} | ||
|
||
[Fact] | ||
public void Should_Return_Correct_List_Of_Workloads() | ||
{ | ||
// Given | ||
var fixture = new DotNetWorkloadSearcherFixture(); | ||
fixture.SearchString = "maui"; | ||
fixture.GivenAvailableWorkloadsResult(); | ||
|
||
// When | ||
var result = fixture.Run(); | ||
|
||
// Then | ||
Assert.Collection(fixture.Workloads, | ||
item => | ||
{ | ||
Assert.Equal(item.Id, "maui"); | ||
Assert.Equal(item.Description, ".NET MAUI SDK for all platforms"); | ||
}, | ||
item => | ||
{ | ||
Assert.Equal(item.Id, "maui-desktop"); | ||
Assert.Equal(item.Description, ".NET MAUI SDK for Desktop"); | ||
}, | ||
item => | ||
{ | ||
Assert.Equal(item.Id, "maui-mobile"); | ||
Assert.Equal(item.Description, ".NET MAUI SDK for Mobile"); | ||
}); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace Cake.Common.Net | ||
{ | ||
/// <summary> | ||
/// Contains settings for <see cref="HttpAliases"/>. | ||
/// </summary> | ||
public sealed class UploadFileSettings | ||
{ | ||
/// <summary> | ||
/// Gets or sets the username to use when uploadingthe file. | ||
/// </summary> | ||
public string Username { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the password to use when uploading the file. | ||
/// </summary> | ||
public string Password { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether default credentials are sent when uploading the file. | ||
/// </summary> | ||
/// <remarks> | ||
/// If set to true, any username and password that has been specified will be ignored. | ||
/// </remarks> | ||
public bool UseDefaultCredentials { get; set; } | ||
} | ||
} |
Oops, something went wrong.