-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When building locally, default branch to HEAD
If we can't find an envvar with the right value, default to checkout HEAD.
- Loading branch information
Showing
2 changed files
with
61 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,78 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.IO; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
[assembly: SuppressMessage("SponsorLink", "SL04")] | ||
|
||
namespace ThisAssemblyTests | ||
namespace ThisAssemblyTests; | ||
|
||
public record class Tests(ITestOutputHelper Output) | ||
{ | ||
public class Tests | ||
{ | ||
[Fact] | ||
public void CanReadResourceFile() | ||
=> Assert.NotNull(ResourceFile.Load("Resources.resx", "Strings")); | ||
[Fact] | ||
public void CanReadResourceFile() | ||
=> Assert.NotNull(ResourceFile.Load("Resources.resx", "Strings")); | ||
|
||
[Fact] | ||
public void CanUseInfo() | ||
=> Assert.Equal("ThisAssembly.Tests", ThisAssembly.Info.Title); | ||
[Fact] | ||
public void CanUseInfo() | ||
=> Assert.Equal("ThisAssembly.Tests", ThisAssembly.Info.Title); | ||
|
||
[Fact] | ||
public void CanUseConstants() | ||
=> Assert.Equal("Baz", ThisAssembly.Constants.Foo.Bar); | ||
[Fact] | ||
public void CanUseConstants() | ||
=> Assert.Equal("Baz", ThisAssembly.Constants.Foo.Bar); | ||
|
||
[Fact] | ||
public void CanUseFileConstants() | ||
=> Assert.Equal(ThisAssembly.Constants.Content.Docs.License, Path.Combine("Content", "Docs", "License.md")); | ||
[Fact] | ||
public void CanUseFileConstants() | ||
=> Assert.Equal(ThisAssembly.Constants.Content.Docs.License, Path.Combine("Content", "Docs", "License.md")); | ||
|
||
[Fact] | ||
public void CanUseFileConstantLinkedFile() | ||
=> Assert.Equal(ThisAssembly.Constants.Included.Readme, Path.Combine("Included", "Readme.txt")); | ||
[Fact] | ||
public void CanUseFileConstantLinkedFile() | ||
=> Assert.Equal(ThisAssembly.Constants.Included.Readme, Path.Combine("Included", "Readme.txt")); | ||
|
||
[Fact] | ||
public void CanUseMetadata() | ||
=> Assert.Equal("Bar", ThisAssembly.Metadata.Foo); | ||
[Fact] | ||
public void CanUseMetadata() | ||
=> Assert.Equal("Bar", ThisAssembly.Metadata.Foo); | ||
|
||
[Fact] | ||
public void CanUseProjectProperty() | ||
=> Assert.Equal("Bar", ThisAssembly.Project.Foo); | ||
[Fact] | ||
public void CanUseProjectProperty() | ||
=> Assert.Equal("Bar", ThisAssembly.Project.Foo); | ||
|
||
[Fact] | ||
public void CanUseStringsNamedArguments() | ||
=> Assert.NotNull(ThisAssembly.Strings.Named("hello", "world")); | ||
[Fact] | ||
public void CanUseStringsNamedArguments() | ||
=> Assert.NotNull(ThisAssembly.Strings.Named("hello", "world")); | ||
|
||
[Fact] | ||
public void CanUseStringsIndexedArguments() | ||
=> Assert.NotNull(ThisAssembly.Strings.Indexed("hello", "world")); | ||
[Fact] | ||
public void CanUseStringsIndexedArguments() | ||
=> Assert.NotNull(ThisAssembly.Strings.Indexed("hello", "world")); | ||
|
||
[Fact] | ||
public void CanUseStringResource() | ||
=> Assert.Equal("Value", ThisAssembly.Strings.Foo.Bar.Baz); | ||
[Fact] | ||
public void CanUseStringResource() | ||
=> Assert.Equal("Value", ThisAssembly.Strings.Foo.Bar.Baz); | ||
|
||
[Fact] | ||
public void CanUseTextResource() | ||
=> Assert.NotNull(ThisAssembly.Resources.Content.Styles.Custom.Text); | ||
[Fact] | ||
public void CanUseTextResource() | ||
=> Assert.NotNull(ThisAssembly.Resources.Content.Styles.Custom.Text); | ||
|
||
[Fact] | ||
public void CanUseByteResource() | ||
=> Assert.NotNull(ThisAssembly.Resources.Content.Styles.Main.GetBytes()); | ||
[Fact] | ||
public void CanUseByteResource() | ||
=> Assert.NotNull(ThisAssembly.Resources.Content.Styles.Main.GetBytes()); | ||
|
||
[Fact] | ||
public void CanUseSameNameDifferentExtensions() | ||
=> Assert.NotNull(ThisAssembly.Resources.Content.Swagger.swagger_ui.css.GetBytes()); | ||
[Fact] | ||
public void CanUseSameNameDifferentExtensions() | ||
=> Assert.NotNull(ThisAssembly.Resources.Content.Swagger.swagger_ui.css.GetBytes()); | ||
|
||
[Fact] | ||
public void CanUseFileInvalidCharacters() | ||
=> Assert.NotNull(ThisAssembly.Resources.webhook_data.Text); | ||
[Fact] | ||
public void CanUseFileInvalidCharacters() | ||
=> Assert.NotNull(ThisAssembly.Resources.webhook_data.Text); | ||
|
||
[Fact] | ||
public void CanUseGitConstants() | ||
=> Assert.NotEmpty(ThisAssembly.Git.Commit); | ||
[Fact] | ||
public void CanUseGitConstants() | ||
=> Assert.NotEmpty(ThisAssembly.Git.Commit); | ||
|
||
[Fact] | ||
public void CanUseGitBranchConstants() | ||
{ | ||
Assert.NotEmpty(ThisAssembly.Git.Branch); | ||
Output.WriteLine(ThisAssembly.Git.Branch); | ||
} | ||
} |