From 291bf34cb16917c5acf4fdfe6419d525038938e8 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 3 Oct 2024 14:54:44 +0700 Subject: [PATCH] Added .NET Standard 2.0 to SIL.Archiving Test library targets .NET8. I did have to make a few tests which were testing for exact strings a little less specific, since the message varies between frameworks. They are different, since directory checking works differently between frameworks, but the core failure+warning is present. --- SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs | 6 +++--- SIL.Archiving.Tests/SIL.Archiving.Tests.csproj | 1 + SIL.Archiving/SIL.Archiving.csproj | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs b/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs index f14166905..10f7bb0a3 100644 --- a/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs +++ b/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs @@ -99,7 +99,7 @@ public void PathIsAccessible_NonexistentPath_False() var writable = _model.IsPathWritable(dir); Assert.False(writable); Assert.AreEqual(1, m_messages.Count); - Assert.AreEqual("Test implementation message for PathNotWritable", m_messages[0].MsgText); + Assert.IsTrue(m_messages[0].MsgText.ToLower().Contains("path"), "Error should mention the path in its explanation."); Assert.AreEqual(ArchivingDlgViewModel.MessageType.Warning, m_messages[0].MsgType); } @@ -111,7 +111,7 @@ public void IsPathWritable_WindowsInvalidPath_False() var writable = _model.IsPathWritable(dir); Assert.False(writable); Assert.AreEqual(1, m_messages.Count); - Assert.IsTrue(m_messages[0].MsgText.Contains("path"), "Error should mention the path in its explanation."); + Assert.IsTrue(m_messages[0].MsgText.ToLower().Contains("path"), "Error should mention the path in its explanation."); Assert.AreEqual(ArchivingDlgViewModel.MessageType.Warning, m_messages[0].MsgType); } @@ -122,7 +122,7 @@ public void IsPathWritable_IllegalCharacterInPath_False() var writable = _model.IsPathWritable(dir); Assert.False(writable); Assert.AreEqual(1, m_messages.Count); - Assert.IsTrue(m_messages[0].MsgText.Contains("path"), "Error should mention the path in its explanation."); + Assert.IsTrue(m_messages[0].MsgText.ToLower().Contains("path"), "Error should mention the path in its explanation."); Assert.AreEqual(ArchivingDlgViewModel.MessageType.Warning, m_messages[0].MsgType); } diff --git a/SIL.Archiving.Tests/SIL.Archiving.Tests.csproj b/SIL.Archiving.Tests/SIL.Archiving.Tests.csproj index 918907f46..99850ec00 100644 --- a/SIL.Archiving.Tests/SIL.Archiving.Tests.csproj +++ b/SIL.Archiving.Tests/SIL.Archiving.Tests.csproj @@ -7,6 +7,7 @@ false true true + $(TargetFrameworks);net8.0 diff --git a/SIL.Archiving/SIL.Archiving.csproj b/SIL.Archiving/SIL.Archiving.csproj index 5bcf82d5b..418f6f18d 100644 --- a/SIL.Archiving/SIL.Archiving.csproj +++ b/SIL.Archiving/SIL.Archiving.csproj @@ -4,6 +4,7 @@ SIL.Archiving SIL.Archiving SIL.Archiving contains classes for archiving data to REAP and IMDI. + $(TargetFrameworks);netstandard2.0