/// <summary> /// Gets the <see cref="IBetSettlement{T}"/> implementation representing the received bet settlement message translated to the specified languages /// </summary> /// <param name="culture">A <see cref="CultureInfo"/> specifying the language of which to translate the message or a null reference to translate the message /// to languages specified in the configuration</param> /// <returns>Returns the <see cref="IBetSettlement{T}"/> implementation representing the received bet settlement message translated to the specified languages</returns> public IBetSettlement <T> GetBetSettlement(CultureInfo culture = null) { return(_messageMapper.MapBetSettlement <T>( _feedMessage, culture == null ? _defaultCultures : new[] { culture }, _rawMessage)); }
private void LoadEntityFromFile(bool load = false) { if (_entity == null || load) { var stream = FileHelper.OpenFile(TestData.FeedXmlPath, "bet_settlement.xml"); _record = Deserializer.Deserialize <bet_settlement>(stream); TestData.FillMessageTimestamp(_record); _record.SportId = URN.Parse("sr:sport:1000"); _entity = _mapper.MapBetSettlement <ICompetition>(_record, new[] { TestData.Culture }, null); } }
public void BetSettlementIsMapped() { var stream = FileHelper.OpenFile(TestData.FeedXmlPath, "bet_settlement.xml"); var message = _deserializer.Deserialize <bet_settlement>(stream); TestData.FillMessageTimestamp(message); message.SportId = URN.Parse("sr:sport:1000"); _validator.Validate(message); var entity = _mapper.MapBetSettlement <ICompetition>(message, new [] { TestData.Culture }, null); Assert.IsNotNull(entity, "entity should not be a null reference"); }