Browse Source

Format code.

pull/9426/head
maliming 5 years ago
parent
commit
8863a4b7fb
  1. 5
      framework/src/Volo.Abp.Core/Volo/Abp/Content/RemoteStreamContent.cs
  2. 4
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
  3. 10
      framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs

5
framework/src/Volo.Abp.Core/Volo/Abp/Content/RemoteStreamContent.cs

@ -11,7 +11,8 @@ namespace Volo.Abp.Content
_stream = stream; _stream = stream;
} }
public RemoteStreamContent(Stream stream, string fileName): this(stream) public RemoteStreamContent(Stream stream, string fileName)
: this(stream)
{ {
FileName = fileName; FileName = fileName;
ContentType = "application/octet-stream"; ContentType = "application/octet-stream";
@ -19,7 +20,7 @@ namespace Volo.Abp.Content
public virtual string ContentType { get; set; } public virtual string ContentType { get; set; }
public virtual long? ContentLength => _stream.Length; public virtual long? ContentLength => GetStream().Length;
public virtual string FileName { get; set; } public virtual string FileName { get; set; }

4
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs

@ -280,7 +280,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying
throw new AbpRemoteCallException(errorResponse.Error) throw new AbpRemoteCallException(errorResponse.Error)
{ {
HttpStatusCode = (int)response.StatusCode HttpStatusCode = (int) response.StatusCode
}; };
} }
@ -292,7 +292,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying
} }
) )
{ {
HttpStatusCode = (int)response.StatusCode HttpStatusCode = (int) response.StatusCode
}; };
} }

10
framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs

@ -49,7 +49,7 @@ namespace Volo.Abp.Http.DynamicProxying
{ {
var people = await _peopleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); var people = await _peopleAppService.GetListAsync(new PagedAndSortedResultRequestDto());
people.TotalCount.ShouldBeGreaterThan(0); people.TotalCount.ShouldBeGreaterThan(0);
people.Items.Count.ShouldBe((int)people.TotalCount); people.Items.Count.ShouldBe((int) people.TotalCount);
} }
[Fact] [Fact]
@ -215,12 +215,12 @@ namespace Volo.Abp.Http.DynamicProxying
var result = await _peopleAppService.UploadMultipleAsync(new List<IRemoteStreamContent>() var result = await _peopleAppService.UploadMultipleAsync(new List<IRemoteStreamContent>()
{ {
new RemoteStreamContent(memoryStream,"File1.rtf") new RemoteStreamContent(memoryStream, "File1.rtf")
{ {
ContentType = "application/rtf" ContentType = "application/rtf"
}, },
new RemoteStreamContent(memoryStream2,"File2.rtf") new RemoteStreamContent(memoryStream2, "File2.rtf")
{ {
ContentType = "application/rtf2" ContentType = "application/rtf2"
} }
@ -265,12 +265,12 @@ namespace Volo.Abp.Http.DynamicProxying
Name = "123.rtf", Name = "123.rtf",
Contents = new List<IRemoteStreamContent>() Contents = new List<IRemoteStreamContent>()
{ {
new RemoteStreamContent(memoryStream,"1-1.rtf") new RemoteStreamContent(memoryStream, "1-1.rtf")
{ {
ContentType = "application/rtf" ContentType = "application/rtf"
}, },
new RemoteStreamContent(memoryStream2,"1-2.rtf") new RemoteStreamContent(memoryStream2, "1-2.rtf")
{ {
ContentType = "application/rtf2" ContentType = "application/rtf2"
} }

Loading…
Cancel
Save