From 892f95f24209a410738b1697168162377c72d5d6 Mon Sep 17 00:00:00 2001 From: Kevin Hobson Date: Sat, 20 Jul 2019 11:07:57 -0700 Subject: [PATCH 01/11] update for nunit3 --- SODA.Tests/HumanAddressTests.cs | 4 +- SODA.Tests/PhoneColumnTest.cs | 4 +- SODA.Tests/ResourceTests.cs | 4 +- SODA.Tests/SODA.Tests.csproj | 16 +++- SODA.Tests/SodaClientTests.cs | 86 +++++++++---------- SODA.Tests/SodaRequestTests.cs | 10 +-- SODA.Tests/SodaUriTests.cs | 84 +++++++++--------- SODA.Tests/SoqlQueryTests.cs | 20 ++--- SODA.Tests/packages.config | 3 +- Utilities.Tests/DataFileExporterTests.cs | 37 ++++---- Utilities.Tests/ExcelDataReaderHelperTests.cs | 6 ++ Utilities.Tests/FileLoggingTests.cs | 30 ++++--- .../SeparatedValuesSerializerTests.cs | 48 +++++------ Utilities.Tests/Utilities.Tests.csproj | 16 +++- Utilities.Tests/packages.config | 3 +- 15 files changed, 203 insertions(+), 168 deletions(-) diff --git a/SODA.Tests/HumanAddressTests.cs b/SODA.Tests/HumanAddressTests.cs index 1e6a862..8345de7 100644 --- a/SODA.Tests/HumanAddressTests.cs +++ b/SODA.Tests/HumanAddressTests.cs @@ -28,11 +28,11 @@ public void New_Deserializes_Valid_HumanAddress_Json() [TestCase("not json")] [TestCase(@"{""not"":""a"",""human"":""address""}")] - [ExpectedException(typeof(ArgumentOutOfRangeException))] + //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("HumanAddress")] public void New_Throws_ArgumentOutOfRangeException_For_Invalid_HumanAddress_Json(string input) { - new HumanAddress(input); + Assert.That(() => new HumanAddress(input), Throws.TypeOf()); } [Test] diff --git a/SODA.Tests/PhoneColumnTest.cs b/SODA.Tests/PhoneColumnTest.cs index 5b284a8..1907a2e 100644 --- a/SODA.Tests/PhoneColumnTest.cs +++ b/SODA.Tests/PhoneColumnTest.cs @@ -88,11 +88,11 @@ public void New_Deserializes_PhoneColumn_For_No_Type_Json() [TestCase("not json")] [TestCase(@"{""not"":""a"",""valid"":""phone""}")] - [ExpectedException(typeof(ArgumentOutOfRangeException))] + //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("PhoneColumn")] public void New_Throws_ArgumentOutOfRangeException_For_Invalid_PhoneColumn_Json(string input) { - new PhoneColumn(input); + Assert.That(() => new PhoneColumn(input), Throws.TypeOf()); } } } diff --git a/SODA.Tests/ResourceTests.cs b/SODA.Tests/ResourceTests.cs index 8989ad1..6b0f5b9 100644 --- a/SODA.Tests/ResourceTests.cs +++ b/SODA.Tests/ResourceTests.cs @@ -70,11 +70,11 @@ public void New_Gets_Metadata_Identifier() [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NullInput)] - [ExpectedException(typeof(ArgumentException))] + //[ExpectedException(typeof(ArgumentException))] [Category("Resource")] public void GetRow_With_Invalid_RowId_Throws_ArugmentException(string input) { - new Resource(mockMetadata).GetRow(input); + Assert.That(() => new Resource(mockMetadata).GetRow(input), Throws.TypeOf()); } } } diff --git a/SODA.Tests/SODA.Tests.csproj b/SODA.Tests/SODA.Tests.csproj index a82370c..2854fbf 100644 --- a/SODA.Tests/SODA.Tests.csproj +++ b/SODA.Tests/SODA.Tests.csproj @@ -1,5 +1,7 @@  + + Debug AnyCPU @@ -22,6 +24,8 @@ SAK ..\ + + true @@ -44,9 +48,8 @@ - - False - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + ..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll @@ -112,6 +115,13 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/Net45.Tests/Properties/AssemblyInfo.cs b/Net45.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..730a27f --- /dev/null +++ b/Net45.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Net45.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Net45.Tests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("309fa03e-e032-4547-a83c-389ec450fd1a")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SODA.Tests/packages.config b/Net45.Tests/packages.config similarity index 100% rename from SODA.Tests/packages.config rename to Net45.Tests/packages.config diff --git a/NetCore22.Tests/NetCore22.Tests.csproj b/NetCore22.Tests/NetCore22.Tests.csproj new file mode 100644 index 0000000..68e00f8 --- /dev/null +++ b/NetCore22.Tests/NetCore22.Tests.csproj @@ -0,0 +1,23 @@ + + + + netcoreapp2.2 + + false + + NetCore22.Tests + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SODA.Tests/Properties/AssemblyInfo.cs b/SODA.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 7bd4013..0000000 --- a/SODA.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("SODA.Tests")] -[assembly: AssemblyDescription("Test project for the SODA library.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("City of Santa Monica")] -[assembly: AssemblyProduct("SODA.Tests")] -[assembly: AssemblyCopyright("Copyright © City of Santa Monica 2014")] -[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("7f9cf47c-8168-48eb-82b3-a82249c0346e")] - -// 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/SODA.Tests/SODA.Tests.projitems b/SODA.Tests/SODA.Tests.projitems new file mode 100644 index 0000000..b90e2eb --- /dev/null +++ b/SODA.Tests/SODA.Tests.projitems @@ -0,0 +1,28 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 1112171d-6a3f-49f6-818a-fb44195ac837 + + + SODA.Tests + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SODA.Tests/SODA.Tests.shproj b/SODA.Tests/SODA.Tests.shproj new file mode 100644 index 0000000..61ec44e --- /dev/null +++ b/SODA.Tests/SODA.Tests.shproj @@ -0,0 +1,13 @@ + + + + 1112171d-6a3f-49f6-818a-fb44195ac837 + 14.0 + + + + + + + + diff --git a/SODA.sln b/SODA.sln index da01369..616b4e5 100644 --- a/SODA.sln +++ b/SODA.sln @@ -1,12 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29102.190 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SODA", "SODA\SODA.csproj", "{837EBDD7-EB58-44F8-834B-F2903A05A16E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SODA.Tests", "SODA.Tests\SODA.Tests.csproj", "{6872AC23-29E5-4EDB-A826-A3FC35AAFDA0}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{970C9034-3C0D-47ED-82F5-CCEDD67B7EB0}" ProjectSection(SolutionItems) = preProject .gitattributes = .gitattributes @@ -21,41 +17,69 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution SolutionInfo.cs = SolutionInfo.cs EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utilities", "Utilities\Utilities.csproj", "{63B7FAD7-5927-417C-AD2A-608D777AD1A7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{C2E27366-ABDF-4FE3-A399-A6792C33D437}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SODA", "SODA\SODA.csproj", "{8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utilities.Tests", "Utilities.Tests\Utilities.Tests.csproj", "{6AAB405A-D32F-4D8B-B491-BDD5088561A7}" +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SODA.Tests", "SODA.Tests\SODA.Tests.shproj", "{1112171D-6A3F-49F6-818A-FB44195AC837}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{C2E27366-ABDF-4FE3-A399-A6792C33D437}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net45.Tests", "Net45.Tests\Net45.Tests.csproj", "{309FA03E-E032-4547-A83C-389EC450FD1A}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Utilities.Tests", "Utilities.Tests\Utilities.Tests.shproj", "{651FB983-B00B-445A-960B-850D21D17DB0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utilities.Net45.Tests", "Utilities.Net45.Tests\Utilities.Net45.Tests.csproj", "{763FFFCB-49DD-4A86-B5A1-B51EA15CE764}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utilities", "Utilities\Utilities.csproj", "{3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utilities.NetCore22.Tests", "Utilities.NetCore22.Tests\Utilities.NetCore22.Tests.csproj", "{D7644A62-B301-46EF-A998-8E2658936943}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore22.Tests", "NetCore22.Tests\NetCore22.Tests.csproj", "{37857C2C-3398-4896-8011-ECF5061B7528}" EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + SODA.Tests\SODA.Tests.projitems*{1112171d-6a3f-49f6-818a-fb44195ac837}*SharedItemsImports = 13 + SODA.Tests\SODA.Tests.projitems*{309fa03e-e032-4547-a83c-389ec450fd1a}*SharedItemsImports = 4 + Utilities.Tests\Utilities.Tests.projitems*{651fb983-b00b-445a-960b-850d21d17db0}*SharedItemsImports = 13 + Utilities.Tests\Utilities.Tests.projitems*{763fffcb-49dd-4a86-b5a1-b51ea15ce764}*SharedItemsImports = 4 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {837EBDD7-EB58-44F8-834B-F2903A05A16E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {837EBDD7-EB58-44F8-834B-F2903A05A16E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {837EBDD7-EB58-44F8-834B-F2903A05A16E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {837EBDD7-EB58-44F8-834B-F2903A05A16E}.Release|Any CPU.Build.0 = Release|Any CPU - {6872AC23-29E5-4EDB-A826-A3FC35AAFDA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6872AC23-29E5-4EDB-A826-A3FC35AAFDA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6872AC23-29E5-4EDB-A826-A3FC35AAFDA0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6872AC23-29E5-4EDB-A826-A3FC35AAFDA0}.Release|Any CPU.Build.0 = Release|Any CPU - {63B7FAD7-5927-417C-AD2A-608D777AD1A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63B7FAD7-5927-417C-AD2A-608D777AD1A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63B7FAD7-5927-417C-AD2A-608D777AD1A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63B7FAD7-5927-417C-AD2A-608D777AD1A7}.Release|Any CPU.Build.0 = Release|Any CPU - {6AAB405A-D32F-4D8B-B491-BDD5088561A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AAB405A-D32F-4D8B-B491-BDD5088561A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AAB405A-D32F-4D8B-B491-BDD5088561A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AAB405A-D32F-4D8B-B491-BDD5088561A7}.Release|Any CPU.Build.0 = Release|Any CPU + {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Release|Any CPU.Build.0 = Release|Any CPU + {309FA03E-E032-4547-A83C-389EC450FD1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {309FA03E-E032-4547-A83C-389EC450FD1A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {309FA03E-E032-4547-A83C-389EC450FD1A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {309FA03E-E032-4547-A83C-389EC450FD1A}.Release|Any CPU.Build.0 = Release|Any CPU + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Debug|Any CPU.Build.0 = Debug|Any CPU + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Release|Any CPU.ActiveCfg = Release|Any CPU + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Release|Any CPU.Build.0 = Release|Any CPU + {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Release|Any CPU.Build.0 = Release|Any CPU + {D7644A62-B301-46EF-A998-8E2658936943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7644A62-B301-46EF-A998-8E2658936943}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7644A62-B301-46EF-A998-8E2658936943}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7644A62-B301-46EF-A998-8E2658936943}.Release|Any CPU.Build.0 = Release|Any CPU + {37857C2C-3398-4896-8011-ECF5061B7528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37857C2C-3398-4896-8011-ECF5061B7528}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37857C2C-3398-4896-8011-ECF5061B7528}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37857C2C-3398-4896-8011-ECF5061B7528}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {63B7FAD7-5927-417C-AD2A-608D777AD1A7} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} - {6AAB405A-D32F-4D8B-B491-BDD5088561A7} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} + {651FB983-B00B-445A-960B-850D21D17DB0} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} + {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} + {D7644A62-B301-46EF-A998-8E2658936943} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {17A9746D-4584-4AD5-B2FA-2A9EDFC6ED09} diff --git a/SODA/Properties/AssemblyInfo.cs b/SODA/Properties/AssemblyInfo.cs deleted file mode 100644 index fb4dca9..0000000 --- a/SODA/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("SODA")] -[assembly: AssemblyDescription("Socrata Open Data API client library targeting .NET 4.5 and above.")] -[assembly: InternalsVisibleTo("SODA.Tests")] \ No newline at end of file diff --git a/SODA/Resource.cs b/SODA/Resource.cs index 3bcec33..d02252a 100644 --- a/SODA/Resource.cs +++ b/SODA/Resource.cs @@ -1,8 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using SODA.Utilities; - +[assembly: InternalsVisibleTo("Net45.Tests")] +[assembly: InternalsVisibleTo("NetCore22.Tests")] namespace SODA { /// diff --git a/SODA/SODA.csproj b/SODA/SODA.csproj index 16c517c..b82833a 100644 --- a/SODA/SODA.csproj +++ b/SODA/SODA.csproj @@ -1,94 +1,28 @@ - - - + + - Debug - AnyCPU - {837EBDD7-EB58-44F8-834B-F2903A05A16E} - Library - Properties - SODA - SODA - v4.5 - 512 - SAK - SAK - SAK - SAK - - ..\ + netstandard2.0;net45 + Socrata Open Data API client library targeting .NET 4.5 and above. + CSM.SodaDotNet + 0.9.0 + City of Santa Monica, CA + City of Santa Monica, CA + Copyright 2019 City of Santa Monica, CA + API OpenData Socrata SODA + true + https://github.com/CityofSantaMonica/SODA.NET + MIT + + Package dependancies updated to latest releases + +Converted project to target multiple frameworks - Net Standard 2.0 and Net Framework 4.5 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\SODA.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\SODA.XML - - - - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - - - SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - Code - - - + - - + + + - - - \ No newline at end of file + + + diff --git a/SODA/SODA.nuspec b/SODA/SODA.nuspec deleted file mode 100644 index d76ea8e..0000000 --- a/SODA/SODA.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - CSM.SodaDotNet - $version$ - CSM.SodaDotNet - City of Santa Monica, CA - City of Santa Monica, CA - https://github.com/CityOfSantaMonica/SODA.NET/blob/master/LICENSE.txt - https://github.com/CityOfSantaMonica/SODA.NET - http://www.smgov.net/uploadedImages/Main/colorstd-R.gif - false - $description$ - - Copyright 2017 City of Santa Monica, CA - API OpenData Socrata SODA - - - - - \ No newline at end of file diff --git a/Utilities.Net45.Tests/Properties/AssemblyInfo.cs b/Utilities.Net45.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1992a67 --- /dev/null +++ b/Utilities.Net45.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Utilities.Net45.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Utilities.Net45.Tests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("763fffcb-49dd-4a86-b5a1-b51ea15ce764")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Utilities.Tests/Utilities.Tests.csproj b/Utilities.Net45.Tests/Utilities.Net45.Tests.csproj similarity index 50% rename from Utilities.Tests/Utilities.Tests.csproj rename to Utilities.Net45.Tests/Utilities.Net45.Tests.csproj index 9ea07fd..9878b21 100644 --- a/Utilities.Tests/Utilities.Tests.csproj +++ b/Utilities.Net45.Tests/Utilities.Net45.Tests.csproj @@ -1,29 +1,24 @@  - + + Debug AnyCPU - {6AAB405A-D32F-4D8B-B491-BDD5088561A7} + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764} Library Properties - SODA.Utilities.Tests - SODA.Utilities.Tests + Utilities.Net45.Tests + Utilities.Net45.Tests v4.5 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 + 15.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest - - SAK - SAK - SAK - SAK - ..\ @@ -35,7 +30,6 @@ DEBUG;TRACE prompt 4 - false pdbonly @@ -44,7 +38,6 @@ TRACE prompt 4 - false @@ -53,89 +46,32 @@ ..\packages\ExcelDataReader.DataSet.3.6.0\lib\net35\ExcelDataReader.DataSet.dll - - ..\packages\SharpZipLib.1.1.0\lib\net45\ICSharpCode.SharpZipLib.dll - - - ..\packages\Microsoft.Exchange.WebServices.2.2\lib\40\Microsoft.Exchange.WebServices.dll - - - ..\packages\Microsoft.Exchange.WebServices.2.2\lib\40\Microsoft.Exchange.WebServices.Auth.dll - ..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll - - 3.5 - + - - - - - - - - - - - - Code - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - {837ebdd7-eb58-44f8-834b-f2903a05a16e} + {8c71d7e2-8ef0-4d7e-9eeb-06b1458d235e} SODA - {63b7fad7-5927-417c-ad2a-608d777ad1a7} + {3ba86351-2e4b-45bb-8e92-b9e803cdcd6e} Utilities - - - - - False - - - False - - - False - - - False - - - - + + + + @@ -145,11 +81,4 @@ - \ No newline at end of file diff --git a/Utilities.Tests/packages.config b/Utilities.Net45.Tests/packages.config similarity index 61% rename from Utilities.Tests/packages.config rename to Utilities.Net45.Tests/packages.config index 3bb3021..f952d75 100644 --- a/Utilities.Tests/packages.config +++ b/Utilities.Net45.Tests/packages.config @@ -2,9 +2,6 @@ - - - \ No newline at end of file diff --git a/Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj b/Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj new file mode 100644 index 0000000..cf77e83 --- /dev/null +++ b/Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj @@ -0,0 +1,23 @@ + + + + netcoreapp2.2 + + false + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Utilities.Tests/ExcelDataReaderHelperTests.cs b/Utilities.Tests/ExcelDataReaderHelperTests.cs index 7d5da60..43151ce 100644 --- a/Utilities.Tests/ExcelDataReaderHelperTests.cs +++ b/Utilities.Tests/ExcelDataReaderHelperTests.cs @@ -13,6 +13,9 @@ public class ExcelDataReaderHelperTests public void TestInitialize() { Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory; +#if NETCOREAPP + System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); +#endif } [Test] diff --git a/Utilities.Tests/Properties/AssemblyInfo.cs b/Utilities.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 67f2772..0000000 --- a/Utilities.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("SODA.Utilities.Tests")] -[assembly: AssemblyDescription("Test project for the SODA.Utilities library")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("City of Santa Monica")] -[assembly: AssemblyProduct("SODA.Utilities.Tests")] -[assembly: AssemblyCopyright("Copyright © City of Santa Monica 2014")] -[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("bccf9284-9ee5-434a-a64d-b396481aac6a")] - -// 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/Utilities.Tests/Utilities.Tests.projitems b/Utilities.Tests/Utilities.Tests.projitems new file mode 100644 index 0000000..c813eaf --- /dev/null +++ b/Utilities.Tests/Utilities.Tests.projitems @@ -0,0 +1,32 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 651fb983-b00b-445a-960b-850d21d17db0 + + + Utilities.Tests + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + \ No newline at end of file diff --git a/Utilities.Tests/Utilities.Tests.shproj b/Utilities.Tests/Utilities.Tests.shproj new file mode 100644 index 0000000..180980c --- /dev/null +++ b/Utilities.Tests/Utilities.Tests.shproj @@ -0,0 +1,13 @@ + + + + 651fb983-b00b-445a-960b-850d21d17db0 + 14.0 + + + + + + + + diff --git a/Utilities/DataFileExporter.cs b/Utilities/DataFileExporter.cs index e2d07a5..091cb69 100644 --- a/Utilities/DataFileExporter.cs +++ b/Utilities/DataFileExporter.cs @@ -1,6 +1,10 @@ using System; using System.Collections.Generic; using System.IO; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Utilities.Net45.Tests")] +[assembly: InternalsVisibleTo("Utilities.NetCore22.Tests")] namespace SODA.Utilities { diff --git a/Utilities/EwsClient.cs b/Utilities/EwsClient.cs index 4a5be14..9804347 100644 --- a/Utilities/EwsClient.cs +++ b/Utilities/EwsClient.cs @@ -26,8 +26,14 @@ protected Folder Inbox { get { - if(inbox == null) + if (inbox == null) + { +#if NET45 inbox = Folder.Bind(exchangeService, WellKnownFolderName.Inbox); +#elif NETSTANDARD + inbox = Folder.Bind(exchangeService, WellKnownFolderName.Inbox).Result; +#endif + } return inbox; } @@ -147,13 +153,22 @@ public virtual bool DownloadAttachment(Regex attachmentNamePattern, string targe ); //perform the search and return the results as EmailMessage objects +#if NET45 var results = Inbox.FindItems(filter, view).Cast(); +#elif NETSTANDARD + var results = Inbox.FindItems(filter, view).Result.Cast(); +#endif bool foundAttachment = false; foreach (var result in results) { //another call to EWS to actually load in this email's attachment collection +#if NET45 var email = EmailMessage.Bind(exchangeService, result.Id, new PropertySet(EmailMessageSchema.Attachments)); +#elif NETSTANDARD + var email = EmailMessage.Bind(exchangeService, result.Id, new PropertySet(EmailMessageSchema.Attachments)).Result; +#endif + foreach (var attachment in email.Attachments) { @@ -171,7 +186,7 @@ public virtual bool DownloadAttachment(Regex attachmentNamePattern, string targe //mark the email as read email.IsRead = true; email.Update(ConflictResolutionMode.AlwaysOverwrite); - + //get outta here! foundAttachment = true; break; diff --git a/Utilities/Properties/AssemblyInfo.cs b/Utilities/Properties/AssemblyInfo.cs deleted file mode 100644 index aae2250..0000000 --- a/Utilities/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("SODA.Utilities")] -[assembly: AssemblyDescription("Library of helper classes and extension methods for working with Socrata Open Data portals.")] \ No newline at end of file diff --git a/Utilities/README.md b/Utilities/README.md deleted file mode 100644 index 62bdaee..0000000 --- a/Utilities/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# SODA.Utilities - -A set of helper classes and extension methods that we use alongside SODA.NET for our publishing workflow. -Note, this library is entirely optional and is not required to interact with a Socrata Open Data portal. - -## Usage examples - -**SimpleFileLogger**, a simple file logging utility (imagine that!) - -```c# -using (var logger = new SimpleFileLogger("log.txt")) -{ - //write a line of text to the log file (and the Console window), e.g. - //[2014-08-05 14:16:03] Message here - - logger.WriteLine("Message here"); -} -``` - -**DataFileExporter**, a utility for exporting data to a text-based file format - -```c# -IEnumerable payload = GetPayloadData(); - -//export as JSON -DataFileExporter.ExportJSON(payload, "data.json"); - -//export as CSV -DataFileExporter.ExportCSV(payload, "data.csv"); -``` - -**ExcelOleDbHelper**, a utility for reading -[DataRows](http://msdn.microsoft.com/en-us/library/system.data.datarow) -out of Excel documents - -```c# -//make a connection to an .xls(x) workbook -OleDbConnection connection = ExcelOleDbHelper.MakeConnection("data.xlsx"); - -//read out a collection of DataRows from all sheets in the workbook -IEnumerable rows = ExcelOleDbHelper.GetRowsFromDataSheets(connection); -``` - -**IEwsClient**, an interface that wraps some Exchange WebServices functionality - -```c# -//initialize a new client targeting Exchange Server 2007 SP1 -IEwsClient ewsClient = new Ews2007Sp1Client("username", "password", "domain.org"); - -//regex to match against attachment filenames -var regx = new Regex("file\\d{6}\\.xlsx"); - -//download an attachment -//from the first unread email containing a matching attachment -bool foundAttachment = ewsClient.DownloadAttachment(regx, "C:\\temp"); - -//send an email message to a list of recipients -ewsClient.SendMessage("Subject Line", - "Body text here", - "recipient@example.com", - "another.recipient@example.com"); -``` - -**SeparatedValuesSerializer**, a utility for serializing a collection to a "separated values" (e.g. CSV) representation -```c# -IEnumerable payload = GetPayloadData(); - -//serialize using a comma to separate fields -string payloadCSV = - SeparatedValuesSerializer.SerializeToString( - payload, - SeparatedValuesDelimiter.Comma - ); - -//serialize using a tab to separate fields -string payloadTSV = - SeparatedValuesSerializer.SerializeToString( - payload, - SeparatedValuesDelimiter.Tab - ); -``` - -## Dependencies - -SODA.Utilities has a few dependencies: - - - SODA.NET - - [Excel Data Reader](https://www.nuget.org/packages/ExcelDataReader/2.1.2.3) -(for reading data from Excel documents) - - [Microsoft Exchange WebServices 2.2](https://www.nuget.org/packages/Microsoft.Exchange.WebServices/2.2.0) -(for talking to an Exchange server) - -## Getting Started - -SODA.Utilities is available as a [NuGet package](https://www.nuget.org/packages/CSM.SodaDotNet.Utilities/). - - Install-Package CSM.SodaDotNet.Utilities - diff --git a/Utilities/SODA.Utilities.nuspec b/Utilities/SODA.Utilities.nuspec deleted file mode 100644 index 792b84c..0000000 --- a/Utilities/SODA.Utilities.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - - CSM.SodaDotNet.Utilities - $version$ - CSM.SodaDotNet.Utilities - City of Santa Monica, CA - City of Santa Monica, CA - https://github.com/CityOfSantaMonica/SODA.NET/blob/master/LICENSE.txt - https://github.com/CityOfSantaMonica/SODA.NET - http://www.smgov.net/uploadedImages/Main/colorstd-R.gif - false - $description$ - - Copyright 2017 City of Santa Monica, CA - EWS Excel SODA - - - - - - - - \ No newline at end of file diff --git a/Utilities/Utilities.csproj b/Utilities/Utilities.csproj index b441ff5..6bc1fc5 100644 --- a/Utilities/Utilities.csproj +++ b/Utilities/Utilities.csproj @@ -1,106 +1,41 @@ - - - + + - Debug - AnyCPU - {63B7FAD7-5927-417C-AD2A-608D777AD1A7} - Library - Properties - SODA.Utilities - SODA.Utilities - v4.5 - 512 - SAK - SAK - SAK - SAK - - ..\ - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - bin\Debug\SODA.Utilities.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - bin\Release\SODA.Utilities.XML + netstandard2.0;net45 + CSM.SodaDotNet.Utilities + 0.9.0 + City of Santa Monica, CA + Library of helper classes and extension methods for working with Socrata Open Data portals. + Copyright 2019 City of Santa Monica, CA + SODA.Utilities + EWS Excel SODA + https://github.com/CityofSantaMonica/SODA.NET + true + MIT + - - ..\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll - - - ..\packages\ExcelDataReader.DataSet.3.6.0\lib\net35\ExcelDataReader.DataSet.dll - - - ..\packages\SharpZipLib.1.1.0\lib\net45\ICSharpCode.SharpZipLib.dll - - - ..\packages\Microsoft.Exchange.WebServices.2.2\lib\40\Microsoft.Exchange.WebServices.dll - - - ..\packages\Microsoft.Exchange.WebServices.2.2\lib\40\Microsoft.Exchange.WebServices.Auth.dll - - - - - - - - - - - + + + + - - SolutionInfo.cs - - - - - - - Code - - - - - - - - + - - - {837ebdd7-eb58-44f8-834b-f2903a05a16e} - SODA - + + + + 1.1.3 + + + 4.5.1 + - - - + + + 2.2.0 + - - - \ No newline at end of file + + diff --git a/Utilities/packages.config b/Utilities/packages.config deleted file mode 100644 index d919235..0000000 --- a/Utilities/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From efa5b002b53c46ad9e0232d5773384461a059f34 Mon Sep 17 00:00:00 2001 From: kevinsmgov Date: Tue, 23 Jul 2019 14:22:54 -0700 Subject: [PATCH 05/11] correct httpclient actions to complete tests --- SODA.Tests/SodaClientTests.cs | 2 +- SODA.Tests/SodaRequestTests.cs | 60 ++++++++++++------------ SODA/SodaRequest.cs | 86 +++++++++++++++++----------------- 3 files changed, 73 insertions(+), 75 deletions(-) diff --git a/SODA.Tests/SodaClientTests.cs b/SODA.Tests/SodaClientTests.cs index 225c065..8e6215d 100644 --- a/SODA.Tests/SodaClientTests.cs +++ b/SODA.Tests/SodaClientTests.cs @@ -118,7 +118,7 @@ public void Query_With_UndefinedLimit_UsesMaximum() { mockClient.Query(query, StringMocks.ResourceId); } - catch (WebException) + catch (InvalidOperationException) { //pass } diff --git a/SODA.Tests/SodaRequestTests.cs b/SODA.Tests/SodaRequestTests.cs index 47e30e7..758951b 100644 --- a/SODA.Tests/SodaRequestTests.cs +++ b/SODA.Tests/SodaRequestTests.cs @@ -78,14 +78,14 @@ public void New_Returns_Request_With_Specified_Method(string input) StringAssert.AreEqualIgnoringCase(input, request.RequestMessage.Method.Method); } - //[Test] - //[Category("SodaRequest")] - //public void New_Returns_Request_Using_HTTP_1_1() - //{ - // var request = new SodaRequest(exampleUri, "GET", null, null, null); + [Test] + [Category("SodaRequest")] + public void New_Returns_Request_Using_HTTP_1_1() + { + var request = new SodaRequest(exampleUri, "GET", null, null, null); - // Assert.AreEqual(new Version("1.1"), request.webRequest.ProtocolVersion); - //} + Assert.AreEqual(new Version("1.1"), request.RequestMessage.Version); + } [TestCase("appToken1234")] [Category("SodaRequest")] @@ -244,27 +244,27 @@ public void ParseResponse_Can_GET_Example() StringAssert.Contains("", result); } - //[TestCase("POST")] - //[TestCase("PUT")] - //[TestCase("DELETE")] - //[Category("SodaRequest")] - //public void ParseResponse_Non_GET_Sends_Request_To_Example_Using_Method(string method) - //{ - // var request = new SodaRequest(exampleUri, method, null, null, null); - // string result; - - // try - // { - // result = request.ParseResponse(); - // } - // catch (WebException webException) - // { - // var webResponse = webException.Response as HttpWebResponse; - - // Assert.AreEqual(exampleUri, webResponse.ResponseUri); - // StringAssert.AreEqualIgnoringCase(method, webResponse.Method); - // } - //} - + [TestCase("POST")] + [TestCase("PUT")] + [TestCase("DELETE")] + [Category("SodaRequest")] + public void ParseResponse_Non_GET_Sends_Request_To_Example_Using_Method(string method) + { + var request = new SodaRequest(exampleUri, method, null, null, null); + string result; + + try + { + result = request.ParseResponse(); + } + catch(InvalidOperationException) + { + } + finally + { + Assert.AreEqual(exampleUri, request.ResponseMessage.RequestMessage.RequestUri); + StringAssert.AreEqualIgnoringCase(method, request.ResponseMessage.RequestMessage.Method.Method); + } + } } -} \ No newline at end of file +} diff --git a/SODA/SodaRequest.cs b/SODA/SodaRequest.cs index 3f3e6f0..db482cb 100644 --- a/SODA/SodaRequest.cs +++ b/SODA/SodaRequest.cs @@ -20,10 +20,15 @@ internal class SodaRequest internal HttpClient Client { get; private set; } /// - /// The underlying HttpWebRequest handled by this SodaRequest + /// The underlying HttpRequestMessage handled by this SodaRequest /// internal HttpRequestMessage RequestMessage { get; private set; } + /// + /// The underlying HttpResponseMessage handled by this SodaRequest + /// + internal HttpResponseMessage ResponseMessage { get; private set; } + /// /// The Socrata supported data-interchange formats that this SodaRequest uses /// @@ -104,56 +109,49 @@ internal TResult ParseResponse() where TResult : class Exception inner = null; bool exception = false; - var response = Client.SendAsync(RequestMessage).Result; - if (response.IsSuccessStatusCode) - { + this.ResponseMessage = Client.SendAsync(RequestMessage).Result; - //attempt to deserialize based on the requested format - switch (dataFormat) - { - case SodaDataFormat.JSON: + //attempt to deserialize based on the requested format + switch (dataFormat) + { + case SodaDataFormat.JSON: + try + { + result = Newtonsoft.Json.JsonConvert.DeserializeObject(this.ResponseMessage.Content.ReadAsStringAsync().Result); + } + catch (Newtonsoft.Json.JsonException jex) + { + inner = jex; + exception = true; + } + break; + case SodaDataFormat.CSV: + //TODO: should we consider this an error (i.e. InvalidOperationException) if this cast returns null? + result = this.ResponseMessage.Content.ReadAsStringAsync().Result as TResult; + break; + case SodaDataFormat.XML: + //see if the caller just wanted the XML string + var ttype = typeof(TResult); + if (ttype == typeof(string)) + { + result = this.ResponseMessage.Content.ReadAsStringAsync().Result as TResult; + } + else + { + //try to deserialize the XML response try { - result = Newtonsoft.Json.JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); + var reader = XmlReader.Create(new StringReader(this.ResponseMessage.Content.ReadAsStringAsync().Result)); + var serializer = new XmlSerializer(ttype); + result = serializer.Deserialize(reader) as TResult; } - catch (Newtonsoft.Json.JsonException jex) + catch (Exception ex) { - inner = jex; + inner = ex; exception = true; } - break; - case SodaDataFormat.CSV: - //TODO: should we consider this an error (i.e. InvalidOperationException) if this cast returns null? - result = response.Content.ReadAsStringAsync().Result as TResult; - break; - case SodaDataFormat.XML: - //see if the caller just wanted the XML string - var ttype = typeof(TResult); - if (ttype == typeof(string)) - { - result = response.Content.ReadAsStringAsync().Result as TResult; - } - else - { - //try to deserialize the XML response - try - { - var reader = XmlReader.Create(new StringReader(response.Content.ReadAsStringAsync().Result)); - var serializer = new XmlSerializer(ttype); - result = serializer.Deserialize(reader) as TResult; - } - catch (Exception ex) - { - inner = ex; - exception = true; - } - } - break; - } - } - else - { - throw new WebException(response.ReasonPhrase); + } + break; } if (exception) From 6c6216a450b8e86ceb13df4d0f6876a9d3574205 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 23 Jul 2019 10:39:17 -0700 Subject: [PATCH 06/11] removing comments --- SODA.Tests/HumanAddressTests.cs | 1 - SODA.Tests/PhoneColumnTest.cs | 1 - SODA.Tests/ResourceTests.cs | 1 - SODA.Tests/SodaClientTests.cs | 21 ------------------- SODA.Tests/SodaRequestTests.cs | 5 +---- SODA.Tests/SodaUriTests.cs | 17 --------------- SODA.Tests/SoqlQueryTests.cs | 3 --- Utilities.Tests/DataFileExporterTests.cs | 6 ------ Utilities.Tests/FileLoggingTests.cs | 2 -- .../SeparatedValuesSerializerTests.cs | 1 - 10 files changed, 1 insertion(+), 57 deletions(-) diff --git a/SODA.Tests/HumanAddressTests.cs b/SODA.Tests/HumanAddressTests.cs index 8345de7..0acecab 100644 --- a/SODA.Tests/HumanAddressTests.cs +++ b/SODA.Tests/HumanAddressTests.cs @@ -28,7 +28,6 @@ public void New_Deserializes_Valid_HumanAddress_Json() [TestCase("not json")] [TestCase(@"{""not"":""a"",""human"":""address""}")] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("HumanAddress")] public void New_Throws_ArgumentOutOfRangeException_For_Invalid_HumanAddress_Json(string input) { diff --git a/SODA.Tests/PhoneColumnTest.cs b/SODA.Tests/PhoneColumnTest.cs index 1907a2e..7344380 100644 --- a/SODA.Tests/PhoneColumnTest.cs +++ b/SODA.Tests/PhoneColumnTest.cs @@ -88,7 +88,6 @@ public void New_Deserializes_PhoneColumn_For_No_Type_Json() [TestCase("not json")] [TestCase(@"{""not"":""a"",""valid"":""phone""}")] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("PhoneColumn")] public void New_Throws_ArgumentOutOfRangeException_For_Invalid_PhoneColumn_Json(string input) { diff --git a/SODA.Tests/ResourceTests.cs b/SODA.Tests/ResourceTests.cs index 6b0f5b9..c7496d1 100644 --- a/SODA.Tests/ResourceTests.cs +++ b/SODA.Tests/ResourceTests.cs @@ -70,7 +70,6 @@ public void New_Gets_Metadata_Identifier() [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NullInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("Resource")] public void GetRow_With_Invalid_RowId_Throws_ArugmentException(string input) { diff --git a/SODA.Tests/SodaClientTests.cs b/SODA.Tests/SodaClientTests.cs index 8e6215d..1f569f9 100644 --- a/SODA.Tests/SodaClientTests.cs +++ b/SODA.Tests/SodaClientTests.cs @@ -25,7 +25,6 @@ public void TestSetup() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaClient")] public void New_With_Empty_Host_Throws_ArgumentException(string input) { @@ -69,7 +68,6 @@ public void New_With_Username_Gets_Username() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void GetMetadata_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -79,7 +77,6 @@ public void GetMetadata_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeExcepti [TestCase(-100)] [TestCase(-1)] [TestCase(0)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void GetMetadataPage_With_NonPositive_Page_Throws_ArgumentOutOfRangeException(int input) { @@ -90,7 +87,6 @@ public void GetMetadataPage_With_NonPositive_Page_Throws_ArgumentOutOfRangeExcep [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void GetResource_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -100,7 +96,6 @@ public void GetResource_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeExcepti [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void Query_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -128,7 +123,6 @@ public void Query_With_UndefinedLimit_UsesMaximum() } [Test] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void Upsert_With_String_And_SodaDataFormat_XML_Throws_ArgumentOutOfRangeException() { @@ -136,7 +130,6 @@ public void Upsert_With_String_And_SodaDataFormat_XML_Throws_ArgumentOutOfRangeE } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void Upsert_With_String_And_SodaDataFormat_Using_Anonymous_Client_Throws_InvalidOperationException() { @@ -146,7 +139,6 @@ public void Upsert_With_String_And_SodaDataFormat_Using_Anonymous_Client_Throws_ [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void Upsert_With_Entities_And_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -156,7 +148,6 @@ public void Upsert_With_Entities_And_Invalid_ResourceId_Throws_ArgumentOutOfRang } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void Upsert_With_Entities_Using_Anonymous_Client_Throws_InvalidOperationException() { @@ -168,7 +159,6 @@ public void Upsert_With_Entities_Using_Anonymous_Client_Throws_InvalidOperationE [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void BatchUpsert_With_Entities_And_BatchSize_And_BreakFunction_And_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -180,7 +170,6 @@ public void BatchUpsert_With_Entities_And_BatchSize_And_BreakFunction_And_Invali } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void BatchUpsert_With_Entities_And_BatchSize_And_BreakFunction_Using_Anonymous_Client_Throws_InvalidOperationException() { @@ -194,7 +183,6 @@ public void BatchUpsert_With_Entities_And_BatchSize_And_BreakFunction_Using_Anon [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void BatchUpsert_With_Entities_And_BatchSize_And_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -204,7 +192,6 @@ public void BatchUpsert_With_Entities_And_BatchSize_And_Invalid_ResourceId_Throw } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void BatchUpsert_With_Entities_And_BatchSize_Using_Anonymous_Client_Throws_InvalidOperationException() { @@ -214,7 +201,6 @@ public void BatchUpsert_With_Entities_And_BatchSize_Using_Anonymous_Client_Throw } [Test] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void Replace_With_String_And_DataFormat_XML_And_ResourceId_Throws_ArgumentOutOfRangeException() { @@ -224,7 +210,6 @@ public void Replace_With_String_And_DataFormat_XML_And_ResourceId_Throws_Argumen [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void Replace_With_String_And_DataFormat_And_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -232,7 +217,6 @@ public void Replace_With_String_And_DataFormat_And_Invalid_ResourceId_Throws_Arg } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void Replace_With_String_And_DataFormat_Using_Anonymous_Client_Throws_InvalidOperationException() { @@ -242,7 +226,6 @@ public void Replace_With_String_And_DataFormat_Using_Anonymous_Client_Throws_Inv [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void Replace_With_Entities_And_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -252,7 +235,6 @@ public void Replace_With_Entities_And_Invalid_ResourceId_Throws_ArgumentOutOfRan } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void Replace_With_Entities_Using_Anonymous_Client_Throws_InvalidOperationException() { @@ -263,7 +245,6 @@ public void Replace_With_Entities_Using_Anonymous_Client_Throws_InvalidOperation [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaClient")] public void DeleteRow_With_Empty_RowId_Throws_ArgumentException(string input) { @@ -273,7 +254,6 @@ public void DeleteRow_With_Empty_RowId_Throws_ArgumentException(string input) [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaClient")] public void DeleteRow_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -281,7 +261,6 @@ public void DeleteRow_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaClient")] public void DeleteRow_Using_Anonymous_Client_Throws_InvalidOperationException() { diff --git a/SODA.Tests/SodaRequestTests.cs b/SODA.Tests/SodaRequestTests.cs index 758951b..746b77e 100644 --- a/SODA.Tests/SodaRequestTests.cs +++ b/SODA.Tests/SodaRequestTests.cs @@ -132,8 +132,8 @@ public void New_With_JSON_DataFormat_Sets_Accept_Header(string input) [TestCase("POST")] [TestCase("PUT")] - [Category("SodaRequest")] [TestCase("DELETE")] + [Category("SodaRequest")] public void New_Non_GET_With_JSON_DataFormat_Sets_ContentType_Header(string input) { var request = new SodaRequest(exampleUri, input, null, null, null, SodaDataFormat.JSON, "{}"); @@ -175,8 +175,6 @@ public void New_Returns_Request_With_Unset_Content_For_Empty_Payload() { var request = new SodaRequest(exampleUri, "POST", null, null, null); - //The default is -1, which indicates the property has not been set and that there is no request data to send. - //http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.contentlength(v=vs.110).aspx Assert.IsNull(request.RequestMessage.Content); } @@ -216,7 +214,6 @@ public void New_Sets_Timeout_To_Given_Timeout() } [Test] - //[ExpectedException(typeof(InvalidOperationException))] [Category("SodaRequest")] public void ParseResponse_ReThrows_JSON_Parse_Exception_As_InvalidOperationException() { diff --git a/SODA.Tests/SodaUriTests.cs b/SODA.Tests/SodaUriTests.cs index 30dc370..3b32cc9 100644 --- a/SODA.Tests/SodaUriTests.cs +++ b/SODA.Tests/SodaUriTests.cs @@ -102,7 +102,6 @@ public void All_Methods_Return_Uri_Using_HTTPS() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForMetadata_With_Empty_Host_Throws_ArgumentException(string input) { @@ -112,7 +111,6 @@ public void ForMetadata_With_Empty_Host_Throws_ArgumentException(string input) [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForMetadata_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -130,7 +128,6 @@ public void ForMetadata_With_Valid_Arguments_Creates_Metadata_Uri() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForMetadataList_With_Empty_Host_Throws_ArgumentException(string input) { @@ -140,7 +137,6 @@ public void ForMetadataList_With_Empty_Host_Throws_ArgumentException(string inpu [TestCase(-100)] [TestCase(-1)] [TestCase(0)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForMetadataList_With_Page_Less_Than_1_Throws_ArugmentOutOfRangeException(int page) { @@ -161,7 +157,6 @@ public void ForMetadataList_With_Valid_Arguments_Creates_MetadataList_Uri(int pa [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForResourceAPI_With_Empty_Host_Throws_ArgumentException(string input) { @@ -171,7 +166,6 @@ public void ForResourceAPI_With_Empty_Host_Throws_ArgumentException(string input [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForResourceAPI_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -194,7 +188,6 @@ public void ForResourceAPI_With_Valid_Arguments_Creates_ResourceAPI_Uri() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForResourcePage_With_Empty_Host_Throws_ArgumentException(string input) { @@ -204,7 +197,6 @@ public void ForResourcePage_With_Empty_Host_Throws_ArgumentException(string inpu [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForResourcePage_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -222,7 +214,6 @@ public void ForResourcePage_With_Valid_Arguments_Creates_ResourcePermalink_Uri() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForResourceAboutPage_With_Empty_Host_Throws_ArgumentException(string input) { @@ -232,7 +223,6 @@ public void ForResourceAboutPage_With_Empty_Host_Throws_ArgumentException(string [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForResourceAboutPage_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -250,7 +240,6 @@ public void ForResourceAboutPage_With_Valid_Arguments_Creates_ResourcePermalink_ [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForResourceAPIPage_With_Empty_Host_Throws_ArgumentException(string input) { @@ -260,7 +249,6 @@ public void ForResourceAPIPage_With_Empty_Host_Throws_ArgumentException(string i [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForResourceAPIPage_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -290,7 +278,6 @@ public void ForResourceAPIPage_With_Valid_Arguments_Creates_ResourceAPIPage_Uri( [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForQuery_With_Empty_Host_Throws_ArgumentException(string input) { @@ -300,7 +287,6 @@ public void ForQuery_With_Empty_Host_Throws_ArgumentException(string input) [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NonEmptyInput)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SodaUri")] public void ForQuery_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { @@ -309,7 +295,6 @@ public void ForQuery_With_Invalid_ResourceId_Throws_ArgumentOutOfRangeException( [Test] [Category("SodaUri")] - //[ExpectedException(typeof(ArgumentNullException))] public void ForQuery_With_Null_SoqlQuery_Throws_ArgumentNullException() { Assert.That(() => SodaUri.ForQuery(StringMocks.Host, StringMocks.ResourceId, null), Throws.TypeOf()); @@ -329,7 +314,6 @@ public void ForQuery_With_Valid_Arguments_Creates_Query_Uri() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForCategoryPage_With_Empty_Host_Throws_ArgumentException(string input) { @@ -338,7 +322,6 @@ public void ForCategoryPage_With_Empty_Host_Throws_ArgumentException(string inpu [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("SodaUri")] public void ForCategoryPage_With_Empty_Category_Throws_ArgumentException(string input) { diff --git a/SODA.Tests/SoqlQueryTests.cs b/SODA.Tests/SoqlQueryTests.cs index 28f3b4b..f7e93e5 100644 --- a/SODA.Tests/SoqlQueryTests.cs +++ b/SODA.Tests/SoqlQueryTests.cs @@ -33,7 +33,6 @@ public void Default_Ctor_Has_No_Limit() [TestCase(null)] [TestCase("")] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SoqlQuery")] public void Query_Ctor_Requires_Query(string query) { @@ -420,7 +419,6 @@ public void Last_Having_Overwrites_All_Previous() [TestCase(-100)] [TestCase(-1)] [TestCase(0)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SoqlQuery")] public void Limit_Less_Than_One_Throws_ArgumentOutOfRangeException(int limit) { @@ -460,7 +458,6 @@ public void Last_Limit_Overwrites_All_Previous() [TestCase(-999)] [TestCase(-1)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SoqlQuery")] public void Offset_Less_Than_Zero_Throws_ArgumentOutOfRangeException(int offset) { diff --git a/Utilities.Tests/DataFileExporterTests.cs b/Utilities.Tests/DataFileExporterTests.cs index 8c92761..330d818 100644 --- a/Utilities.Tests/DataFileExporterTests.cs +++ b/Utilities.Tests/DataFileExporterTests.cs @@ -56,7 +56,6 @@ public void ExportCSV_Parameterless_Uses_DefaultFilePath() [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NullInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("DataFileExporter")] public void ExportCSV_With_Empty_File_Paths_Throws_Exception(string input) { @@ -64,7 +63,6 @@ public void ExportCSV_With_Empty_File_Paths_Throws_Exception(string input) } [TestCase("something.notcsv")] - //[ExpectedException(typeof(ArgumentException))] [Category("DataFileExporter")] public void ExportCSV_With_Incorrect_File_Extension_Throws_Exception(string input) { @@ -143,7 +141,6 @@ public void ExportTSV_Parameterless_Uses_DefaultFilePath() [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NullInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("DataFileExporter")] public void ExportTSV_With_Empty_File_Paths_Throws_Exception(string input) { @@ -151,7 +148,6 @@ public void ExportTSV_With_Empty_File_Paths_Throws_Exception(string input) } [TestCase("something.nottsv")] - //[ExpectedException(typeof(ArgumentException))] [Category("DataFileExporter")] public void ExportTSV_With_Incorrect_File_Extension_Throws_Exception(string input) { @@ -180,7 +176,6 @@ public void ExportJSON_Parameterless_Uses_DefaultFilePath() [TestCase(StringMocks.EmptyInput)] [TestCase(StringMocks.NullInput)] - //[ExpectedException(typeof(ArgumentException))] [Category("DataFileExporter")] public void ExportJSON_With_Empty_File_Paths_Throws_Exception(string input) { @@ -188,7 +183,6 @@ public void ExportJSON_With_Empty_File_Paths_Throws_Exception(string input) } [TestCase("something.notjson")] - //[ExpectedException(typeof(ArgumentException))] [Category("DataFileExporter")] public void ExportJSON_With_Incorrect_File_Extension_Throws_Exception(string input) { diff --git a/Utilities.Tests/FileLoggingTests.cs b/Utilities.Tests/FileLoggingTests.cs index 021f303..11192c3 100644 --- a/Utilities.Tests/FileLoggingTests.cs +++ b/Utilities.Tests/FileLoggingTests.cs @@ -38,7 +38,6 @@ public void Default_New_Uses_DefaultLogFile_And_DefaultMaxLogSize() [TestCase(StringMocks.NullInput)] [TestCase(StringMocks.EmptyInput)] - //[ExpectedException(typeof(ArgumentNullException))] [Category("SimpleFileLogger")] public void New_With_Empty_LogFilePath_Throws_ArgumentNullException(string input) { @@ -47,7 +46,6 @@ public void New_With_Empty_LogFilePath_Throws_ArgumentNullException(string input [TestCase(-1)] [TestCase(0)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SimpleFileLogger")] public void New_With_NonPositive_MaxLogBytes_Throws_ArgumentOutOfRangeException(int input) { diff --git a/Utilities.Tests/SeparatedValuesSerializerTests.cs b/Utilities.Tests/SeparatedValuesSerializerTests.cs index f754b82..1cddc7f 100644 --- a/Utilities.Tests/SeparatedValuesSerializerTests.cs +++ b/Utilities.Tests/SeparatedValuesSerializerTests.cs @@ -49,7 +49,6 @@ public void DelimiterString_For_Tab_Is_Tab() [TestCase(SeparatedValuesDelimiter.Comma - 1)] [TestCase(SeparatedValuesDelimiter.Tab + 1)] - //[ExpectedException(typeof(ArgumentOutOfRangeException))] [Category("SeparatedValuesSerializer")] public void SerializeToString_Throws_ArgumentOutOfRangeException_For_Invalid_Delimiter(SeparatedValuesDelimiter delimiter) { From ab4992ef73dee903a9289f30f889936a71b2e012 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 23 Jul 2019 11:39:56 -0700 Subject: [PATCH 07/11] solution reorg --- .../Net45.SODA.Tests.csproj | 0 Net45.SODA.Tests/Properties/AssemblyInfo.cs | 12 +++++ .../packages.config | 0 Net45.Tests/Properties/AssemblyInfo.cs | 20 -------- .../Net45.Utilities.Tests.csproj | 0 .../Properties/AssemblyInfo.cs | 12 +++++ .../packages.config | 0 .../NetCore22.SODA.Tests.csproj | 4 +- .../NetCore22.Utilities.Tests.csproj | 4 +- SODA.sln | 50 ++++++++++--------- .../Properties/AssemblyInfo.cs | 20 -------- 11 files changed, 55 insertions(+), 67 deletions(-) rename Net45.Tests/Net45.Tests.csproj => Net45.SODA.Tests/Net45.SODA.Tests.csproj (100%) create mode 100644 Net45.SODA.Tests/Properties/AssemblyInfo.cs rename {Net45.Tests => Net45.SODA.Tests}/packages.config (100%) delete mode 100644 Net45.Tests/Properties/AssemblyInfo.cs rename Utilities.Net45.Tests/Utilities.Net45.Tests.csproj => Net45.Utilities.Tests/Net45.Utilities.Tests.csproj (100%) create mode 100644 Net45.Utilities.Tests/Properties/AssemblyInfo.cs rename {Utilities.Net45.Tests => Net45.Utilities.Tests}/packages.config (100%) rename NetCore22.Tests/NetCore22.Tests.csproj => NetCore22.SODA.Tests/NetCore22.SODA.Tests.csproj (85%) rename Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj => NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj (87%) delete mode 100644 Utilities.Net45.Tests/Properties/AssemblyInfo.cs diff --git a/Net45.Tests/Net45.Tests.csproj b/Net45.SODA.Tests/Net45.SODA.Tests.csproj similarity index 100% rename from Net45.Tests/Net45.Tests.csproj rename to Net45.SODA.Tests/Net45.SODA.Tests.csproj diff --git a/Net45.SODA.Tests/Properties/AssemblyInfo.cs b/Net45.SODA.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..42f4858 --- /dev/null +++ b/Net45.SODA.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Net45.SODA.Tests")] + +[assembly: ComVisible(false)] + +[assembly: Guid("309fa03e-e032-4547-a83c-389ec450fd1a")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Net45.Tests/packages.config b/Net45.SODA.Tests/packages.config similarity index 100% rename from Net45.Tests/packages.config rename to Net45.SODA.Tests/packages.config diff --git a/Net45.Tests/Properties/AssemblyInfo.cs b/Net45.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 730a27f..0000000 --- a/Net45.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Net45.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Net45.Tests")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] - -[assembly: Guid("309fa03e-e032-4547-a83c-389ec450fd1a")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Utilities.Net45.Tests/Utilities.Net45.Tests.csproj b/Net45.Utilities.Tests/Net45.Utilities.Tests.csproj similarity index 100% rename from Utilities.Net45.Tests/Utilities.Net45.Tests.csproj rename to Net45.Utilities.Tests/Net45.Utilities.Tests.csproj diff --git a/Net45.Utilities.Tests/Properties/AssemblyInfo.cs b/Net45.Utilities.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0d3341b --- /dev/null +++ b/Net45.Utilities.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Net45.Utilities.Tests")] + +[assembly: ComVisible(false)] + +[assembly: Guid("763fffcb-49dd-4a86-b5a1-b51ea15ce764")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Utilities.Net45.Tests/packages.config b/Net45.Utilities.Tests/packages.config similarity index 100% rename from Utilities.Net45.Tests/packages.config rename to Net45.Utilities.Tests/packages.config diff --git a/NetCore22.Tests/NetCore22.Tests.csproj b/NetCore22.SODA.Tests/NetCore22.SODA.Tests.csproj similarity index 85% rename from NetCore22.Tests/NetCore22.Tests.csproj rename to NetCore22.SODA.Tests/NetCore22.SODA.Tests.csproj index 68e00f8..a2a2e0d 100644 --- a/NetCore22.Tests/NetCore22.Tests.csproj +++ b/NetCore22.SODA.Tests/NetCore22.SODA.Tests.csproj @@ -1,11 +1,11 @@ - + netcoreapp2.2 false - NetCore22.Tests + NetCore22.SODA.Tests diff --git a/Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj b/NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj similarity index 87% rename from Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj rename to NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj index cf77e83..47eddc7 100644 --- a/Utilities.NetCore22.Tests/Utilities.NetCore22.Tests.csproj +++ b/NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj @@ -1,9 +1,11 @@ - + netcoreapp2.2 false + + NetCore22.Utilities.Tests diff --git a/SODA.sln b/SODA.sln index 616b4e5..70d099c 100644 --- a/SODA.sln +++ b/SODA.sln @@ -17,23 +17,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution SolutionInfo.cs = SolutionInfo.cs EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{C2E27366-ABDF-4FE3-A399-A6792C33D437}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SODA", "SODA\SODA.csproj", "{8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SODA.Tests", "SODA.Tests\SODA.Tests.shproj", "{1112171D-6A3F-49F6-818A-FB44195AC837}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{76D1DD9D-B476-4900-A561-18BB7CBAF54F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net45.Tests", "Net45.Tests\Net45.Tests.csproj", "{309FA03E-E032-4547-A83C-389EC450FD1A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utilities", "Utilities\Utilities.csproj", "{8DA784F1-63B3-40A8-AEF4-833D813E5E54}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SODA.Tests", "SODA.Tests\SODA.Tests.shproj", "{1112171D-6A3F-49F6-818A-FB44195AC837}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Utilities.Tests", "Utilities.Tests\Utilities.Tests.shproj", "{651FB983-B00B-445A-960B-850D21D17DB0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utilities.Net45.Tests", "Utilities.Net45.Tests\Utilities.Net45.Tests.csproj", "{763FFFCB-49DD-4A86-B5A1-B51EA15CE764}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net45.SODA.Tests", "Net45.SODA.Tests\Net45.SODA.Tests.csproj", "{309FA03E-E032-4547-A83C-389EC450FD1A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utilities", "Utilities\Utilities.csproj", "{3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net45.Utilities.Tests", "Net45.Utilities.Tests\Net45.Utilities.Tests.csproj", "{763FFFCB-49DD-4A86-B5A1-B51EA15CE764}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utilities.NetCore22.Tests", "Utilities.NetCore22.Tests\Utilities.NetCore22.Tests.csproj", "{D7644A62-B301-46EF-A998-8E2658936943}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore22.SODA.Tests", "NetCore22.SODA.Tests\NetCore22.SODA.Tests.csproj", "{CFAEADE7-EBEA-40F8-9630-C699AA5F8274}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore22.Tests", "NetCore22.Tests\NetCore22.Tests.csproj", "{37857C2C-3398-4896-8011-ECF5061B7528}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore22.Utilities.Tests", "NetCore22.Utilities.Tests\NetCore22.Utilities.Tests.csproj", "{02CEA30A-5D25-4F9D-B74E-7CED1EBA84BF}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution @@ -51,6 +51,10 @@ Global {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}.Release|Any CPU.Build.0 = Release|Any CPU + {8DA784F1-63B3-40A8-AEF4-833D813E5E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DA784F1-63B3-40A8-AEF4-833D813E5E54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DA784F1-63B3-40A8-AEF4-833D813E5E54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DA784F1-63B3-40A8-AEF4-833D813E5E54}.Release|Any CPU.Build.0 = Release|Any CPU {309FA03E-E032-4547-A83C-389EC450FD1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {309FA03E-E032-4547-A83C-389EC450FD1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {309FA03E-E032-4547-A83C-389EC450FD1A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -59,27 +63,25 @@ Global {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Debug|Any CPU.Build.0 = Debug|Any CPU {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Release|Any CPU.ActiveCfg = Release|Any CPU {763FFFCB-49DD-4A86-B5A1-B51EA15CE764}.Release|Any CPU.Build.0 = Release|Any CPU - {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E}.Release|Any CPU.Build.0 = Release|Any CPU - {D7644A62-B301-46EF-A998-8E2658936943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D7644A62-B301-46EF-A998-8E2658936943}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D7644A62-B301-46EF-A998-8E2658936943}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D7644A62-B301-46EF-A998-8E2658936943}.Release|Any CPU.Build.0 = Release|Any CPU - {37857C2C-3398-4896-8011-ECF5061B7528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37857C2C-3398-4896-8011-ECF5061B7528}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37857C2C-3398-4896-8011-ECF5061B7528}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37857C2C-3398-4896-8011-ECF5061B7528}.Release|Any CPU.Build.0 = Release|Any CPU + {CFAEADE7-EBEA-40F8-9630-C699AA5F8274}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFAEADE7-EBEA-40F8-9630-C699AA5F8274}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFAEADE7-EBEA-40F8-9630-C699AA5F8274}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFAEADE7-EBEA-40F8-9630-C699AA5F8274}.Release|Any CPU.Build.0 = Release|Any CPU + {02CEA30A-5D25-4F9D-B74E-7CED1EBA84BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02CEA30A-5D25-4F9D-B74E-7CED1EBA84BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02CEA30A-5D25-4F9D-B74E-7CED1EBA84BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02CEA30A-5D25-4F9D-B74E-7CED1EBA84BF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {651FB983-B00B-445A-960B-850D21D17DB0} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} - {763FFFCB-49DD-4A86-B5A1-B51EA15CE764} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} - {3BA86351-2E4B-45BB-8E92-B9E803CDCD6E} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} - {D7644A62-B301-46EF-A998-8E2658936943} = {C2E27366-ABDF-4FE3-A399-A6792C33D437} + {1112171D-6A3F-49F6-818A-FB44195AC837} = {76D1DD9D-B476-4900-A561-18BB7CBAF54F} + {651FB983-B00B-445A-960B-850D21D17DB0} = {76D1DD9D-B476-4900-A561-18BB7CBAF54F} + {309FA03E-E032-4547-A83C-389EC450FD1A} = {76D1DD9D-B476-4900-A561-18BB7CBAF54F} + {763FFFCB-49DD-4A86-B5A1-B51EA15CE764} = {76D1DD9D-B476-4900-A561-18BB7CBAF54F} + {CFAEADE7-EBEA-40F8-9630-C699AA5F8274} = {76D1DD9D-B476-4900-A561-18BB7CBAF54F} + {02CEA30A-5D25-4F9D-B74E-7CED1EBA84BF} = {76D1DD9D-B476-4900-A561-18BB7CBAF54F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {17A9746D-4584-4AD5-B2FA-2A9EDFC6ED09} diff --git a/Utilities.Net45.Tests/Properties/AssemblyInfo.cs b/Utilities.Net45.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 1992a67..0000000 --- a/Utilities.Net45.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Utilities.Net45.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Utilities.Net45.Tests")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] - -[assembly: Guid("763fffcb-49dd-4a86-b5a1-b51ea15ce764")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] From c577c91ddf4515a99542b1fc8c6f5e8ed0dd9a17 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 23 Jul 2019 11:41:09 -0700 Subject: [PATCH 08/11] core-style projects across the sln * dotnet cli commands can be used for all projects * shared settings in Directory.build.props imported automatically --- Directory.build.props | 11 +++ Net45.SODA.Tests/Net45.SODA.Tests.csproj | 79 +++------------- Net45.SODA.Tests/Properties/AssemblyInfo.cs | 12 --- Net45.SODA.Tests/packages.config | 6 -- .../Net45.Utilities.Tests.csproj | 92 ++++--------------- .../Properties/AssemblyInfo.cs | 12 --- Net45.Utilities.Tests/packages.config | 7 -- .../NetCore22.Utilities.Tests.csproj | 2 +- SODA.sln | 6 +- SODA/Properties/AssemblyInfo.cs | 4 + SODA/SODA.csproj | 14 +-- SolutionInfo.cs | 10 -- Utilities/Properties/AssemblyInfo.cs | 4 + Utilities/Utilities.csproj | 12 +-- build.cmd | 23 ++--- 15 files changed, 70 insertions(+), 224 deletions(-) create mode 100644 Directory.build.props delete mode 100644 Net45.SODA.Tests/Properties/AssemblyInfo.cs delete mode 100644 Net45.SODA.Tests/packages.config delete mode 100644 Net45.Utilities.Tests/Properties/AssemblyInfo.cs delete mode 100644 Net45.Utilities.Tests/packages.config create mode 100644 SODA/Properties/AssemblyInfo.cs delete mode 100644 SolutionInfo.cs create mode 100644 Utilities/Properties/AssemblyInfo.cs diff --git a/Directory.build.props b/Directory.build.props new file mode 100644 index 0000000..bb9a026 --- /dev/null +++ b/Directory.build.props @@ -0,0 +1,11 @@ + + + City of Santa Monica, CA + City of Santa Monica, CA + Copyright 2019 City of Santa Monica, CA + SODA + https://github.com/CityofSantaMonica/SODA.NET + MIT + 0.9.0 + + \ No newline at end of file diff --git a/Net45.SODA.Tests/Net45.SODA.Tests.csproj b/Net45.SODA.Tests/Net45.SODA.Tests.csproj index 6dc3f48..c08b6f0 100644 --- a/Net45.SODA.Tests/Net45.SODA.Tests.csproj +++ b/Net45.SODA.Tests/Net45.SODA.Tests.csproj @@ -1,72 +1,23 @@ - - - - - + + - Debug - AnyCPU - {309FA03E-E032-4547-A83C-389EC450FD1A} - Library - Properties - Net45.Tests - Net45.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - + net45 + + false + + Net45.SODA.Tests - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll - - - - - - - - + - - {8c71d7e2-8ef0-4d7e-9eeb-06b1458d235e} - SODA - + + + + - + + - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + \ No newline at end of file diff --git a/Net45.SODA.Tests/Properties/AssemblyInfo.cs b/Net45.SODA.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 42f4858..0000000 --- a/Net45.SODA.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Net45.SODA.Tests")] - -[assembly: ComVisible(false)] - -[assembly: Guid("309fa03e-e032-4547-a83c-389ec450fd1a")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Net45.SODA.Tests/packages.config b/Net45.SODA.Tests/packages.config deleted file mode 100644 index 1ae39eb..0000000 --- a/Net45.SODA.Tests/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Net45.Utilities.Tests/Net45.Utilities.Tests.csproj b/Net45.Utilities.Tests/Net45.Utilities.Tests.csproj index 9878b21..667409d 100644 --- a/Net45.Utilities.Tests/Net45.Utilities.Tests.csproj +++ b/Net45.Utilities.Tests/Net45.Utilities.Tests.csproj @@ -1,84 +1,24 @@ - - - - - + + - Debug - AnyCPU - {763FFFCB-49DD-4A86-B5A1-B51EA15CE764} - Library - Properties - Utilities.Net45.Tests - Utilities.Net45.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - + net45 + + false + + Net45.SODA.Utilities.Tests - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll - - - ..\packages\ExcelDataReader.DataSet.3.6.0\lib\net35\ExcelDataReader.DataSet.dll - - - ..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll - - - - - - - - - - + - - {8c71d7e2-8ef0-4d7e-9eeb-06b1458d235e} - SODA - - - {3ba86351-2e4b-45bb-8e92-b9e803cdcd6e} - Utilities - + + + + - + + + - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + \ No newline at end of file diff --git a/Net45.Utilities.Tests/Properties/AssemblyInfo.cs b/Net45.Utilities.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 0d3341b..0000000 --- a/Net45.Utilities.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Net45.Utilities.Tests")] - -[assembly: ComVisible(false)] - -[assembly: Guid("763fffcb-49dd-4a86-b5a1-b51ea15ce764")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Net45.Utilities.Tests/packages.config b/Net45.Utilities.Tests/packages.config deleted file mode 100644 index f952d75..0000000 --- a/Net45.Utilities.Tests/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj b/NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj index 47eddc7..748c959 100644 --- a/NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj +++ b/NetCore22.Utilities.Tests/NetCore22.Utilities.Tests.csproj @@ -5,7 +5,7 @@ false - NetCore22.Utilities.Tests + NetCore22.SODA.Utilities.Tests diff --git a/SODA.sln b/SODA.sln index 70d099c..6562811 100644 --- a/SODA.sln +++ b/SODA.sln @@ -11,10 +11,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution build.cmd = build.cmd CONTRIBUTING.md = CONTRIBUTING.md DEPLOYMENT.md = DEPLOYMENT.md + Directory.build.props = Directory.build.props LICENSE.txt = LICENSE.txt README.md = README.md ReleaseNotes.md = ReleaseNotes.md - SolutionInfo.cs = SolutionInfo.cs EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SODA", "SODA\SODA.csproj", "{8C71D7E2-8EF0-4D7E-9EEB-06B1458D235E}" @@ -27,9 +27,9 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SODA.Tests", "SODA.Tests\SO EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Utilities.Tests", "Utilities.Tests\Utilities.Tests.shproj", "{651FB983-B00B-445A-960B-850D21D17DB0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net45.SODA.Tests", "Net45.SODA.Tests\Net45.SODA.Tests.csproj", "{309FA03E-E032-4547-A83C-389EC450FD1A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net45.SODA.Tests", "Net45.SODA.Tests\Net45.SODA.Tests.csproj", "{309FA03E-E032-4547-A83C-389EC450FD1A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net45.Utilities.Tests", "Net45.Utilities.Tests\Net45.Utilities.Tests.csproj", "{763FFFCB-49DD-4A86-B5A1-B51EA15CE764}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net45.Utilities.Tests", "Net45.Utilities.Tests\Net45.Utilities.Tests.csproj", "{763FFFCB-49DD-4A86-B5A1-B51EA15CE764}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore22.SODA.Tests", "NetCore22.SODA.Tests\NetCore22.SODA.Tests.csproj", "{CFAEADE7-EBEA-40F8-9630-C699AA5F8274}" EndProject diff --git a/SODA/Properties/AssemblyInfo.cs b/SODA/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..179e20d --- /dev/null +++ b/SODA/Properties/AssemblyInfo.cs @@ -0,0 +1,4 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Net45.SODA.Tests")] +[assembly: InternalsVisibleTo("NetCore22.SODA.Tests")] diff --git a/SODA/SODA.csproj b/SODA/SODA.csproj index b82833a..78d1060 100644 --- a/SODA/SODA.csproj +++ b/SODA/SODA.csproj @@ -2,20 +2,12 @@ netstandard2.0;net45 + SODA + SODA Socrata Open Data API client library targeting .NET 4.5 and above. + true CSM.SodaDotNet - 0.9.0 - City of Santa Monica, CA - City of Santa Monica, CA - Copyright 2019 City of Santa Monica, CA API OpenData Socrata SODA - true - https://github.com/CityofSantaMonica/SODA.NET - MIT - - Package dependancies updated to latest releases - -Converted project to target multiple frameworks - Net Standard 2.0 and Net Framework 4.5 diff --git a/SolutionInfo.cs b/SolutionInfo.cs deleted file mode 100644 index 06084bc..0000000 --- a/SolutionInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyCompany("City of Santa Monica, CA")] -[assembly: AssemblyProduct("SODA")] -[assembly: AssemblyCopyright("Copyright © 2018 City of Santa Monica, CA")] -[assembly: AssemblyVersion("0.8.0")] -[assembly: AssemblyFileVersion("0.8.0")] -[assembly: AssemblyInformationalVersion("0.8.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Utilities/Properties/AssemblyInfo.cs b/Utilities/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f81c691 --- /dev/null +++ b/Utilities/Properties/AssemblyInfo.cs @@ -0,0 +1,4 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Net45.SODA.Utilities.Tests")] +[assembly: InternalsVisibleTo("NetCore22.SODA.Utilities.Tests")] \ No newline at end of file diff --git a/Utilities/Utilities.csproj b/Utilities/Utilities.csproj index 6bc1fc5..576a54c 100644 --- a/Utilities/Utilities.csproj +++ b/Utilities/Utilities.csproj @@ -2,16 +2,12 @@ netstandard2.0;net45 - CSM.SodaDotNet.Utilities - 0.9.0 - City of Santa Monica, CA + SODA.Utilities + SODA.Utilities Library of helper classes and extension methods for working with Socrata Open Data portals. - Copyright 2019 City of Santa Monica, CA - SODA.Utilities - EWS Excel SODA - https://github.com/CityofSantaMonica/SODA.NET true - MIT + CSM.SodaDotNet.Utilities + EWS Excel SODA diff --git a/build.cmd b/build.cmd index cbc4ecc..238cdd8 100644 --- a/build.cmd +++ b/build.cmd @@ -8,32 +8,27 @@ if not "%1" == "" (set TARGET="%1") set BUILDMODE="Release" if not "%2" == "" (set BUILDMODE="%2") -set MSBUILDDIR="%WINDIR%\Microsoft.NET\Framework\v4.0.30319" set SODADIR=".\SODA" -set UTILSDIR=".\SODA.Utilities" +set UTILSDIR=".\Utilities" +set SODA="%SODADIR%\SODA.csproj" +set UTILS="%UTILSDIR%\Utilities.csproj" -echo Restoring NuGet package dependencies +echo Restoring NuGet dependencies -call nuget restore +call dotnet restore --verbosity m echo Rebuilding solution with Configuration: %BUILDMODE% -call %MSBUILDDIR%\msbuild.exe SODA.sln /m "/p:Configuration=%BUILDMODE%" "/p:Platform=Any CPU" /t:Clean,Build +call dotnet build SODA.sln "/p:Configuration=%BUILDMODE%" "/p:Platform=Any CPU" /t:Clean,Build echo Finished solution rebuild if %TARGET% == "CreatePackages" ( - echo Creating NuGet packages with Configuration: %BUILDMODE% + echo Creating NuGet packages - call xcopy %SODADIR%\bin\%BUILDMODE%\*.* %SODADIR%\lib\ /y - call xcopy %UTILSDIR%\bin\%BUILDMODE%\*.* %UTILSDIR%\lib\ /y - - call nuget pack %SODADIR%\SODA.csproj -Properties "Configuration=%BUILDMODE%;Platform=AnyCPU" - call nuget pack %UTILSDIR%\SODA.Utilities.csproj -IncludeReferencedProjects -Properties "Configuration=%BUILDMODE%;Platform=AnyCPU" + call dotnet pack %SODA% --no-build --output ..\ + call dotnet pack %UTILS% --no-build --output ..\ - rd /S /Q %SODADIR%\lib - rd /S /Q %UTILSDIR%\lib - echo Finished NuGet package creation ) From d06a4fb545195b16678478d2546891e021e06a91 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 23 Jul 2019 14:39:09 -0700 Subject: [PATCH 09/11] updating appveyor pipeline for core --- DEPLOYMENT.md | 8 ++++---- SODA.sln | 1 - appveyor.yml | 15 +++++++++++++-- build.cmd | 35 ----------------------------------- 4 files changed, 17 insertions(+), 42 deletions(-) delete mode 100644 build.cmd diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 76864c0..72f0619 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -8,12 +8,12 @@ are passing, and you're happy with the state of things... 1. Create a branch named `release` 1. Update [`ReleaseNotes.md`](ReleaseNotes.md), following the existing format -1. Bump the version number in [`SolutionInfo.cs`](SolutionInfo.cs) and the `.nuspec` and `appveyor.yml` files (if required) +1. Bump the version number in [`Directory.build.props`](Directory.build.props) 1. Push the branch to GitHub and create a pull request -1. Run `.\build CreatePackages` to create the NuGet packages (locally) for the new version +1. Create the NuGet packages (in the local solution root) for the new version: `dotnet pack --output ..\` 1. Test the NuGet packages! [How to install NuGet package locally](http://stackoverflow.com/questions/10240029/how-to-install-a-nuget-package-nupkg-file-locally) -1. If satisfied with the release, push the new packages up to NuGet -1. Accept the pull request +1. If satisfied with the release, accept the pull request 1. Create a tag `git tag v#.#.#`. For example, to create a tag for 1.0.0 `git tag v1.0.0` 1. [Create a new release](https://help.github.com/articles/creating-releases) using the tag you just created and pasting in the release notes you just wrote up. Attach a copy of the latest `.nupkg` files generated above. +1. Push the new packages up to NuGet `dotnet nuget push` diff --git a/SODA.sln b/SODA.sln index 6562811..d075090 100644 --- a/SODA.sln +++ b/SODA.sln @@ -8,7 +8,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .gitattributes = .gitattributes .gitignore = .gitignore appveyor.yml = appveyor.yml - build.cmd = build.cmd CONTRIBUTING.md = CONTRIBUTING.md DEPLOYMENT.md = DEPLOYMENT.md Directory.build.props = Directory.build.props diff --git a/appveyor.yml b/appveyor.yml index 44d56de..b60eab9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,17 @@ -version: 0.8.{build} +version: 1.0.{build} + +image: Visual Studio 2017 + pull_requests: do_not_increment_build_number: true + skip_tags: true + +before_build: + - dotnet restore --verbosity m + build_script: -- cmd: .\build.cmd \ No newline at end of file + - dotnet build SODA.sln + +test_script: + - dotnet test diff --git a/build.cmd b/build.cmd deleted file mode 100644 index 238cdd8..0000000 --- a/build.cmd +++ /dev/null @@ -1,35 +0,0 @@ -@echo off - -cls - -set TARGET="Default" -if not "%1" == "" (set TARGET="%1") - -set BUILDMODE="Release" -if not "%2" == "" (set BUILDMODE="%2") - -set SODADIR=".\SODA" -set UTILSDIR=".\Utilities" -set SODA="%SODADIR%\SODA.csproj" -set UTILS="%UTILSDIR%\Utilities.csproj" - -echo Restoring NuGet dependencies - -call dotnet restore --verbosity m - -echo Rebuilding solution with Configuration: %BUILDMODE% - -call dotnet build SODA.sln "/p:Configuration=%BUILDMODE%" "/p:Platform=Any CPU" /t:Clean,Build - -echo Finished solution rebuild - -if %TARGET% == "CreatePackages" ( - echo Creating NuGet packages - - call dotnet pack %SODA% --no-build --output ..\ - call dotnet pack %UTILS% --no-build --output ..\ - - echo Finished NuGet package creation -) - -exit /B %errorlevel% \ No newline at end of file From 9fd4ffd4bbd9378d20ba33c051998a23853206b7 Mon Sep 17 00:00:00 2001 From: kevinsmgov Date: Tue, 23 Jul 2019 15:02:25 -0700 Subject: [PATCH 10/11] Core supports higher http version --- SODA.Tests/SodaRequestTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SODA.Tests/SodaRequestTests.cs b/SODA.Tests/SodaRequestTests.cs index 746b77e..3aa8085 100644 --- a/SODA.Tests/SodaRequestTests.cs +++ b/SODA.Tests/SodaRequestTests.cs @@ -80,11 +80,11 @@ public void New_Returns_Request_With_Specified_Method(string input) [Test] [Category("SodaRequest")] - public void New_Returns_Request_Using_HTTP_1_1() + public void New_Returns_Request_Using_HTTP_1_1_Or_Greater() { var request = new SodaRequest(exampleUri, "GET", null, null, null); - Assert.AreEqual(new Version("1.1"), request.RequestMessage.Version); + Assert.GreaterOrEqual(request.RequestMessage.Version, new Version("1.1")); } [TestCase("appToken1234")] From fff60ed577df88c606c6541dcfbfee76a8f3ebf0 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 24 Jul 2019 10:10:40 -0700 Subject: [PATCH 11/11] updating for 0.9.0 --- DEPLOYMENT.md | 6 +++--- ReleaseNotes.md | 6 ++++++ appveyor.yml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 72f0619..8e20101 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -8,12 +8,12 @@ are passing, and you're happy with the state of things... 1. Create a branch named `release` 1. Update [`ReleaseNotes.md`](ReleaseNotes.md), following the existing format -1. Bump the version number in [`Directory.build.props`](Directory.build.props) +1. Bump the version number in [`Directory.build.props`](Directory.build.props) and [`appveyor.yml`](appveyor.yml) 1. Push the branch to GitHub and create a pull request +1. If the build succeeds, accept the pull request +1. Create and push a tag from the new HEAD `git tag v#.#.#` and `git push --tags` 1. Create the NuGet packages (in the local solution root) for the new version: `dotnet pack --output ..\` 1. Test the NuGet packages! [How to install NuGet package locally](http://stackoverflow.com/questions/10240029/how-to-install-a-nuget-package-nupkg-file-locally) -1. If satisfied with the release, accept the pull request -1. Create a tag `git tag v#.#.#`. For example, to create a tag for 1.0.0 `git tag v1.0.0` 1. [Create a new release](https://help.github.com/articles/creating-releases) using the tag you just created and pasting in the release notes you just wrote up. Attach a copy of the latest `.nupkg` files generated above. 1. Push the new packages up to NuGet `dotnet nuget push` diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 768926e..c7b6dcf 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,9 @@ +### New in 0.9.0 (Released 2019/07/24) + +New features + + - Support for .NET Core 2.2 + ### New in 0.8.0 (Released 2017/12/06) Bug fixes diff --git a/appveyor.yml b/appveyor.yml index b60eab9..d7247cd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.{build} +version: 0.9.0-{build} image: Visual Studio 2017