Beispiel #1
0
        public void GetSingleValue_MultipleCurrenciesAvailable()
        {
            ISingleDataSource <int> dataSource = new XmlDataSource <int>("SingleValue", myDataStore);

            var stock = TomEntityBuilder.CreateStockHandle("SanDisk", "US80004C1018", "Dollar");
            var value = dataSource.ForStock(stock);

            Assert.That(value, Is.EqualTo(456));
        }
Beispiel #2
0
        public void GetSingleValue_MultipleCurrenciesAvailable()
        {
            ISingleDataSource<int> dataSource = new XmlDataSource<int>( "SingleValue", myDataStore );

            var stock = TomEntityBuilder.CreateStockHandle( "SanDisk", "US80004C1018", "Dollar" );
            var value = dataSource.ForStock( stock );

            Assert.That( value, Is.EqualTo( 456 ) );
        }
Beispiel #3
0
        public void GetPrices()
        {
            IEnumerableDataSource <SimplePrice> dataSource = new XmlDataSource <SimplePrice>("Prices", myDataStore);

            var stock  = TomEntityBuilder.CreateStockHandle("SanDisk", "US80004C1018", "Dollar");
            var prices = new TimedValueSet <DateTime, double>(dataSource.ForStock(stock));

            Assert.That(prices[new DateTime(2010, 12, 13)].Value, Is.EqualTo(4.63));
            Assert.That(prices[new DateTime(2010, 12, 12)].Value, Is.EqualTo(4.53));
            Assert.That(prices[new DateTime(2010, 12, 11)].Value, Is.EqualTo(4.43));
            Assert.That(prices[new DateTime(2010, 12, 10)].Value, Is.EqualTo(4.33));
        }
Beispiel #4
0
        public void GetPrices()
        {
            IEnumerableDataSource<SimplePrice> dataSource = new XmlDataSource<SimplePrice>( "Prices", myDataStore );

            var stock = TomEntityBuilder.CreateStockHandle( "SanDisk", "US80004C1018", "Dollar" );
            var prices = new TimedValueSet<DateTime, double>( dataSource.ForStock( stock ) );

            Assert.That( prices[ new DateTime( 2010, 12, 13 ) ].Value, Is.EqualTo( 4.63 ) );
            Assert.That( prices[ new DateTime( 2010, 12, 12 ) ].Value, Is.EqualTo( 4.53 ) );
            Assert.That( prices[ new DateTime( 2010, 12, 11 ) ].Value, Is.EqualTo( 4.43 ) );
            Assert.That( prices[ new DateTime( 2010, 12, 10 ) ].Value, Is.EqualTo( 4.33 ) );
        }