Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Afischbacher committed Dec 30, 2023
1 parent 844789e commit d2c8b21
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 24 deletions.
15 changes: 6 additions & 9 deletions Nhl.Api.Tests/LeagueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
using Nhl.Api.Models.Enumerations.Player;
using Nhl.Api.Models.Enumerations.Team;
using Nhl.Api.Models.Season;
using Nhl.Api.Models.Standing;
using Nhl.Api.Models.Team;
using Nhl.Api.Tests.Helpers.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace Nhl.Api.Tests;

Expand Down Expand Up @@ -159,7 +156,7 @@ public async Task GetTeamScheduleBySeasonAsync_Returns_Not_Null_With_Valid_Infor
Assert.IsNotNull(game.PeriodDescriptor);
Assert.IsNotNull(game.EasternUTCOffset);
Assert.IsNotNull(game.VenueTimezone);
Assert.IsNotNull(game.GameType);
Assert.IsNotNull(game.GameType);
Assert.IsNotNull(game.GameState);
}
}
Expand Down Expand Up @@ -236,7 +233,7 @@ public async Task GetTeamWeekScheduleByDateTimeOffsetAsync_Returns_Not_Null_With
}

[TestMethodWithRetry(RetryCount = 5)]
[DataRow("2023-12-01")]
[DataRow("2023-12-01")]
[DataRow("2022-10-14")]
[DataRow("2013-11-15")]
[DataRow("2002-10-16")]
Expand All @@ -263,7 +260,7 @@ public async Task GetLeagueStandingsByDateTimeOffsetAsync_Get_League_Information
}

[TestMethodWithRetry(RetryCount = 5)]
public async Task GetLeagueStandingsSeasonInformationAsync_Get_Information_Is_Valid()
public async Task GetLeagueStandingsSeasonInformationAsync_Get_Information_Is_Valid()
{
// Arrange
await using INhlApi nhlApi = new NhlApi();
Expand Down Expand Up @@ -534,7 +531,7 @@ public async Task GetLeagueWeekScheduleByDateTimeAsync_Return_Valid_Information_
var result = await nhlApi.GetLeagueWeekScheduleByDateTimeAsync(DateTimeOffset.Parse(date));

// Assert
Assert.IsNotNull(result);
Assert.IsNotNull(result);
}

[TestMethodWithRetry(RetryCount = 5)]
Expand Down Expand Up @@ -576,7 +573,7 @@ public async Task GetGameScoresByDateTimeAsync_Valid_Information_With_Date(strin
}

