public async Task GetTransactionStatsOverYear()
        {
            var receivings = new List <ObjectReceiving>
            {
                new ObjectReceiving
                {
                    ReceivedAtUtc = DateTime.UtcNow.Date.AddDays(-1)
                },
                new ObjectReceiving
                {
                    ReceivedAtUtc = DateTime.UtcNow.Date.AddDays(-1)
                },
                new ObjectReceiving
                {
                    ReceivedAtUtc = DateTime.UtcNow.Date.AddDays(-1)
                },
                new ObjectReceiving
                {
                    ReceivedAtUtc = DateTime.UtcNow.Date.AddDays(-30)
                },
                new ObjectReceiving
                {
                    ReceivedAtUtc = DateTime.UtcNow.Date.AddDays(-30)
                },
            };

            var receivingsRepo = new Mock <IRepository <Guid, ObjectReceiving> >();

            receivingsRepo.Setup(rc => rc.Table).Returns(receivings.AsQueryable());

            var statsGetter = new TransactionStatisticsGetter(null, receivingsRepo.Object);

            var result = await statsGetter.GetTransactionsCountOverYear();

            Assert.IsTrue(result.Count == 12);
        }
Ejemplo n.º 2
0
 public TransactionController(ITransactionGetter transactionGetter, TransactionStatisticsGetter statsGetter)
 {
     _transactionGetter = transactionGetter;
     _statsGetter       = statsGetter;
 }
Ejemplo n.º 3
0
 public TransactionController(TransactionStatisticsGetter statsGetter)
 {
     _statsGetter = statsGetter;
 }