|
|
|
|
@ -34,7 +34,6 @@ namespace Volo.Abp.AspNetCore.Mvc
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task GetAll_Test()
|
|
|
|
|
{
|
|
|
|
|
//Ideally should be [GET] /api/app/people OK!
|
|
|
|
|
var result = await GetResponseAsObjectAsync<ListResultDto<PersonDto>>("/api/app/people");
|
|
|
|
|
result.Items.Count.ShouldBeGreaterThan(0);
|
|
|
|
|
}
|
|
|
|
|
@ -44,7 +43,6 @@ namespace Volo.Abp.AspNetCore.Mvc
|
|
|
|
|
{
|
|
|
|
|
var firstPerson = _personRepository.GetList().First();
|
|
|
|
|
|
|
|
|
|
//Ideally should be [GET] /api/app/people/{id} OK!
|
|
|
|
|
var result = await GetResponseAsObjectAsync<PersonDto>($"/api/app/people/{firstPerson.Id}");
|
|
|
|
|
result.Name.ShouldBe(firstPerson.Name);
|
|
|
|
|
}
|
|
|
|
|
@ -54,7 +52,6 @@ namespace Volo.Abp.AspNetCore.Mvc
|
|
|
|
|
{
|
|
|
|
|
var firstPerson = _personRepository.GetList().First();
|
|
|
|
|
|
|
|
|
|
//Ideally should be [DELETE] /api/app/people/{id} OK!
|
|
|
|
|
await Client.DeleteAsync($"/api/app/people/{firstPerson.Id}");
|
|
|
|
|
|
|
|
|
|
(await _personRepository.FindAsync(firstPerson.Id)).ShouldBeNull();
|
|
|
|
|
@ -67,7 +64,6 @@ namespace Volo.Abp.AspNetCore.Mvc
|
|
|
|
|
|
|
|
|
|
var postData = _jsonSerializer.Serialize(new PersonDto {Name = "John", Age = 33});
|
|
|
|
|
|
|
|
|
|
//Ideally should be [POST] /api/app/people OK!
|
|
|
|
|
var response = await Client.PostAsync(
|
|
|
|
|
"/api/app/people",
|
|
|
|
|
new StringContent(postData, Encoding.UTF8, "application/json")
|
|
|
|
|
@ -100,7 +96,6 @@ namespace Volo.Abp.AspNetCore.Mvc
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|
|
|
|
|
|
//Ideally should be [PUT] /api/app/people/{id} OK!
|
|
|
|
|
var response = await Client.PutAsync(
|
|
|
|
|
$"/api/app/people/{updateDto.Id}",
|
|
|
|
|
new StringContent(putData, Encoding.UTF8, "application/json")
|
|
|
|
|
@ -136,7 +131,7 @@ namespace Volo.Abp.AspNetCore.Mvc
|
|
|
|
|
|
|
|
|
|
//Ideally should be [POST] /api/people/{id}/phones
|
|
|
|
|
var response = await Client.PostAsync(
|
|
|
|
|
$"/api/app/people/{personToAddNewPhone.Id}/Phone",
|
|
|
|
|
$"/api/app/people/{personToAddNewPhone.Id}/phone",
|
|
|
|
|
new StringContent(postData, Encoding.UTF8, "application/json")
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|