Beispiel #1
0
        public async Task GetAllSazemen()
        {
            // Initialize the database
            await _sazemanRepository.CreateOrUpdateAsync(_sazeman);

            await _sazemanRepository.SaveChangesAsync();

            // Get all the sazemanList
            var response = await _client.GetAsync("/api/sazemen?sort=id,desc");

            response.StatusCode.Should().Be(HttpStatusCode.OK);

            var json = JToken.Parse(await response.Content.ReadAsStringAsync());

            json.SelectTokens("$.[*].id").Should().Contain(_sazeman.Id);
            json.SelectTokens("$.[*].sazemanName").Should().Contain(DefaultSazemanName);
        }
Beispiel #2
0
        public virtual async Task <Sazeman> Save(Sazeman sazeman)
        {
            await _sazemanRepository.CreateOrUpdateAsync(sazeman);

            await _sazemanRepository.SaveChangesAsync();

            return(sazeman);
        }