Skip to content

Commit c74e8e2

Browse files
committed
Corrected the generated version and added a unit test for it (#1894)
1 parent f3a07e5 commit c74e8e2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/Magick.NET.Tests/MagickNETTests/TheVersionProperty.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,11 @@ public void ShouldContainTheCorrectFramework()
4545
Assert.Contains("net8.0", MagickNET.Version);
4646
#endif
4747
}
48+
49+
[Fact]
50+
public void ShouldContainTheCorrectVersion()
51+
{
52+
Assert.Contains("14.8.1", MagickNET.Version);
53+
}
4854
}
4955
}

tools/Magick.NET.SourceGenerator/AssemblyInfo/MagickVersionGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private string GetVersion(GeneratorAttributeSyntaxContext context)
2929
.ConstructorArguments.FirstOrDefault().Value?.ToString();
3030

3131
var version = assemblyAttributes
32-
.Single(attribute => attribute.AttributeClass?.ToDisplayString() == typeof(AssemblyVersionAttribute).FullName)
32+
.Single(attribute => attribute.AttributeClass?.ToDisplayString() == typeof(AssemblyFileVersionAttribute).FullName)
3333
.ConstructorArguments.FirstOrDefault().Value?.ToString();
3434

3535
if (title is null || version is null)

0 commit comments

Comments
 (0)