Skip to content

Commit 7c7edda

Browse files
committed
Fixed unit tests related to #144 PR
1 parent 123eb30 commit 7c7edda

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

MegaApiClient.Tests/Login.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,12 @@ public void GenerateAuthInfos_InvalidCredentials_Throws(string email, string pas
209209
Assert.Throws<ArgumentNullException>(expectedMessage, () => this.context.Client.GenerateAuthInfos(email, password));
210210
}
211211

212-
[Theory, InlineData("[email protected]", "password", "{'Email':'[email protected]','Hash':'ObELy57HULI','PasswordAesKey':'ZAM5cl5uvROiXwBSEp98sQ=='}")]
213-
public void GenerateAuthInfos_ValidCredentials_Succeeds(string email, string password, string expectedResult)
212+
[Theory]
213+
[InlineData("[email protected]", "password", null, "{'Email':'[email protected]','Hash':'ObELy57HULI','PasswordAesKey':'ZAM5cl5uvROiXwBSEp98sQ==','MFAKey':null}")]
214+
[InlineData("[email protected]", "password", "mfa", "{'Email':'[email protected]','Hash':'ObELy57HULI','PasswordAesKey':'ZAM5cl5uvROiXwBSEp98sQ==','MFAKey':'mfa'}")]
215+
public void GenerateAuthInfos_ValidCredentials_Succeeds(string email, string password, string mfa, string expectedResult)
214216
{
215-
var authInfos = this.context.Client.GenerateAuthInfos(email, password);
217+
var authInfos = this.context.Client.GenerateAuthInfos(email, password, mfa);
216218
var result = JsonConvert.SerializeObject(authInfos, Formatting.None).Replace('\"', '\'');
217219

218220
Assert.Equal(expectedResult, result);

MegaApiClient/MegaApiClient.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,14 +1241,7 @@ private IEnumerable<int> ComputeChunksSizesToUpload(long[] chunksPositions, long
12411241

12421242
public class AuthInfos
12431243
{
1244-
public AuthInfos(string email, string hash, byte[] passwordAesKey)
1245-
{
1246-
this.Email = email;
1247-
this.Hash = hash;
1248-
this.PasswordAesKey = passwordAesKey;
1249-
}
1250-
1251-
public AuthInfos(string email, string hash, byte[] passwordAesKey, string mfaKey)
1244+
public AuthInfos(string email, string hash, byte[] passwordAesKey, string mfaKey = null)
12521245
{
12531246
this.Email = email;
12541247
this.Hash = hash;

0 commit comments

Comments
 (0)