public void probability_is_mapped() { var stream = FileHelper.OpenFile(TestData.FeedXmlPath, "probabilities.xml"); var message = _deserializer.Deserialize <cashout>(stream); TestData.FillMessageTimestamp(message); message.SportId = URN.Parse("sr:sport:1000"); var entity = _mapper.MapCashOutProbabilities <ICompetition>(message, new [] { TestData.Culture }, null); Assert.IsNotNull(entity, "entity should not be a null reference"); }
/// <summary> /// Asynchronously gets the cash out probabilities for the specified sport event /// </summary> /// <typeparam name="T">The type of the sport event</typeparam> /// <param name="param">a <see cref="String"/> specifying which probabilities to get</param> /// <param name="culture">A <see cref="CultureInfo"/> specifying the language of the returned data, or a null reference to use default languages</param> /// <returns>A <see cref="Task{T}" /> representing the asynchronous operation</returns> private async Task <ICashOutProbabilities <T> > GetProbabilitiesInternalAsync <T>(string param, CultureInfo culture = null) where T : ISportEvent { var data = _exceptionStrategy == ExceptionHandlingStrategy.THROW ? await _dataProvider.GetDataAsync(param).ConfigureAwait(false) : await new Func <string, Task <cashout> >(_dataProvider.GetDataAsync).SafeInvokeAsync( param, ExecutionLog, "Error occurred while fetching probabilities for " + param).ConfigureAwait(false); return(data == null ? null : _messageMapper.MapCashOutProbabilities <T>(data, culture == null ? _defaultCultures : new[] { culture }, null)); }