Initial commit
SuccessfulCode/BetfairApi/master This commit looks good

This commit is contained in:
2020-02-22 22:56:06 +00:00
parent 968d21d79b
commit 9417e73b51
131 changed files with 3390 additions and 0 deletions
+50
View File
@@ -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);
}
}
}