Exemplo n.º 1
0
        public void ctor_Observation_IsSet(SimulationResultQuote sut)
        {
            var comparer = new LambdaEqualityComparer<Observation>(
                EqualsMethod: (o1,o2) => o1.Date == o2.Date && o1.CurrentQuoteCount.SequenceEqual(o2.CurrentQuoteCount));

            Assert.Equal<Observation>(Observation, sut.Observation, comparer );
        }
Exemplo n.º 2
0
        public static Tuple<SimulationResult, IReadOnlyList<SimulationResultQuote>, SyncTickers> CreateSut()
        {
            var quotes = new SimulationResultQuote[] { SimulationResultQuoteTests.CreateSut() }.AsReadOnlyList();
            var syncTickers = new SyncTickersBuilder().AddTicker(0).AddObservation(0, 1).AddDescription().Build();

            return Tuple.Create(new SimulationResult(quotes, syncTickers), quotes, syncTickers);
        }
Exemplo n.º 3
0
 public void Transactions_SetToNull_GetReturnsEmptyCollection(SimulationResultQuote sut)
 {
     sut.Transactions = null;
     Assert.Equal<int>(0, sut.Transactions.Count);
 }
Exemplo n.º 4
0
 public void Date_IsEqualToObservationDate(SimulationResultQuote sut)
 {
     Assert.Equal<DateTime>(Observation.Date, sut.Date);
 }
Exemplo n.º 5
0
 public void ctor_TickerQuantity_IsSet(SimulationResultQuote sut)
 {
     Assert.True(TickerQuantity.SequenceEqual(sut.TickerQuantity), "TickerQuantity is wrong.");
 }
Exemplo n.º 6
0
 public void ctor_Cash_IsSet(SimulationResultQuote sut)
 {
     Assert.Equal<double>(1, sut.Cash);
 }
Exemplo n.º 7
0
 public void Transactions_SetToSth_GetReturnsWhatWasSet(SimulationResultQuote sut)
 {
     var transactions = new Transaction[] { new Transaction(TransactionType.Buy, 1, 1, 0, 0, 1) }.AsReadOnlyList();
     sut.Transactions = transactions;
     Assert.Same(transactions, sut.Transactions);
 }