[TestMethodWithRetry(RetryCount = 5)]
public async Task GetLeagueMetadataInformation_Returns_Valid_Information_Both_Players_Teams()
public async Task GetLeagueMetadataInformation_Returns_Valid_Information_Both_Players_Teams()
{
// Arrange
await using INhlApi nhlApi = new NhlApi();
Expand All @@ -599,7 +596,7 @@ public async Task GetLeagueMetadataInformation_Returns_Valid_Information_Just_Te
await using INhlApi nhlApi = new NhlApi();

// Act
var teams = new List<string> { "EDM","TOR" };
var teams = new List<string> { "EDM", "TOR" };
var result = await nhlApi.GetLeagueMetadataInformation(null, teams);

// Assert
Expand Down
10 changes: 4 additions & 6 deletions Nhl.Api.Tests/PlayerTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Nhl.Api.Enumerations.Game;
using Nhl.Api.Models.Enumerations.Player;
using Nhl.Api.Models.Game;
using Nhl.Api.Models.Player;
using Nhl.Api.Models.Season;
using Nhl.Api.Tests.Helpers.Attributes;
using System.Linq;
Expand Down Expand Up @@ -169,7 +167,7 @@ public async Task GetPlayerSeasonGameLogsBySeasonAndGameTypeAsync_Test_Player_En
Assert.IsNotNull(playerSeasonGameLog);
Assert.IsNotNull(playerSeasonGameLog.PlayerGameLogs);
Assert.IsTrue(playerSeasonGameLog.PlayerGameLogs.Count > 0);

foreach (var stat in playerSeasonGameLog.PlayerStatsSeasons)
{
Assert.IsNotNull(stat.Season);
Expand Down Expand Up @@ -630,7 +628,7 @@ public async Task GetLiveGameFeedPlayerShiftsAsync_Test_Get_Player_Information()
// Assert
Assert.IsNotNull(playerShifts);
Assert.AreEqual(790, playerShifts.PlayerShifts.Count);

var firstShift = playerShifts.PlayerShifts.OrderBy(ps => ps.EventNumber).First();
Assert.AreEqual(8475883, firstShift.PlayerId);
Assert.AreEqual(1, firstShift.ShiftNumber);
Expand Down Expand Up @@ -670,9 +668,9 @@ public async Task GetPlayerSpotlightAsync_Test_Get_Player_Spotlights_When_Season

// Act
var playerSpotlight = await nhlApi.GetPlayerSpotlightAsync();

var isLeagueActive = await nhlApi.IsLeagueActiveAsync();
if (isLeagueActive)
if (isLeagueActive)
{
// Assert
Assert.IsTrue(playerSpotlight.Count > 0);
Expand Down
5 changes: 2 additions & 3 deletions Nhl.Api.Tests/StatisticsTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Nhl.Api.Enumerations.Game;
using Nhl.Api.Enumerations.Statistic;
using Nhl.Api.Models.Game;
using Nhl.Api.Models.Season;
using Nhl.Api.Tests.Helpers.Attributes;
using System.Linq;
Expand Down Expand Up @@ -86,7 +85,7 @@ public async Task GetSkaterStatsisticsLeadersAsync_Returns_Valid_Information(Pla
[DataRow(GoalieStatisticsType.GoalsAgainstAverage, GameType.RegularSeason, SeasonYear.season20222023, 10)]
[DataRow(GoalieStatisticsType.SavePercentage, GameType.RegularSeason, SeasonYear.season20222023, 10)]
[DataRow(GoalieStatisticsType.Shutouts, GameType.RegularSeason, SeasonYear.season20222023, 10)]
[DataRow(GoalieStatisticsType.Wins, GameType.RegularSeason, SeasonYear.season20222023, 10)]
[DataRow(GoalieStatisticsType.Wins, GameType.RegularSeason, SeasonYear.season20222023, 10)]
public async Task GetGoalieStatsisticsLeadersAsync_Returns_Valid_Information(GoalieStatisticsType goalieStatisticsType, GameType gameType, string seasonYear, int limit)
{
// Arrange
Expand Down Expand Up @@ -122,7 +121,7 @@ public async Task GetGoalieStatsisticsLeadersAsync_Returns_Valid_Information(Goa
break;
default:
break;

}
}
}
6 changes: 3 additions & 3 deletions Nhl.Api.Tests/TeamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public async Task TestGetTeamLogoDarkAsIntAsync(int teamId)
[DataRow(24)]
[DataRow(25)]
[TestMethodWithRetry(RetryCount = 5)]
public async Task GetCurrentTeamScoreboardAsync_Get_Valid_Information_With_Id(int teamId)
public async Task GetCurrentTeamScoreboardAsync_Get_Valid_Information_With_Id(int teamId)
{
// Arrange
await using INhlApi nhlApi = new NhlApi();
Expand Down Expand Up @@ -213,7 +213,7 @@ public async Task GetCurrentTeamScoreboardAsync_Get_Valid_Information_With_Enum(
[DataRow(TeamEnum.BostonBruins, SeasonYear.season20132014)]
[DataRow(TeamEnum.VegasGoldenKnights, SeasonYear.season20222023)]
[DataRow(TeamEnum.TorontoMapleLeafs, SeasonYear.season19661967)]
[DataRow(TeamEnum.SeattleKraken,SeasonYear.season20232024)]
[DataRow(TeamEnum.SeattleKraken, SeasonYear.season20232024)]
[TestMethodWithRetry(RetryCount = 5)]
public async Task GetCurrentTeamScoreboardAsync_Get_Valid_Information_With_Enum(TeamEnum team, string seasonYear)
{
Expand Down Expand Up @@ -354,7 +354,7 @@ public async Task GetTeamSeasonScheduleBySeasonYearAsync_Get_Valid_Information_W
Assert.IsNotNull(teamRoster);
Assert.IsNotNull(teamRoster.Games);
Assert.IsTrue(teamRoster.Games.Count > 0);


}

Expand Down
1 change: 0 additions & 1 deletion Nhl.Api/Src/Api/NhlApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ public async Task<TeamSeasonSchedule> GetTeamSeasonScheduleByYearAndMonthAsync(T
return await _nhlGameApi.GetTeamSeasonScheduleByYearAndMonthAsync(team, month, year);
}


/// <summary>
/// Returns the NHL team schedule for the specified team and the specified date and time
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Nhl.Api/Src/LeagueApi/INhlLeagueApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public interface INhlLeagueApi
/// <param name="teams">A collection of NHL team identifiers, Example: [EDM, TOR]</param>
/// <returns>Returns the metadata information about the NHL league including players, teams and season states</returns>
Task<LeagueMetadataInformation> GetLeagueMetadataInformation(List<PlayerEnum> players, List<TeamEnum> teams);

/// <summary>
/// Determines if the NHL league is active or inactive based on the current date and time
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion Nhl.Api/Src/LeagueApi/NhlLeagueApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Nhl.Api.Models.Standing;
using Nhl.Api.Models.Team;
using Nhl.Api.Services;
using System;
using System.Linq;
using System.Text;

Expand Down

0 comments on commit d2c8b21

Please sign in to comment.