Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d045a95

Browse files
Added props unit test in search top headlines news use case
1 parent 01342ea commit d045a95

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎test/feature/domain/usecase/searchtopheadlinesnews/search_top_headlines_news_test.dart

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void main() {
1515
SearchTopHeadlinesNews searchTopHeadlinesNews;
1616
MockNewsRepository mockNewsRepository;
1717
final tKeyword = 'testKeyword';
18+
final tParamsSearchTopHeadlinesNews = ParamsSearchTopHeadlinesNews(keyword: tKeyword);
1819

1920
setUp(() {
2021
mockNewsRepository = MockNewsRepository();
@@ -35,7 +36,7 @@ void main() {
3536
.thenAnswer((_) async => Right(tTopHeadlinesNewsResponseModel));
3637

3738
// act
38-
final result = await searchTopHeadlinesNews(ParamsSearchTopHeadlinesNews(keyword: tKeyword));
39+
final result = await searchTopHeadlinesNews(tParamsSearchTopHeadlinesNews);
3940

4041
// assert
4142
expect(result, Right(tTopHeadlinesNewsResponseModel));
@@ -44,11 +45,21 @@ void main() {
4445
},
4546
);
4647

48+
test(
49+
'make sure the props value',
50+
() async {
51+
// assert
52+
expect(
53+
tParamsSearchTopHeadlinesNews.props,
54+
[tParamsSearchTopHeadlinesNews.keyword],
55+
);
56+
},
57+
);
58+
4759
test(
4860
'make sure the output of the toString function',
4961
() async {
5062
// assert
51-
final tParamsSearchTopHeadlinesNews = ParamsSearchTopHeadlinesNews(keyword: tKeyword);
5263
expect(
5364
tParamsSearchTopHeadlinesNews.toString(),
5465
'ParamsSearchTopHeadlinesNews{keyword: ${tParamsSearchTopHeadlinesNews.keyword}}',

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /