diff --git a/Ramone.MediaTypes.Atom/Ramone.MediaTypes.Atom.csproj b/Ramone.MediaTypes.Atom/Ramone.MediaTypes.Atom.csproj index c2c6510..fc53425 100644 --- a/Ramone.MediaTypes.Atom/Ramone.MediaTypes.Atom.csproj +++ b/Ramone.MediaTypes.Atom/Ramone.MediaTypes.Atom.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netcoreapp3.1;net48 + netstandard2.0;net48 diff --git a/Ramone.MediaTypes.Html/Ramone.MediaTypes.Html.csproj b/Ramone.MediaTypes.Html/Ramone.MediaTypes.Html.csproj index 7ab1022..6194b5e 100644 --- a/Ramone.MediaTypes.Html/Ramone.MediaTypes.Html.csproj +++ b/Ramone.MediaTypes.Html/Ramone.MediaTypes.Html.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp3.1;net48 + netstandard2.0;net48 diff --git a/Ramone.OAuth2/Ramone.OAuth2.csproj b/Ramone.OAuth2/Ramone.OAuth2.csproj index 32a0bc7..d4e2d7f 100644 --- a/Ramone.OAuth2/Ramone.OAuth2.csproj +++ b/Ramone.OAuth2/Ramone.OAuth2.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netcoreapp3.1;net48 + netstandard2.0;net48 diff --git a/Ramone.Tests.Common/SetupFixture.cs b/Ramone.Tests.Common/SetupFixture.cs index e53cbfc..ed91246 100644 --- a/Ramone.Tests.Common/SetupFixture.cs +++ b/Ramone.Tests.Common/SetupFixture.cs @@ -17,7 +17,7 @@ namespace Ramone.Tests.Common public class SetupFixture { [OneTimeSetUp] - public void Setup() + public virtual void Setup() { Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetAssembly(typeof(SetupFixture)).Location); AtomInitializer.Initialize(); diff --git a/Ramone.Tests/ApplicationErrorTests.cs b/Ramone.Tests/ApplicationErrorTests.cs index 6d8a5e6..6b601a5 100644 --- a/Ramone.Tests/ApplicationErrorTests.cs +++ b/Ramone.Tests/ApplicationErrorTests.cs @@ -62,6 +62,7 @@ public void ItSignalsMissingSessionWhenDecodingResponse() // Example: for some odd reasons a web response is created outside of Ramone and we now try to decode it, // but without a session at hand. +#pragma warning disable SYSLIB0014 WebRequest request = WebRequest.Create(BindingExtensions.BindTemplate(BaseUrl, DossierTemplate, new { id = 8 })); using (WebResponse response = request.GetResponse()) { @@ -70,6 +71,7 @@ public void ItSignalsMissingSessionWhenDecodingResponse() () => ramoneResponse.Decode(), ex => ex.Message.Contains("session")); } +#pragma warning restore SYSLIB0014 } } } diff --git a/Ramone.Tests/Blog/HtmlDocumentTests.cs b/Ramone.Tests/Blog/HtmlDocumentTests.cs index 8a784e4..f1730a4 100644 --- a/Ramone.Tests/Blog/HtmlDocumentTests.cs +++ b/Ramone.Tests/Blog/HtmlDocumentTests.cs @@ -143,7 +143,7 @@ public void CanAddNewBlogItemIncludingImage() IKeyValueForm form = createDescriptor.Body.DocumentNode.SelectNodes(@"//form[@id=""create""]").First().Form(createDescriptor); // - Populate form inputs - IFile file = new File("..\\..\\data1.gif", "image/gif"); + IFile file = new File("..\\..\\..\\data1.gif", "image/gif"); form.Value("Title", "New item"); form.Value("Text", "Yaj!"); form.Value("Image", file); diff --git a/Ramone.Tests/Blog/TypedHtmlTests.cs b/Ramone.Tests/Blog/TypedHtmlTests.cs index 5845c00..e8bc3a8 100644 --- a/Ramone.Tests/Blog/TypedHtmlTests.cs +++ b/Ramone.Tests/Blog/TypedHtmlTests.cs @@ -137,7 +137,7 @@ public void CanAddNewBlogItemIncludingImage() { Title = "New item", Text = "Yaj!", - Image = new File("..\\..\\data1.gif", "image/gif") + Image = new File("..\\..\\..\\data1.gif", "image/gif") }; form.Value(args); diff --git a/Ramone.Tests/MediaTypes/MultipartFormData/MultipartFormDataTests.cs b/Ramone.Tests/MediaTypes/MultipartFormData/MultipartFormDataTests.cs index 4541934..496b87d 100644 --- a/Ramone.Tests/MediaTypes/MultipartFormData/MultipartFormDataTests.cs +++ b/Ramone.Tests/MediaTypes/MultipartFormData/MultipartFormDataTests.cs @@ -57,7 +57,7 @@ public class MultipartDataFile public void CanPostMultipartFormDataWithFileUsingHashtable() { // Arrange - IFile file = new File("..\\..\\data1.txt"); + IFile file = new File("..\\..\\..\\data1.txt"); Hashtable data = new Hashtable(); data["DataFile"] = file; data["Age"] = 10; @@ -77,7 +77,7 @@ public void CanPostMultipartFormDataWithFileUsingHashtable() public void CanPostMultipartFormDataWithFile() { // Arrange - IFile file = new File("..\\..\\data1.txt"); + IFile file = new File("..\\..\\..\\data1.txt"); MultipartDataFile data = new MultipartDataFile { DataFile = file, Age = 10 }; Request formdataReq = Session.Bind(MultipartFormDataFileTemplate); @@ -97,7 +97,7 @@ public void CanPostMultipartFormDataWithFile() public void CanPostMultipartFormDataWithSpecialFilenameUsingHashtable_ItMustReplaceSpecialCharsWithX() { // Arrange - IFile file = new FileWithSpecialName("..\\..\\data1.txt", "Bøllefrø.txt"); + IFile file = new FileWithSpecialName("..\\..\\..\\data1.txt", "Bøllefrø.txt"); Hashtable data = new Hashtable(); data["DataFile"] = file; data["Age"] = 10; @@ -117,7 +117,7 @@ public void CanPostMultipartFormDataWithSpecialFilenameUsingHashtable_ItMustRepl public void CanPostMultipartFormDataWithSpecialFilename_ItMustReplaceSpecialCharsWithX() { // Arrange - IFile file = new FileWithSpecialName("..\\..\\data1.txt", "Bøllefrø.txt"); + IFile file = new FileWithSpecialName("..\\..\\..\\data1.txt", "Bøllefrø.txt"); MultipartDataFile data = new MultipartDataFile { DataFile = file, Age = 10 }; Request formdataReq = Session.Bind(MultipartFormDataFileTemplate); @@ -156,7 +156,7 @@ public void CanPostMultipartFormDataWithFilenameContainingQuotes() public void CanPostMultipartFormDataWithBinaryFile() { // Arrange - IFile file = new File("..\\..\\data1.gif", "image/gif"); + IFile file = new File("..\\..\\..\\data1.gif", "image/gif"); MultipartDataFile data = new MultipartDataFile { DataFile = file, Age = 99 }; Request formdataReq = Session.Bind(MultipartFormDataFileTemplate); @@ -174,7 +174,7 @@ public void CanPostMultipartFormDataWithBinaryFile() public void CanPostMultipartFormDataWithAdditionalFilenameSpecified() { // Arrange - IFile file = new File("..\\..\\data1.gif", "image/gif", "other-filename.guf"); + IFile file = new File("..\\..\\..\\data1.gif", "image/gif", "other-filename.guf"); MultipartDataFile data = new MultipartDataFile { DataFile = file, Age = 99 }; Request formdataReq = Session.Bind(MultipartFormDataFileTemplate); diff --git a/Ramone.Tests/MediaTypes/Xml/XmlDocumentCodecTests.cs b/Ramone.Tests/MediaTypes/Xml/XmlDocumentCodecTests.cs index 9c6cc8a..a451076 100644 --- a/Ramone.Tests/MediaTypes/Xml/XmlDocumentCodecTests.cs +++ b/Ramone.Tests/MediaTypes/Xml/XmlDocumentCodecTests.cs @@ -5,7 +5,6 @@ using Ramone.Tests.Common; using Ramone.MediaTypes.Xml; - namespace Ramone.Tests.MediaTypes.Xml { [TestFixture] diff --git a/Ramone.Tests/Properties/AssemblyInfo.cs b/Ramone.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 8fc5524..0000000 --- a/Ramone.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Ramone.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Ramone.Tests")] -[assembly: AssemblyCopyright("Copyright © 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("aa7e8e21-1af2-4f53-a1fc-790f96b20a6f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Ramone.Tests/Ramone.Tests.csproj b/Ramone.Tests/Ramone.Tests.csproj index 5609115..ae515bf 100644 --- a/Ramone.Tests/Ramone.Tests.csproj +++ b/Ramone.Tests/Ramone.Tests.csproj @@ -1,270 +1,26 @@ - - + - Debug - AnyCPU - 9.0.30729 - 2.0 - {D1BE3B6D-C886-4C78-8826-036E5834A08E} - Library - Properties - Ramone.Tests - Ramone.Tests - v4.8 - 512 - - - 3.5 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - + net48;net6 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - false - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - - - - 3.5 - - - - - 3.5 - + + - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {082e983f-80bb-4cfa-81aa-907199b5eebb} - Ramone.MediaTypes.Atom - - - {b9dd3260-d1f0-4da5-9bd1-58a1ffcefad5} - Ramone.MediaTypes.Html - - - {8cc811ec-d8f6-44d6-bf3c-026385956d5a} - Ramone.OAuth2 - - - {DD3B040F-3D75-4C46-BB54-CD06F594F894} - Ramone.Tests.Common - - - {b20077d3-7f5d-4ef5-af35-22ca78c8790f} - Ramone - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - Designer - + + - - 4.1.0 - - - 4.1.0 - runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive - - 4.5.0 - + + + + + + + - - \ No newline at end of file diff --git a/Ramone.Tests/SetupFixture.cs b/Ramone.Tests/SetupFixture.cs index 540d87c..bf59488 100644 --- a/Ramone.Tests/SetupFixture.cs +++ b/Ramone.Tests/SetupFixture.cs @@ -1,9 +1,17 @@ -using NUnit.Framework; +using System.Text; +using NUnit.Framework; namespace Ramone.Tests { [SetUpFixture] public class SetupFixture : Common.SetupFixture { + public override void Setup() + { + base.Setup(); +#if NET6_0_OR_GREATER + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); +#endif + } } } diff --git a/Ramone.Tests/Utility/FormUrlEncodingSerializerTests.cs b/Ramone.Tests/Utility/FormUrlEncodingSerializerTests.cs index 9267f64..636e0bf 100644 --- a/Ramone.Tests/Utility/FormUrlEncodingSerializerTests.cs +++ b/Ramone.Tests/Utility/FormUrlEncodingSerializerTests.cs @@ -103,7 +103,7 @@ public void WhenSerializingHashtableOnlyItIncludesContentWithNoPrefix() hashtable["B"] = "xyz"; // Act - CheckSerialization("A=123&B=xyz", hashtable); + CheckSerialization("A=123&B=xyz", hashtable, "B=xyz&A=123"); } @@ -118,7 +118,7 @@ public void WhenDataIsNullItIsNotSendAsEmptyString() } - protected void CheckSerialization(string expected, object data) + protected void CheckSerialization(string expected, object data, string alternative = "") { using (MemoryStream s = new MemoryStream()) using (StreamWriter w = new StreamWriter(s)) @@ -132,7 +132,7 @@ protected void CheckSerialization(string expected, object data) using (StreamReader r = new StreamReader(s, Encoding.ASCII)) { string result = r.ReadToEnd(); - Assert.That(result, Is.EqualTo(expected)); + Assert.That(result, Is.EqualTo(expected).Or.EqualTo(alternative)); } } } diff --git a/Ramone.Tests/Utility/MultipartFormDataSerializerTests.cs b/Ramone.Tests/Utility/MultipartFormDataSerializerTests.cs index 03a6cca..9da2c44 100644 --- a/Ramone.Tests/Utility/MultipartFormDataSerializerTests.cs +++ b/Ramone.Tests/Utility/MultipartFormDataSerializerTests.cs @@ -55,7 +55,7 @@ public void CanSerializeFile() FileData data = new FileData { MyString = "Abc ÆØÅ", - MyFile = new Ramone.IO.File("..\\..\\data1.txt") + MyFile = new Ramone.IO.File("..\\..\\..\\data1.txt") }; new MultipartFormDataSerializer(typeof(FileData)).Serialize(s, data, Encoding.UTF8, "xyzq"); @@ -91,7 +91,7 @@ public void CanSerializeFileWithInternationalCharactersInFilenameWhenSettingsAll { FileData data = new FileData { - MyFile = new FileWithSpecialName("..\\..\\data1.txt", "Bøllefrø.txt") + MyFile = new FileWithSpecialName("..\\..\\..\\data1.txt", "Bøllefrø.txt") }; new MultipartFormDataSerializer(typeof(FileData)).Serialize(s, data, Encoding.UTF8, "xyzq", settings); @@ -122,7 +122,7 @@ public void CannotSerializeFileWithInternationalCharactersInFilenameWhenSettings { FileData data = new FileData { - MyFile = new FileWithSpecialName("..\\..\\data1.txt", "Bøllefrø.txt") + MyFile = new FileWithSpecialName("..\\..\\..\\data1.txt", "Bøllefrø.txt") }; new MultipartFormDataSerializer(typeof(FileData)).Serialize(s, data, Encoding.UTF8, "xyzq", settings); @@ -151,7 +151,7 @@ public void CanSerializeBinaryFileWithContentType() FileData data = new FileData { MyString = "Abc ÆØÅ", - MyFile = new Ramone.IO.File("..\\..\\data1.gif", "image/gif") + MyFile = new Ramone.IO.File("..\\..\\..\\data1.gif", "image/gif") }; new MultipartFormDataSerializer(typeof(FileData)).Serialize(s, data, Encoding.UTF8, "xyzq"); diff --git a/Ramone.Tests/Utility/ObjectSerializerTests.cs b/Ramone.Tests/Utility/ObjectSerializerTests.cs index d88fdcb..0ec5788 100644 --- a/Ramone.Tests/Utility/ObjectSerializerTests.cs +++ b/Ramone.Tests/Utility/ObjectSerializerTests.cs @@ -177,8 +177,8 @@ public void CanSerializeWithDifferentSeparatorFormaters() B = new string[] { "abc", "xyz" }, A = new Hashtable() }; - ((Hashtable)o.A)["p"] = 17; - ((Hashtable)o.A)["q"] = "abc"; + o.A["p"] = 17; + o.A["q"] = "abc"; ObjectSerializerSettings settings = new ObjectSerializerSettings { @@ -191,7 +191,8 @@ public void CanSerializeWithDifferentSeparatorFormaters() string result = Serialize(o, settings); // Assert - Assert.That(result, Is.EqualTo("|B:0=abc|B:1=xyz|A#p=17|A#q=abc")); + // - Check two different outcomes since Hashtable is not ordered. + Assert.That(result, Is.EqualTo("|B:0=abc|B:1=xyz|A#p=17|A#q=abc").Or.EqualTo("|B:0=abc|B:1=xyz|A#q=abc|A#p=17")); } diff --git a/Ramone/Ramone.csproj b/Ramone/Ramone.csproj index e11dfe6..e481e5b 100644 --- a/Ramone/Ramone.csproj +++ b/Ramone/Ramone.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp3.1;net48 + netstandard2.0;net48