コード例 #1
0
        public async Task ReturnsStoreWithIdFrom15To30_GivenStoresByIdListSpec()
        {
            var ids  = Enumerable.Range(15, 16);
            var spec = new StoresByIdListSpec(ids);

            var stores = await storeRepository.ListAsync(spec);

            stores.Count.Should().Be(16);
            stores.OrderBy(x => x.Id).First().Id.Should().Be(15);
            stores.OrderBy(x => x.Id).Last().Id.Should().Be(30);
        }
コード例 #2
0
        public void ReturnsStoreWithIdFrom15To30_GivenStoresByIdListSpec()
        {
            var ids  = Enumerable.Range(15, 16);
            var spec = new StoresByIdListSpec(ids);

            var stores = spec.Evaluate(StoreSeed.Get());

            stores.Count().Should().Be(16);
            stores.OrderBy(x => x.Id).First().Id.Should().Be(15);
            stores.OrderBy(x => x.Id).Last().Id.Should().Be(30);
        }
コード例 #3
0
        public void ReturnsStoreWithIdFrom15To30_GivenStoresByIdListSpec()
        {
            var ids  = Enumerable.Range(15, 16);
            var spec = new StoresByIdListSpec(ids);

            var stores = evaluator.GetQuery(StoreSeed.AsQueryable(), spec).ToList();

            stores.Count.Should().Be(16);
            stores.OrderBy(x => x.Id).First().Id.Should().Be(15);
            stores.OrderBy(x => x.Id).Last().Id.Should().Be(30);
        }