Skip to content

Commit

Permalink
Upgrade to net6.0 and nuget package updates. (#44)
Browse files Browse the repository at this point in the history
* Upgrade to .net6 and VS 2022.

* Fix integration tests to use the new name for lucas films.

* Fix integration test for genres where TMDB no longer supports the foreign genre.

* Fix integration test for updated bio on TMBD for actress.

* Upgrade nuget packages.

* Update nuget package to v1.2.0 and publish to nuget.
  • Loading branch information
nCubed authored Jun 27, 2022
1 parent 2ed3f45 commit 2a1c581
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 31 deletions.
12 changes: 6 additions & 6 deletions DM.MovieApi.IntegrationTests/DM.MovieApi.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>DM.MovieApi.IntegrationTests</AssemblyName>
<RootNamespace>DM.MovieApi.IntegrationTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void TestInit()
public async Task FindByIdAsync_Lucasfilm_WithResults_NoParentCompany()
{
const int id = 1;
const string expectedName = "Lucasfilm";
const string expectedName = "Lucasfilm Ltd.";
const string expectedHeadquarters = "San Francisco, California";
const string expectedHomepage = "https://www.lucasfilm.com";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public void TestInit()

Assert.IsInstanceOfType( _api, typeof( ApiGenreRequest ) );

(( ApiGenreRequest )_api).ClearAllGenres();
((ApiGenreRequest)_api).ClearAllGenres();
}

[TestMethod]
public async Task FindById_Returns_Foreign_Genre_NotInGetAll()
public async Task FindById_Foreign_Genre_NoLongerExists()
{
const int id = 10769;
const string name = "Foreign";
Expand All @@ -36,15 +36,12 @@ public async Task FindById_Returns_Foreign_Genre_NotInGetAll()
// FindById will add to AllGenres when it does not exist
ApiQueryResponse<Genre> response = await _api.FindByIdAsync( id );

ApiResponseUtil.AssertErrorIsNull( response );

Genre genre = response.Item;
Assert.IsNotNull( response.Error );
Assert.AreEqual( TmdbStatusCode.ResourceNotFound, response.Error.TmdbStatusCode );

Assert.AreEqual( id, genre.Id );
Assert.AreEqual( name, genre.Name );

CollectionAssert.Contains( _api.AllGenres.ToList(), new Genre( id, name ) );
CollectionAssert.Contains( _api.AllGenres.ToList(), genre );
// the genre should not have been added to AllGenres since TMDB no longer recognizes
// the foreign genre category.
CollectionAssert.DoesNotContain( _api.AllGenres.ToList(), new Genre( id, name ) );
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public async Task FindByIdAsync_StarWarsTheForceAwakens_Returns_AllValues()
// Production Companies
var companies = new[]
{
new ProductionCompanyInfo(1, "Lucasfilm"),
new ProductionCompanyInfo(1, "Lucasfilm Ltd."),
new ProductionCompanyInfo(11461, "Bad Robot")
};
CollectionAssert.AreEquivalent( companies, movie.ProductionCompanies.ToArray(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public async Task FindByIdAsync_KevinBacon_Returns_ExpectedValues()
public async Task FindByIdAsync_CourteneyCox_Returns_ExpectedValues()
{
const string expectedName = "Courteney Cox";
const string expectedBiography = "Courteney Bass Cox (born June 15, 1964) is an American actress"; // truncated
const string expectedBiography = "Courteney Bass Cox (previously Courteney Cox-Arquette; born June 15, 1964) " +
"is an American actress, director, and producer."; // truncated
DateTime expectedBirthday = DateTime.Parse( "1964-06-15" );
const Gender expectedGender = Gender.Female;
const string expectedHomepage = null;
Expand All @@ -123,7 +124,7 @@ public async Task FindByIdAsync_CourteneyCox_Returns_ExpectedValues()
Person person = response.Item;

Assert.AreEqual( expectedName, person.Name );
Assert.IsTrue( person.Biography.StartsWith( expectedBiography ) );
Assert.IsTrue( person.Biography.StartsWith( expectedBiography ), $"Actual: {person.Biography}" );
Assert.IsFalse( person.IsAdultFilmStar );
Assert.AreEqual( expectedBirthday, person.Birthday );
Assert.AreEqual( expectedGender, person.Gender );
Expand Down
14 changes: 7 additions & 7 deletions DM.MovieApi/DM.MovieApi.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
<PackageId>TheMovieDbWrapper</PackageId>
<Version>1.1.0</Version>
<Version>1.2.0</Version>
<Authors>Kindler Chase</Authors>
<Company>nCubed</Company>
<Product>TheMovieDb.org Wrapper</Product>
Expand All @@ -18,23 +18,23 @@
<PackageProjectUrl>https://github.com/nCubed/TheMovieDbWrapper</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>Movies Movie themoviedb themoviedb.org TMDB Film TV Television Actor Acress Director IMDB</PackageTags>
<PackageReleaseNotes>v1.1.0 adds support for TV Show Seasons. See v1.0.x release notes for a minor breaking change from releases &lt; 1.0.</PackageReleaseNotes>
<PackageReleaseNotes>v1.2.0 upgrades net5.0 to net6.0. Prior release: v1.1.0 adds support for TV Show Seasons. See v1.0.x release notes for a minor breaking change from releases &lt; 1.0.</PackageReleaseNotes>
<RepositoryUrl>https://github.com/nCubed/TheMovieDbWrapper</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\"/>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<Compile Remove="MovieDbApi.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions TheMovieDbWrapper.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
# Visual Studio Version 17
VisualStudioVersion = 17.2.32616.157
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DM.MovieApi", "DM.MovieApi\DM.MovieApi.csproj", "{DD45BBDE-7BB4-41D5-9EB8-B33C74189679}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DM.MovieApi", "DM.MovieApi\DM.MovieApi.csproj", "{DD45BBDE-7BB4-41D5-9EB8-B33C74189679}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DM.MovieApi.IntegrationTests", "DM.MovieApi.IntegrationTests\DM.MovieApi.IntegrationTests.csproj", "{415A810A-75AA-4EFE-9B7B-A16DEE8CCCC8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DM.MovieApi.IntegrationTests", "DM.MovieApi.IntegrationTests\DM.MovieApi.IntegrationTests.csproj", "{415A810A-75AA-4EFE-9B7B-A16DEE8CCCC8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
1 change: 1 addition & 0 deletions TheMovieDbWrapper.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TV/@EntryIndexedValue">TV</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=API_0027s/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Arquette/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Courteney/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=creds/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ctors/@EntryIndexedValue">True</s:Boolean>
Expand Down

0 comments on commit 2a1c581

Please sign in to comment.