diff --git a/NPPESAPI.net/NPPESAPI.net.csproj b/NPPESAPI.net/NPPESAPI.net.csproj index fd5b05d..6e7753a 100644 --- a/NPPESAPI.net/NPPESAPI.net.csproj +++ b/NPPESAPI.net/NPPESAPI.net.csproj @@ -21,6 +21,7 @@ 1.1.1.0 1.1.1.0 1.1.1 + Support for NPPES API v2.1 and newer url versioning scheme diff --git a/NPPESAPI.net/NPPESRequestBuilder.cs b/NPPESAPI.net/NPPESRequestBuilder.cs index 3cbd67f..24ab910 100644 --- a/NPPESAPI.net/NPPESRequestBuilder.cs +++ b/NPPESAPI.net/NPPESRequestBuilder.cs @@ -86,7 +86,7 @@ public NPPESRequestBuilder FirstName(string firstName) /// /// Appends or updates the useFirstNameAlias search parameter for the request. /// - /// + /// /// public NPPESRequestBuilder UseFirstNameAlias(bool useFirstNameAlias) { diff --git a/NPPESAPITest/NPPESApiClientTests.cs b/NPPESAPITest/NPPESApiClientTests.cs index 3cda67e..114f7f7 100644 --- a/NPPESAPITest/NPPESApiClientTests.cs +++ b/NPPESAPITest/NPPESApiClientTests.cs @@ -1,8 +1,7 @@ -using System; +using Forcura.NPPES; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Net; using System.Threading.Tasks; -using Forcura.NPPES; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace NPPESAPITest { diff --git a/NPPESAPITest/NPPESRequestBuilderTests.cs b/NPPESAPITest/NPPESRequestBuilderTests.cs index 034be76..05592d7 100644 --- a/NPPESAPITest/NPPESRequestBuilderTests.cs +++ b/NPPESAPITest/NPPESRequestBuilderTests.cs @@ -1,5 +1,8 @@ using Forcura.NPPES; +using Forcura.NPPES.Models; using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Linq; namespace NPPESAPITest { @@ -24,5 +27,26 @@ public void NPPESRequestBuilder_UpdatesValue() Assert.IsNotNull(request); Assert.AreEqual(lastNumber, request.Number); } + + [TestMethod] + public void NPPESRequestBuilder_NoVersionUsesLatest() + { + var builder = new NPPESRequestBuilder(); + + var request = builder.Build(); + var maxVersion = Enum.GetValues(typeof(NPPESVersion)).Cast().Last(); + + Assert.AreEqual(maxVersion, request.Version); + } + + [TestMethod] + public void NPPESRequestBuilder_VersionProvidedUsesSpecified() + { + var request = new NPPESRequestBuilder() + .Version(NPPESVersion.v1_0) + .Build(); + + Assert.AreEqual(NPPESVersion.v1_0, request.Version); + } } }