Skip to content

Commit 126203f

Browse files
Use AssemblyProductAttribute to detect AwesomeAssertions
1 parent 2b00581 commit 126203f

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.15.0.0
4+
5+
Use `AssemblyProductAttribute` to detect AwesomeAssertions (as provided via [this PR](https://github.com/AwesomeAssertions/AwesomeAssertions/pull/30))
6+
37
## 0.14.0.0
48

59
Fix a packaging issue that caused the abstractions not to be part of the package.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.14.0.0</Version>
3+
<Version>0.15.0.0</Version>
44
<Authors>Sander van Vliet</Authors>
55
<Company>Codenizer BV</Company>
66
<Copyright>2025 Sander van Vliet</Copyright>

src/Serilog.Sinks.InMemory.Assertions/InMemorySinkExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ private static bool IsAwesomeAssertionsAvailableOnDisk(
182182
{
183183
assembly = Assembly.LoadFile(assemblyPath);
184184

185+
if (assembly.GetCustomAttributes<AssemblyProductAttribute>()
186+
.Any(product =>
187+
product.Product.Equals("AwesomeAssertions", StringComparison.CurrentCultureIgnoreCase)))
188+
{
189+
return true;
190+
}
191+
185192
if (assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
186193
.Any(metadata => metadata.Value.Contains("AwesomeAssertions", StringComparison.OrdinalIgnoreCase)))
187194
{

0 commit comments

Comments
 (0)