Exemplo n.º 1
0
        public async Task TestCatService_GetCatListByOwnerGender_ShouldTwoItems()
        {
            HttpClient _client  = new HttpClient();
            var        api      = new agl_code_test_api.InfrastructureLayer.AGLApiComsumer(_client);
            CatService provider = new CatService(api);

            var result = await provider.ListAllCatsByOwner();

            Assert.Equal(2, result.Count);
        }
Exemplo n.º 2
0
        public async Task TestCatService_GetCatListByOwnerGender_ShouldIncludeBothMaleAndFemaleLists()
        {
            HttpClient _client  = new HttpClient();
            var        api      = new agl_code_test_api.InfrastructureLayer.AGLApiComsumer(_client);
            CatService provider = new CatService(api);

            var result = await provider.ListAllCatsByOwner();

            var maleList   = result.Where(x => x.OwnerGender == "Male").ToList();
            var femaleList = result.Where(x => x.OwnerGender == "Female").ToList();

            Assert.NotEmpty(maleList);
            Assert.Single(maleList);
            Assert.NotEmpty(femaleList);
            Assert.Single(femaleList);
        }