-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #65 Increased default buffer size used for upload/download to 64KB * Ensure ReportProgressChunkSize is lower than BufferSize. Improved ProgressionStream to send 100% event only once Added associated UTs * Throw proper assert if MEGAAPICLIENT_PASSWORD env variable is not set * Fixed other UTs
- Loading branch information
Showing
5 changed files
with
57 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,9 @@ public class AuthenticatedLoginTestsCollection : ICollectionFixture<Authenticate | |
|
||
public class AuthenticatedTestContext : TestContext, IDisposable | ||
{ | ||
private const string MegaApiClientPasswordEnvironment = "MEGAAPICLIENT_PASSWORD"; | ||
internal const string Username = "[email protected]"; | ||
internal static readonly string Password = Environment.GetEnvironmentVariable("MEGAAPICLIENT_PASSWORD"); | ||
internal static readonly string Password = Environment.GetEnvironmentVariable(MegaApiClientPasswordEnvironment); | ||
|
||
internal const string FileLink = "https://mega.nz/#!bkwkHC7D!AWJuto8_fhleAI2WG0RvACtKkL_s9tAtvBXXDUp2bQk"; | ||
internal const string FolderLink = "https://mega.nz/#F!e1ogxQ7T!ee4Q_ocD1bSLmNeg9B6kBw"; | ||
|
@@ -84,7 +85,7 @@ public virtual void Dispose() | |
|
||
protected override void ConnectClient(IMegaApiClient client) | ||
{ | ||
Assert.NotEmpty(Password); | ||
Assert.False(string.IsNullOrEmpty(Password), $"Environment variable {MegaApiClientPasswordEnvironment} not set."); | ||
client.Login(Username, Password); | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace CG.Web.MegaApiClient.Tests | ||
{ | ||
using System; | ||
using CG.Web.MegaApiClient.Tests.Context; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
[Collection("NotLoggedTests")] | ||
public class Options_Tests : TestsBase, IDisposable | ||
{ | ||
public Options_Tests(NotLoggedTestContext context, ITestOutputHelper testOutputHelper) | ||
: base(context, testOutputHelper) | ||
{ | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
} | ||
|
||
[Fact] | ||
public void ReportProgressChunkSize_LowerThan_BufferSize_Throws() | ||
{ | ||
var bufferSize = new Options().BufferSize; | ||
Assert.Throws<ArgumentException>("reportProgressChunkSize", () => new Options(reportProgressChunkSize: bufferSize - 1)); | ||
} | ||
} | ||
} |
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