Skip to content

Commit

Permalink
Merge pull request #4940 from microsoft/ci/enum-preview-test-failure
Browse files Browse the repository at this point in the history
ci: fixes preview generated code unit test failure introduced by #4907
  • Loading branch information
andrueastman authored Jul 5, 2024
2 parents 238fd09 + 8f5a624 commit f050268
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void WritesGeneratedCodeAttribute()
{
codeElementWriter.WriteCodeElement(parentClass.StartBlock, writer);
var result = tw.ToString();
var pattern = @"\s+\[global::System\.CodeDom\.Compiler\.GeneratedCode\(""Kiota"", ""[0-9]+\.[0-9]+\.[0-9]+\""\)\]";
Assert.Matches(pattern, result);
Assert.Matches(CodeEnumWriterTests.GeneratedCodePattern, result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ public void DoesntWriteAnythingOnNoOption()
Assert.Empty(result);
}

internal const string GeneratedCodePattern = @"\s+\[global::System\.CodeDom\.Compiler\.GeneratedCode\(""Kiota"", ""[0-9]+\.[0-9]+\.[0-9]+(?:-preview\.\d+)?""\)\]";
[Fact]
public void WritesGeneratedCodeAttribute()
{
currentEnum.AddOption(new CodeEnumOption { Name = "option2" });
writer.Write(currentEnum);
var result = tw.ToString();
var pattern = @"\s+\[global::System\.CodeDom\.Compiler\.GeneratedCode\(""Kiota"", ""[0-9]+\.[0-9]+\.[0-9]+\""\)\]";
Assert.Matches(pattern, result);
Assert.Matches(GeneratedCodePattern, result);
}
}

0 comments on commit f050268

Please sign in to comment.