-
Notifications
You must be signed in to change notification settings - Fork 151
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 #39 from a-legotin/develop
1.2.5
- Loading branch information
Showing
62 changed files
with
1,560 additions
and
1,000 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using InstaSharper.API; | ||
using InstaSharper.Classes; | ||
using InstaSharper.Tests.Utils; | ||
|
||
namespace InstaSharper.Tests.Classes | ||
{ | ||
public class AuthenticatedTestFixture : IDisposable | ||
{ | ||
private readonly string _password = Environment.GetEnvironmentVariable("instaapiuserpassword"); | ||
private readonly string _username = "alex_codegarage"; | ||
|
||
public AuthenticatedTestFixture() | ||
{ | ||
ApiInstance = TestHelpers.GetDefaultInstaApiInstance(new UserSessionData | ||
{ | ||
UserName = _username, | ||
Password = _password | ||
}); | ||
|
||
var loginTask = Task.Run(ApiInstance.LoginAsync); | ||
if (!loginTask.Wait(TimeSpan.FromSeconds(10))) | ||
throw new Exception($"Unable to login, user: {_username}, password: {_password}."); | ||
} | ||
|
||
public IInstaApi ApiInstance { get; } | ||
|
||
public void Dispose() | ||
{ | ||
var logoutTask = Task.Run(ApiInstance.LogoutAsync); | ||
if (!logoutTask.Wait(TimeSpan.FromSeconds(10))) | ||
throw new Exception($"Not able to logout, user: {_username}, password: {_password}."); | ||
} | ||
|
||
public string GetUsername() | ||
{ | ||
return _username; | ||
} | ||
|
||
public string GetPassword() | ||
{ | ||
return _password; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...er.Tests/Utils/RunnableInDebugOnlyFact.cs → ....Tests/Classes/RunnableInDebugOnlyFact.cs
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
2 changes: 1 addition & 1 deletion
2
....Tests/Utils/RunnableInDebugOnlyTheory.cs → ...ests/Classes/RunnableInDebugOnlyTheory.cs
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,12 @@ | ||
using Xunit; | ||
|
||
namespace InstaSharper.Tests.Classes | ||
{ | ||
public sealed class SkippableFact : FactAttribute | ||
{ | ||
public SkippableFact() | ||
{ | ||
Skip = "This fact marked as skippable."; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.