Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from fengyhack/master
版本更新v7.2.11,新增MSTest for UWP
- Loading branch information
Showing
44 changed files
with
17,100 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25420.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qiniu.MSTest", "Qiniu.MSTest\Qiniu.MSTest.csproj", "{766DB66F-659B-4AB1-8142-65E7F462EEE6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|ARM = Debug|ARM | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|ARM = Release|ARM | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|ARM.ActiveCfg = Debug|ARM | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|ARM.Build.0 = Debug|ARM | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|ARM.Deploy.0 = Debug|ARM | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|x64.ActiveCfg = Debug|x64 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|x64.Build.0 = Debug|x64 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|x64.Deploy.0 = Debug|x64 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|x86.ActiveCfg = Debug|x86 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|x86.Build.0 = Debug|x86 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Debug|x86.Deploy.0 = Debug|x86 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|ARM.ActiveCfg = Release|ARM | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|ARM.Build.0 = Release|ARM | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|ARM.Deploy.0 = Release|ARM | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|x64.ActiveCfg = Release|x64 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|x64.Build.0 = Release|x64 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|x64.Deploy.0 = Release|x64 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|x86.ActiveCfg = Release|x86 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|x86.Build.0 = Release|x86 | ||
{766DB66F-659B-4AB1-8142-65E7F462EEE6}.Release|x86.Deploy.0 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.23 KB
src/Qiniu.MSTest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; | ||
using Qiniu.Util; | ||
using Qiniu.Http; | ||
using Qiniu.RS; | ||
using Qiniu.RS.Model; | ||
|
||
namespace Qiniu.UnitTest | ||
{ | ||
[TestClass] | ||
public class BucketManagerTest:QiniuTestEnvars | ||
{ | ||
[TestMethod] | ||
public async Task StatTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
StatResult result = await target.StatAsync(Bucket1, FileKey1); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_NOT_EXIST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task CopyTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.CopyAsync(Bucket1, FileKey1, Bucket2, FileKey2, true); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_NOT_EXIST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task MoveTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.MoveAsync(Bucket1, FileKey1, Bucket2, FileKey2, true); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_NOT_EXIST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task DeleteTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.DeleteAsync(Bucket1, FileKey1); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_NOT_EXIST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task ChgmTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.ChgmAsync(Bucket1, FileKey1, "MimeType"); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_NOT_EXIST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task BucketTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
BucketResult result = await target.BucketAsync(Bucket1); | ||
|
||
Assert.AreEqual((int)HttpCode.OK, result.Code); | ||
} | ||
|
||
[TestMethod] | ||
public async Task BucketsTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
BucketsResult result = await target.BucketsAsync(); | ||
|
||
Assert.AreEqual((int)HttpCode.OK, result.Code); | ||
} | ||
|
||
[TestMethod] | ||
public async Task BatchTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
string s1 = target.StatOp(Bucket1, FileKey1); | ||
string s2 = target.ChgmOp(Bucket2, FileKey2, "MimeType"); | ||
string[] ops = new string[] { s1, s2, "OP-UNDEF" }; | ||
BatchResult result = await target.BatchAsync(ops); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BAD_REQUEST|| | ||
result.Code == (int)HttpCode.PARTLY_OK); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task ListFilesTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.ListAsync(Bucket1, null, null, 100, null); | ||
|
||
Assert.AreEqual((int)HttpCode.OK, result.Code); | ||
} | ||
|
||
#if LOCAL_TEST | ||
|
||
[TestMethod] | ||
public async Task FetchTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.FetchAsync(TestURL1, Bucket1, FileKey1); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_EXISTS); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
#endif | ||
|
||
[TestMethod] | ||
public async Task PrefetchTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.PrefetchAsync(Bucket1, FileKey1); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.BAD_REQUEST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task UpdateLifecycleTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
HttpResult result = await target.UpdateLifecycleAsync(Bucket1, FileKey1, 1); | ||
|
||
bool cond = (result.Code == (int)HttpCode.OK || | ||
result.Code == (int)HttpCode.BUCKET_NOT_EXIST || | ||
result.Code == (int)HttpCode.FILE_NOT_EXIST); | ||
|
||
Assert.IsTrue(cond); | ||
} | ||
|
||
[TestMethod] | ||
public async Task DomainsTest() | ||
{ | ||
Mac mac = new Mac(AccessKey, SecretKey); | ||
BucketManager target = new BucketManager(mac); | ||
|
||
DomainsResult result = await target.DomainsAsync(Bucket1); | ||
|
||
Assert.AreEqual((int)HttpCode.OK, result.Code); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.