From 1c01f7b0e64167789893aea0ec4f1ab46105956d Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Mon, 26 Feb 2024 16:41:30 +1000 Subject: [PATCH] Install NUnit.Analyzers package (#643) +semver:patch --- .editorconfig | 1 + .../FluentNHibernate.Testing.csproj | 4 ++++ .../Testing/XmlWriterTestHelper.cs | 7 +++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0f51d3260..6bb00606a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,6 +18,7 @@ insert_final_newline = true csharp_style_namespace_declarations = file_scoped dotnet_diagnostic.ide0161.severity = warning +dotnet_diagnostic.NUnit1032.severity = suggestion # ReSharper properties resharper_default_private_modifier = implicit diff --git a/src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj b/src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj index 7e3897c01..aef2834db 100644 --- a/src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj +++ b/src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj @@ -22,6 +22,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/FluentNHibernate.Testing/Testing/XmlWriterTestHelper.cs b/src/FluentNHibernate.Testing/Testing/XmlWriterTestHelper.cs index 7fc977260..8d8ceac1c 100644 --- a/src/FluentNHibernate.Testing/Testing/XmlWriterTestHelper.cs +++ b/src/FluentNHibernate.Testing/Testing/XmlWriterTestHelper.cs @@ -99,10 +99,9 @@ internal void Check(XmlDocument document) document.OutputXmlToConsole(); Assert.That(areEqual, - "Property '{0}' was set to '{1}' and was expected to be written to attribute '{2}' with value '{3}'. The value was instead '{4}'", - sourceProperty.InnerMember.MemberInfo.ReflectedType.Name + "." + sourceProperty.Name, - sourceValue, check.Key, check.Value, attributeValue - ); + $"Property '{sourceProperty.InnerMember.MemberInfo.ReflectedType?.Name}.{sourceProperty.Name}' was set to '{sourceValue}' " + + $"and was expected to be written to attribute '{check.Key}' with value '{check.Value}'. " + + $"The value was instead '{attributeValue}'"); //string.Equals() //rootElement.AttributeShouldEqual(check.Key, check.Value.ToString()); //rootElement.Attributes[check.Key].Value.ShouldBeEqualIgnoringCase(check.Value.ToString());