-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
208 changed files
with
4,617 additions
and
1,776 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JMovies.IMDb.Entities.Movies.LDJson | ||
{ | ||
/// <summary> | ||
/// Class representing a basic info linked to the production | ||
/// </summary> | ||
public class Info | ||
{ | ||
/// <summary> | ||
/// Property representing the info type | ||
/// </summary> | ||
[JsonPropertyName("@type")] | ||
public string InfoType { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing name related to the info | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing URL related to the info | ||
/// </summary> | ||
[JsonPropertyName("url")] | ||
public string URL { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace JMovies.IMDb.Entities.Movies.LDJson | ||
{ | ||
/// <summary> | ||
/// Class representing the metadata linked to the page | ||
/// </summary> | ||
public class Metadata | ||
{ | ||
/// <summary> | ||
/// Property representing the production's type | ||
/// </summary> | ||
[JsonPropertyName("@type")] | ||
public string ProductionType { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing the production's description | ||
/// </summary> | ||
[JsonPropertyName("description")] | ||
public string Description { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Property representing the production's URL | ||
/// </summary> | ||
[JsonPropertyName("url")] | ||
public string URL { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Property representing the actor list of the production | ||
/// </summary> | ||
[JsonPropertyName("actor")] | ||
public Info[] Actors { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing the creator list of the production | ||
/// </summary> | ||
[JsonPropertyName("creator")] | ||
public Info[] Creators { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing the release date of the production | ||
/// </summary> | ||
[JsonPropertyName("datePublished")] | ||
public string ReleaseDate { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing the genre list of the production | ||
/// </summary> | ||
[JsonPropertyName("genre")] | ||
public string[] Genres { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Property representing the name of the production | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing the keywords related to the production | ||
/// </summary> | ||
[JsonPropertyName("keywords")] | ||
public string Keywords { get; set; } | ||
|
||
/// <summary> | ||
/// Property representing the main image related to the production | ||
/// </summary> | ||
[JsonPropertyName("image")] | ||
public string Image { get; set; } | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using JMovies.IMDb.Entities.Interfaces; | ||
using JMovies.IMDb.Entities.Settings; | ||
using JMovies.IMDb.Entities.Settings.Presets; | ||
using JMovies.IMDb.Providers; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Linq; | ||
|
||
namespace JMovies.IMDb.Tests.Production | ||
{ | ||
/// <summary> | ||
/// Test class that contains the tests which are targeted for scraping runtime info related tests | ||
/// </summary> | ||
[TestClass] | ||
public class GenreTests | ||
{ | ||
/// <summary> | ||
/// Test Method that tests genre info of the TV Series "Hunters" | ||
/// </summary> | ||
[TestMethod] | ||
public void TestGenreOfHunters() | ||
{ | ||
IIMDbDataProvider imdbDataProvider = new IMDbScraperDataProvider(); | ||
ProductionDataFetchSettings settings = new BasicProductionDataFetchSettings(); | ||
Entities.Movies.TVSeries tvSeries = imdbDataProvider.GetTvSeries(7456722, settings); // https://www.imdb.com/title/tt7456722/ | ||
Assert.IsNotNull(tvSeries); | ||
Assert.IsNotNull(tvSeries.Genres); | ||
Assert.AreNotEqual(0, tvSeries.Genres.Count); | ||
Assert.IsTrue(Enumerable.SequenceEqual(new string[] { "Crime", "Drama", "Mystery" }, tvSeries.Genres.Select(e => e.Value).ToArray())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using JMovies.IMDb.Entities.Interfaces; | ||
using JMovies.IMDb.Entities.Settings; | ||
using JMovies.IMDb.Entities.Settings.Presets; | ||
using JMovies.IMDb.Providers; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System; | ||
|
||
namespace JMovies.IMDb.Tests.Production | ||
{ | ||
/// <summary> | ||
/// Test class that contains the tests which are targeted for scraping runtime info related tests | ||
/// </summary> | ||
[TestClass] | ||
public class RuntimeTests | ||
{ | ||
/// <summary> | ||
/// Test Method that tests runtime info of the TV Series "Hunters" | ||
/// </summary> | ||
[TestMethod] | ||
public void RuntimeOfHunters() | ||
{ | ||
IIMDbDataProvider imdbDataProvider = new IMDbScraperDataProvider(); | ||
ProductionDataFetchSettings settings = new BasicProductionDataFetchSettings(); | ||
Entities.Movies.TVSeries tvSeries = imdbDataProvider.GetTvSeries(7456722, settings); // https://www.imdb.com/title/tt7456722/ | ||
Assert.IsNotNull(tvSeries); | ||
Assert.AreNotEqual(default, tvSeries.Runtime); | ||
Assert.AreEqual(TimeSpan.FromMinutes(60), tvSeries.Runtime); | ||
} | ||
} | ||
} |
Oops, something went wrong.