-
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 #13 from a-legotin/develop
Version 1.2.3
- Loading branch information
Showing
30 changed files
with
759 additions
and
76 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
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,63 @@ | ||
using System; | ||
using InstaSharper.Classes; | ||
using InstaSharper.Tests.Utils; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace InstaSharper.Tests.Endpoints | ||
{ | ||
[Collection("Endpoints")] | ||
public class LikesTest | ||
{ | ||
private readonly ITestOutputHelper _output; | ||
private readonly string _password = Environment.GetEnvironmentVariable("instaapiuserpassword"); | ||
private readonly string _username = "alex_codegarage"; | ||
|
||
public LikesTest(ITestOutputHelper output) | ||
{ | ||
_output = output; | ||
} | ||
|
||
[RunnableInDebugOnlyTheory] | ||
[InlineData("1484832969772514291_196754384")] | ||
public async void LikeTest(string mediaId) | ||
{ | ||
//arrange | ||
var apiInstance = | ||
TestHelpers.GetDefaultInstaApiInstance(new UserSessionData | ||
{ | ||
UserName = _username, | ||
Password = _password | ||
}); | ||
//act | ||
var loginSucceed = TestHelpers.Login(apiInstance, _output); | ||
Assert.True(loginSucceed); | ||
var result = await apiInstance.LikeMediaAsync(mediaId); | ||
var exploreGeed = result.Value; | ||
//assert | ||
Assert.True(result.Succeeded); | ||
Assert.NotNull(exploreGeed); | ||
} | ||
|
||
[RunnableInDebugOnlyTheory] | ||
[InlineData("1484832969772514291_196754384")] | ||
public async void UnLikeTest(string mediaId) | ||
{ | ||
//arrange | ||
var apiInstance = | ||
TestHelpers.GetDefaultInstaApiInstance(new UserSessionData | ||
{ | ||
UserName = _username, | ||
Password = _password | ||
}); | ||
//act | ||
var loginSucceed = TestHelpers.Login(apiInstance, _output); | ||
Assert.True(loginSucceed); | ||
var result = await apiInstance.UnLikeMediaAsync(mediaId); | ||
var exploreGeed = result.Value; | ||
//assert | ||
Assert.True(result.Succeeded); | ||
Assert.NotNull(exploreGeed); | ||
} | ||
} | ||
} |
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,19 @@ | ||
using InstaSharper.Helpers; | ||
using Xunit; | ||
|
||
namespace InstaSharper.Tests.Utils | ||
{ | ||
[Collection("Infrastructure")] | ||
public class InstaApiHelperTest | ||
{ | ||
[Fact] | ||
public void GetCodeFromIdTest() | ||
{ | ||
var expectedCode = "BQiSd7KFk9r"; | ||
var sourceId = 1450803251188748139; | ||
|
||
var actualCode = InstaApiHelper.GetCodeFromId(sourceId); | ||
Assert.Equal(expectedCode, actualCode); | ||
} | ||
} | ||
} |
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.