Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions test/UniTest.Sass/VariableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@

namespace UniTest.Sass;

public partial class VariableTest
public partial class VariableTest(ITestOutputHelper testOutputHelper)
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary constructor parameter testOutputHelper is captured but never used in the class. Consider storing it in a field or property if it's needed for test output, or remove it if it's not required.

Suggested change
public partial class VariableTest(ITestOutputHelper testOutputHelper)
public partial class VariableTest

Copilot uses AI. Check for mistakes.
{
private ITestOutputHelper _outputHelper;

public VariableTest(ITestOutputHelper testOutputHelper)
{
_outputHelper = testOutputHelper;
}

[Fact]
public void Variable_Ok()
{
Expand All @@ -24,7 +17,7 @@ public void Variable_Ok()
var sassFilePath = Path.Combine(rootPath, "Components");
Assert.True(Directory.Exists(sassFilePath));

var variableFile = Path.Combine(rootPath, "wwwroot/scss/theme/bootstrapblazor.scss");
var variableFile = Path.Combine(rootPath, "wwwroot/scss/variables.scss");
Assert.True(File.Exists(variableFile));

// 获取所有 Sass 文件所有变量
Expand Down Expand Up @@ -53,7 +46,7 @@ void ValidateVariable(string scssFile, List<string> variables)

// #{$alert-icon-margin-right}
var matches = regex.Matches(item);
if (matches.Any())
if (matches.Count != 0)
{
var v = matches.Where(i => !variables.Contains(i.Groups[1].Value)).Select(i => i.Groups[1].Value);
if (v.Any())
Expand All @@ -72,7 +65,7 @@ void CheckMixVariable(string item)
var matches = mixRegex.Matches(item);
if (item.Contains("@mixin "))
{
if (matches.Any())
if (matches.Count != 0)
{
var groups = matches[0];
for (int index = 1; index < groups.Groups.Count; index++)
Expand Down
Loading