This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add test to verify the assembly's public API surface
Showing
5 changed files
with
106 additions
and
3 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
74 changes: 74 additions & 0 deletions
74
...eleases.Test/PublicApiApproval.Assembly_does_not_have_unapproved_API_changes.verified.txt
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,74 @@ | ||
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Cake.GitHubReleases.Test")] | ||
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicProxyGenAssembly2")] | ||
[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName="")] | ||
namespace Cake.GitHubReleases | ||
{ | ||
public class AmbiguousTagNameException : Cake.GitHubReleases.GitHubReleaseException | ||
{ | ||
public AmbiguousTagNameException(string message) { } | ||
} | ||
public sealed class AssetConflictException : Cake.GitHubReleases.GitHubReleaseException | ||
{ | ||
public AssetConflictException(string message) { } | ||
} | ||
public sealed class GitHubRelease | ||
{ | ||
public GitHubRelease(int id, string htmlUrl, string tagName, string targetCommitish, string name, string body, bool draft, bool prerelease, System.DateTime createdAt, System.DateTime? publishedAt) { } | ||
public System.Collections.Generic.IReadOnlyList<Cake.GitHubReleases.GitHubReleaseAsset> Assets { get; } | ||
public string Body { get; } | ||
public System.DateTime CreatedAt { get; } | ||
public bool Draft { get; } | ||
public string HtmlUrl { get; } | ||
public int Id { get; } | ||
public string Name { get; } | ||
public bool Prerelease { get; } | ||
public System.DateTime? PublishedAt { get; } | ||
public string TagName { get; } | ||
public string TargetCommitish { get; } | ||
} | ||
[Cake.Core.Annotations.CakeAliasCategory("GitHubRelease")] | ||
public static class GitHubReleaseAliases | ||
{ | ||
[Cake.Core.Annotations.CakeMethodAlias] | ||
public static System.Threading.Tasks.Task<Cake.GitHubReleases.GitHubRelease> GitHubReleaseCreateAsync(this Cake.Core.ICakeContext context, Cake.GitHubReleases.GitHubReleaseCreateSettings settings) { } | ||
} | ||
public sealed class GitHubReleaseAsset | ||
{ | ||
public GitHubReleaseAsset(int id, string name, long size, string contentType, string browserDownloadUrl) { } | ||
public string BrowserDownloadUrl { get; } | ||
public string ContentType { get; } | ||
public int Id { get; } | ||
public string Name { get; } | ||
public long Size { get; } | ||
} | ||
public sealed class GitHubReleaseCreateSettings : Cake.GitHubReleases.GitHubSettings | ||
{ | ||
public GitHubReleaseCreateSettings(string repositoryOwner, string repositoryName, string tagName) { } | ||
public System.Collections.Generic.IList<Cake.Core.IO.FilePath> Assets { get; set; } | ||
public string? Body { get; set; } | ||
public bool Draft { get; set; } | ||
public string? Name { get; set; } | ||
public bool Overwrite { get; set; } | ||
public bool Prerelease { get; set; } | ||
public string TagName { get; } | ||
public string? TargetCommitish { get; set; } | ||
} | ||
public abstract class GitHubReleaseException : System.Exception | ||
{ | ||
protected GitHubReleaseException() { } | ||
protected GitHubReleaseException(string message) { } | ||
protected GitHubReleaseException(string message, System.Exception innerException) { } | ||
} | ||
public abstract class GitHubSettings | ||
{ | ||
protected GitHubSettings(string repositoryOwner, string repositoryName) { } | ||
public string? AccessToken { get; set; } | ||
public string HostName { get; set; } | ||
public string RepositoryName { get; set; } | ||
public string RepositoryOwner { get; set; } | ||
} | ||
public class ReleaseExistsException : Cake.GitHubReleases.GitHubReleaseException | ||
{ | ||
public ReleaseExistsException(string message) { } | ||
} | ||
} |
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,26 @@ | ||
using System.Threading.Tasks; | ||
using PublicApiGenerator; | ||
using VerifyXunit; | ||
using Xunit; | ||
|
||
namespace Cake.GitHubReleases.Test | ||
{ | ||
[Trait("Category", "SkipWhenLiveUnitTesting")] | ||
[UsesVerify] | ||
public class PublicApiApproval | ||
{ | ||
[Fact] | ||
public Task Assembly_does_not_have_unapproved_API_changes() | ||
{ | ||
// ARRANGE | ||
var assembly = typeof(GitHubReleaseAliases).Assembly; | ||
|
||
// ACT | ||
var publicApi = ApiGenerator.GeneratePublicApi(assembly, options: null); | ||
|
||
// ASSERT | ||
return Verifier.Verify(publicApi); | ||
} | ||
} | ||
|
||
} |
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