File tree Expand file tree Collapse file tree
Integration/wikia.integration.tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11![ alt text] ( https://fablecode.visualstudio.com/wikia-core/_apis/build/status/wikia-core%20CD " Visual studio team services build status ")
22
33# Wikia-Core
4- Wikia is a C# .Net Standard 2.0 library that provides resource oriented interfaces and clients for the Wikia Api.
4+ Wikia is a C# .Net Standard 2.1 library that provides resource oriented interfaces and clients for the Wikia Api.
55
66## How?
77Every wiki has its API accessible through URL: {wikidomain}/api/v1/.
Original file line number Diff line number Diff line change 1+ using System . Threading . Tasks ;
2+ using FluentAssertions ;
3+ using NUnit . Framework ;
4+ using wikia . Api ;
5+ using wikia . Configuration ;
6+ using wikia . tests . core ;
7+
8+ namespace wikia . integration . tests . WikiArticleListTests
9+ {
10+ [ TestFixture ]
11+ [ Category ( TestType . Integration ) ]
12+ public class AlphabeticalListTests
13+ {
14+ [ TestCaseSource ( typeof ( WikiaTestData ) , nameof ( WikiaTestData . ArticleListTestData ) ) ]
15+ public async Task Given_An_ArticleCategory_The_Response_Items_Collection_Should_Not_Be_Empty ( string domainUrl , string category )
16+ {
17+ // Arrange
18+ var wikiaArticleList = new WikiArticleList ( domainUrl , WikiaSettings . ApiVersion ) ;
19+
20+ // Act
21+ var result = await wikiaArticleList . AlphabeticalList ( category ) ;
22+
23+ // Assert
24+ result . Items . Should ( ) . NotBeEmpty ( ) ;
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ using System . Threading . Tasks ;
2+ using FluentAssertions ;
3+ using NUnit . Framework ;
4+ using wikia . Api ;
5+ using wikia . Configuration ;
6+ using wikia . Models . Article ;
7+ using wikia . Models . Article . AlphabeticalList ;
8+ using wikia . tests . core ;
9+
10+ namespace wikia . integration . tests . WikiArticleListTests
11+ {
12+ [ TestFixture ]
13+ [ Category ( TestType . Integration ) ]
14+ public class ArticleListTests
15+ {
16+ [ TestCaseSource ( typeof ( WikiaTestData ) , nameof ( WikiaTestData . ArticleListTestData ) ) ]
17+ public async Task Given_An_ArticleListRequestParameters_The_Response_Items_Collection_Should_Not_Be_Empty ( string domainUrl , string category )
18+ {
19+ // Arrange
20+ var wikiaArticleList = new WikiArticleList ( domainUrl , WikiaSettings . ApiVersion ) ;
21+
22+ // Act
23+ var result = await wikiaArticleList . ArticleList < UnexpandedListArticleResultSet > ( new ArticleListRequestParameters { Category = category } , false ) ;
24+
25+ // Assert
26+ result . Items . Should ( ) . NotBeEmpty ( ) ;
27+ }
28+ }
29+
30+ [ TestFixture ]
31+ [ Category ( TestType . Integration ) ]
32+ public class NewArticlesTests
33+ {
34+ [ Test ]
35+ public async Task Given_An_NewArticleResultSet_Should_Return_New_Articles ( )
36+ {
37+ // Arrange
38+ const string domainUrl = "http://yugioh.fandom.com" ;
39+ var wikiaArticleList = new WikiArticleList ( domainUrl , WikiaSettings . ApiVersion ) ;
40+
41+ // Act
42+ var result = await wikiaArticleList . NewArticles ( ) ;
43+
44+ // Assert
45+ result . Items . Should ( ) . NotBeEmpty ( ) ;
46+ }
47+ }
48+ }
Original file line number Diff line number Diff line change @@ -26,5 +26,17 @@ public static IEnumerable<TestCaseData> ArticleIdTestUrlData
2626 ) ;
2727 }
2828 }
29+
30+ public static IEnumerable < TestCaseData > ArticleListTestData
31+ {
32+ get
33+ {
34+ yield return new TestCaseData
35+ (
36+ "http://yugioh.fandom.com" ,
37+ "Card_Tips"
38+ ) ;
39+ }
40+ }
2941 }
3042}
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >netcoreapp2.2 </TargetFramework >
4+ <TargetFramework >netcoreapp3.1 </TargetFramework >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Threading . Tasks ;
4- using FluentAssertions ;
1+ using FluentAssertions ;
52using NSubstitute ;
63using NUnit . Framework ;
4+ using System ;
5+ using System . Collections . Generic ;
6+ using System . Threading . Tasks ;
77using wikia . Api ;
88using wikia . Configuration ;
99using wikia . Models . Article ;
1010using wikia . Models . Article . AlphabeticalList ;
1111using wikia . Models . Article . Details ;
12- using wikia . Models . Article . NewArticles ;
1312using wikia . tests . core ;
1413
1514namespace wikia . unit . tests . WikiArticleListTests
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >netcoreapp2.2 </TargetFramework >
4+ <TargetFramework >netcoreapp3.1 </TargetFramework >
55
66 <IsPackable >false</IsPackable >
77 </PropertyGroup >
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >netstandard2.0 </TargetFramework >
4+ <TargetFramework >netstandard2.1 </TargetFramework >
55 <PackageId >wikia.core</PackageId >
66 <Authors >fablecode</Authors >
77 <Company >fablecode</Company >
You can’t perform that action at this time.
0 commit comments