Ejemplo n.º 1
0
        public async Task GetAll_Cats_Successful()
        {
            var cats = await CatService.GetAll();

            cats.Count().Should().BeGreaterThan(0);
            ApiClientMock.VerifyGetAll <Cat>();
        }
Ejemplo n.º 2
0
        public IEnumerable <Cat> GetAll()
        {
            var retorno = (_service.GetAll());

            return(retorno);

            // para pegar todos os item do banco de dados
        }
Ejemplo n.º 3
0
        private IServiceTest Execute()
        {
            using (var context = new CatSharpContext(base.Options))
            {
                var service = new CatService(context);
                base.Result = service.GetAll();
            }

            return(this);
        }
Ejemplo n.º 4
0
        public async Task ShouldLoadAllCatsWithRank_WhenOptionsFilterApplyied()
        {
            using (var dbContext = DbContextFixture.GetDbContext())
            {
                var         service = new CatService(new HttpService(), dbContext, IConfigMock.GetCatsMock());
                IList <Cat> cats    = (await service.GetAll(new RequestOptions()
                {
                    Count = 5,
                    Offset = 0,
                    EloFilter = new MinMaxFilter()
                    {
                        Min = 1200, Max = 1500
                    },
                    IncludeMatchHistory = true
                }).ConfigureAwait(false)).ToList();

                Assert.NotNull(cats);
                Assert.NotEmpty(cats);
                Assert.True(cats.Count == 5);
                Assert.NotNull(cats[0].Rank);
                Assert.NotNull(cats[0].Informations);
                Assert.NotNull(cats[0].Informations.History);
            }
        }
Ejemplo n.º 5
0
 public static IList <CatGetDto> GetAllExt(this CatService service)
 {
     return(service.GetAll());
 }