Package utils

Examples of utils.FakeStockQuote


public class FakeStockQuoteTest {

    @Test
    public void fakeStockPriceShouldBePlusOrMinusFivePercentOfTheOldPrice() {
        FakeStockQuote stockQuote = new FakeStockQuote();
        Double origPrice = new Random().nextDouble();
        Double newPrice = stockQuote.newPrice(origPrice);
        assertThat(newPrice).isGreaterThan(origPrice - (origPrice * 0.05));
        assertThat(newPrice).isLessThan(origPrice + (origPrice * 0.05));
    }
View Full Code Here

TOP

Related Classes of utils.FakeStockQuote

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.