Esempio n. 1
0
        // FIXME:
        // 1) JUST FOR WARM UP: .map() incoming Dictionary<string, object> to MessageDTO. For that purpose use MessageDTO.price()
        //    NOTE: Incoming Dictionary<string, object> contains keys PRICE_KEY and CURRENCY_KEY
        //    NOTE: Use MessageMapper utility class for message validation and transformation
        // Visible for testing
        IObservable <Dictionary <string, object> > SelectOnlyPriceUpdateEvents(IObservable <Dictionary <string, object> > input)
        {
            // TODO: filter only Price messages
            // TODO: verify that price message are valid
            // HINT: Use MessageMapper methods to perform filtering and validation

            return(input.Where(m => MessageMapper.IsPriceMessageType(m) && MessageMapper.IsValidPriceMessage(m)));
        }