public void CflCentralIdTest() { var client = GetClient(); var filterValue = 148636; var options = PlayersRequestOptions.Create().WithFilter().CflCentralId.EqualTo(filterValue); var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().CflCentralId; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void RookieYearInTest() { var client = GetClient(); var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.RookieYear.In(1999, 2000) } }; var players = client.GetPlayers(options: options); var player99 = players.FirstOrDefault(p => p.RookieYear == 1999); var player00 = players.FirstOrDefault(p => p.RookieYear == 2000); Assert.IsNotNull(player99, Endpoint.RequestClient.LastRequestUrl); Assert.IsNotNull(player00, Endpoint.RequestClient.LastRequestUrl); }
public void GameDateEllingsonTest() { var client = GetClient(); var filterValue = new DateTime(2015, 06, 25); var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.GameDate.GreaterThanOrEqualTo(filterValue) } }; var player = client.GetPlayer(159820, includeGameByGame: true, options: options); var expected = filterValue.ToString("yyyy-MM-dd"); var actual = player.GameByGame?.Receiving?.FirstOrDefault().GameDate; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void WeightTest() { var client = GetClient(); var filterValue = 220; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.Weight.GreaterThanOrEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().Weight >= filterValue; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void PositionAbbreviationTest() { var client = GetClient(); var filterValue = PositionAbbreviations.Linebacker; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.PositionAbbreviation.GreaterThan(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().Position.Abbreviation.CompareTo(filterValue) == 1; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void LastNameTest() { var client = GetClient(); var filterValue = "Acy"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.LastName.GreaterThan(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().LastName.CompareTo(filterValue) == 1; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void PositionIdTest() { var client = GetClient(); var filterValue = PositionIds.Quarterback; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.PositionId.GreaterThan(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().Position.PositionId > filterValue; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void ForeignPlayerTest() { var client = GetClient(); var filterValue = false; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.ForeignPlayer.GreaterThan(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().ForeignPlayer != filterValue; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void FirstNameTest() { var client = GetClient(); var filterValue = "Tokumbo"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.FirstName.LessThanOrEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().FirstName.CompareTo(filterValue) <= 0; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void BirthDateTest() { var client = GetClient(); var filterValue = new DateTime(1982, 07, 26); var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.BirthDate.GreaterThan(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = DateTime.Parse(players.First().BirthDate) > filterValue; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void SchoolNameTest() { var client = GetClient(); var filterValue = "Western University"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.SchoolName.GreaterThanOrEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().School.Name.CompareTo(filterValue) >= 0; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void LastNameTest() { var client = GetClient(); var filterValue = "Acy"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.LastName.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue.ToUpper(); var actual = players.First().LastName; Assert.AreNotEqual(expected, actual); }
public void MiddleNameTest() { var client = GetClient(); var filterValue = "Danny"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.MiddleName.EqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().MiddleName; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void PositionAbbreviationTest() { var client = GetClient(); var filterValue = PositionAbbreviations.Linebacker; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.PositionAbbreviation.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().Position.Abbreviation; Assert.AreNotEqual(expected, actual); }
public void OffenceDefenceOrSpecialTest() { var client = GetClient(); var filterValue = OffenceDefenceOrSpecialValues.SpecialTeams; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.OffenceDefenceOrSpecial.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().Position.OffenceDefenceOrSpecial; Assert.AreNotEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void SchoolNameTest() { var client = GetClient(); var filterValue = "Western University"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.SchoolName.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().School.Name; Assert.AreNotEqual(expected, actual); }
public void PositionIdTest() { var client = GetClient(); var filterValue = PositionIds.Quarterback; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.PositionId.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().Position.PositionId; Assert.AreNotEqual(expected, actual); }
public void ForeignPlayerTest() { var client = GetClient(); var filterValue = true; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.ForeignPlayer.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().ForeignPlayer; Assert.AreNotEqual(expected, actual); }
public void CflCentralIdTest() { var client = GetClient(); var filterValue = 148636; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.CflCentralId.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().CflCentralId; Assert.AreNotEqual(expected, actual); }
public void CflCentralIdTest() { var client = GetClient(); var filterValue = 148636; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.CflCentralId.LessThanOrEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = true; var actual = players.First().CflCentralId <= filterValue; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void SeasonTest() { var client = GetClient(); var filterValue = 2015; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.Season.EqualTo(filterValue) } }; var players = client.GetPlayers(options: options); var expected = 161500; // Chris Ackie - there's no good way to test the result here, because the season doesn't actually appear in the response data var actual = players.First().CflCentralId; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void BirthDateTest() { var client = GetClient(); var filterValue = new DateTime(1982, 07, 26); var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.BirthDate.NotEqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue.ToString("yyyy-MM-dd"); var actual = players.First().BirthDate; Assert.AreNotEqual(expected, actual); }
public void SchoolIdTest() { var client = GetClient(); var filterValue = 116; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.SchoolId.EqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().School.SchoolId; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void RookieYearTest() { var client = GetClient(); var filterValue = 2007; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.RookieYear.EqualTo(filterValue) } }; var players = client.GetPlayers(1, 20, options); var expected = filterValue; var actual = players.First().RookieYear; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void HeightTest() { var client = GetClient(); var feet = 6; var inches = 6; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.Height.NotEqualTo(feet, inches) } }; var players = client.GetPlayers(1, 20, options); var expected = decimal.Parse($"{feet}.{inches.ToString("00")}"); var actual = players.First().Height; Assert.AreNotEqual(expected, actual); }
public void HeightTest() { var client = GetClient(); var feet = 6; var inches = 6; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.Height.EqualTo(feet, inches) } }; var players = client.GetPlayers(1, 20, options); var expected = $"{feet}.{inches.ToString("00")}";; var actual = players.First().Height; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void LastNameInTest() { var client = GetClient(); var filterValue = "Durant,Muamba"; var options = new PlayersRequestOptions { Filters = new[] { PlayersFilterFactory.LastName.In(filterValue) } }; var players = client.GetPlayers(options: options); var durant = players.FirstOrDefault(p => string.Equals(p.LastName, "Durant", StringComparison.InvariantCultureIgnoreCase)); var muamba = players.FirstOrDefault(p => string.Equals(p.LastName, "Muamba", StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(durant, Endpoint.RequestClient.LastRequestUrl); Assert.IsNotNull(muamba, Endpoint.RequestClient.LastRequestUrl); }
public void SortByCflCentralIdTest() { var client = GetClient(); var ascendingOptions = new PlayersRequestOptions { Sorts2 = new[] { FluentPlayersSortFactory.CflCentralId.Ascending } }; var descendingOptions = new PlayersRequestOptions { Sorts2 = new[] { FluentPlayersSortFactory.CflCentralId.Descending } }; var playersAscending = client.GetPlayers(1, 20, ascendingOptions); var playersDecending = client.GetPlayers(1, 20, descendingOptions); var lowest = playersAscending.First().CflCentralId; var highest = playersDecending.First().CflCentralId; var expected = true; var actual = highest > lowest; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void SortByLastNameTest() { var client = GetClient(); var ascendingOptions = new PlayersRequestOptions { Sorts = new[] { new PlayerSort(PlayerSortTypes.LastName, SortOrder.Ascending) } }; var descendingOptions = new PlayersRequestOptions { Sorts = new[] { new PlayerSort(PlayerSortTypes.LastName, SortOrder.Descending) } }; var playersAscending = client.GetPlayers(1, 20, ascendingOptions); var playersDecending = client.GetPlayers(1, 20, descendingOptions); var lowest = playersAscending.First().LastName; var highest = playersDecending.First().LastName; var expected = true; var actual = highest.CompareTo(lowest) == 1; Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }
public void SortByRookieYearTest() { var client = GetClient(); var ascendingOptions = new PlayersRequestOptions { Sorts = new[] { new PlayerSort(PlayerSortTypes.RookieYear, SortOrder.Ascending) } }; var descendingOptions = new PlayersRequestOptions { Sorts = new[] { new PlayerSort(PlayerSortTypes.RookieYear, SortOrder.Descending) } }; var playersAscending = client.GetPlayers(1, 20, ascendingOptions); var playersDecending = client.GetPlayers(1, 20, descendingOptions); var lowest = playersAscending.First().RookieYear; var highest = playersDecending.First().RookieYear; var expected = true; var actual = highest > lowest || (highest != null && lowest == null); Assert.AreEqual(expected, actual, Endpoint.RequestClient.LastRequestUrl); }