public async Task GetPostingLinesAsync_WhenAccountingNumberDoesNotExist_ReturnsEmptyPostingLineCollection()
        {
            IAccountingRepository sut = CreateSut();

            IPostingLineCollection result = await sut.GetPostingLinesAsync(WithNonExistingAccountingNumber(), DateTime.Today, 250);

            Assert.That(result.Count(), Is.EqualTo(0));
        }
コード例 #2
0
        public async Task QueryAsync_WhenNoPostingLineCollectionWasReturnedFromAccountingRepository_ReturnsEmptyPostingLineCollection()
        {
            QueryHandler sut = CreateSut(false);

            IGetPostingLineCollectionQuery query  = CreateQuery();
            IPostingLineCollection         result = await sut.QueryAsync(query);

            Assert.That(result.Count(), Is.EqualTo(0));
        }
コード例 #3
0
        public void Ordered_WhenPostingLineCollectionHasPostingLines_ReturnsPostingLineCollectionWithSameAmountOfPostingLines()
        {
            IPostingLineCollection sut = CreateSut();

            IPostingLine[] postingLines = _fixture.CreateMany <IPostingLine>(_random.Next(10, 25)).ToArray();
            sut.Add(postingLines);

            IPostingLineCollection result = sut.Ordered();

            Assert.That(result.Count(), Is.EqualTo(postingLines.Length));
        }
        public async Task GetPostingLinesAsync_WhenAccountingNumberExists_ReturnsNonEmptyPostingLineCollection()
        {
            IAccountingRepository sut = CreateSut();

            const int numberOfPostingLines = 25;
            IPostingLineCollection result  = await sut.GetPostingLinesAsync(WithExistingAccountingNumber(), DateTime.Today, numberOfPostingLines);

            int count = result.Count();

            Assert.That(count, Is.GreaterThan(0));
            Assert.That(count, Is.LessThanOrEqualTo(numberOfPostingLines));
        }
コード例 #5
0
        public void Top_WhenPostingLineCollectionContainsPostingLinesMoreThanNumberOfPostingLines_ReturnsPostingLineCollectionWithNumberOfPostingLines()
        {
            IPostingLineCollection sut = CreateSut();

            int numberOfPostingLines = _random.Next(10, 25);

            sut.Add(_fixture.CreateMany <IPostingLine>(numberOfPostingLines + _random.Next(1, 10)));

            IPostingLineCollection result = sut.Top(numberOfPostingLines);

            Assert.That(result.Count(), Is.EqualTo(numberOfPostingLines));
        }
コード例 #6
0
        public void Top_WhenPostingLineCollectionContainsPostingLinesEqualToNumberOfPostingLines_ReturnsPostingLineCollectionWithSameAmountOfPostingLines()
        {
            IPostingLineCollection sut = CreateSut();

            int numberOfPostingLines = _random.Next(10, 25);

            IPostingLine[] postingLines = _fixture.CreateMany <IPostingLine>(numberOfPostingLines).ToArray();
            sut.Add(postingLines);

            IPostingLineCollection result = sut.Top(numberOfPostingLines);

            Assert.That(result.Count(), Is.EqualTo(postingLines.Length));
        }