public async Task Book_Invalid_Data_NOk(DTO.Book book)
        {
            var token = await GetToken();

            var client = Fixture.SetRequestAuthorization(token.AccessToken);

            var payload = new StringContent(JsonConvert.SerializeObject(book, Fixture.SerializerSettings), Encoding.UTF8, "application/json");

            var response = await client.PostAsync("api/book", payload);

            Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
        }
Beispiel #2
0
 public async Task <IActionResult> Save(DTO.Book book)
 {
     return(Ok(await _bookRepository.SaveAsync(new Entities.Book(book))));
 }