@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Xunit;
|
||||
using System.Linq;
|
||||
using static BetfairApi.Authentication;
|
||||
using BetfairApi.BettingModels;
|
||||
|
||||
namespace BetfairApi.Tests
|
||||
{
|
||||
public class EventsTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(TestSettings.Username, TestSettings.Password, TestSettings.AppKey)]
|
||||
public void TestGetEventsTypes(string username, string password, string appKey)
|
||||
{
|
||||
//Arrange
|
||||
var auth = new Authentication(username, password, appKey);
|
||||
var client = new BettingApiClient(auth);
|
||||
|
||||
//Act
|
||||
var eventsTypes = client.ListEventTypes(new BettingModels.MarketFilter()).Result;
|
||||
|
||||
//Assert
|
||||
Assert.True(eventsTypes.Length > 0);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(TestSettings.Username, TestSettings.Password, TestSettings.AppKey)]
|
||||
public void TestGetEvents(string username, string password, string appKey)
|
||||
{
|
||||
//Arrange
|
||||
var auth = new Authentication(username, password, appKey);
|
||||
var client = new BettingApiClient(auth);
|
||||
var eventTypes = client.ListEventTypes(new MarketFilter()).Result;
|
||||
var horseRacingEventType = eventTypes.FirstOrDefault(e => e.EventType.Name == "Horse Racing");
|
||||
var filter = new MarketFilter()
|
||||
{
|
||||
EventTypeIds = new[] { horseRacingEventType.EventType.Id },
|
||||
MarketCountries = new[] { "IE", "US" }
|
||||
};
|
||||
|
||||
//Act
|
||||
var horseRacingEvents = client.ListEvents(filter).Result;
|
||||
|
||||
//Assert
|
||||
Assert.True(horseRacingEvents.Length > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user