forked from nickbutcher/plaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the weighting algorithm to allow multiple types in the list. A…
…dd tests
- Loading branch information
1 parent
99311dc
commit f8f0f75
Showing
6 changed files
with
178 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Copyright 2019 Google, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.plaidapp | ||
|
||
import io.plaidapp.core.data.Source | ||
import io.plaidapp.core.designernews.data.stories.model.Story | ||
import io.plaidapp.core.designernews.data.stories.model.StoryLinks | ||
import io.plaidapp.core.dribbble.data.api.model.Images | ||
import io.plaidapp.core.dribbble.data.api.model.Shot | ||
import io.plaidapp.core.dribbble.data.api.model.User | ||
import io.plaidapp.core.producthunt.data.api.model.Post | ||
import io.plaidapp.core.ui.filter.SourceUiModel | ||
import java.util.Date | ||
import java.util.GregorianCalendar | ||
|
||
val designerNewsSource = Source.DesignerNewsSearchSource( | ||
"query", | ||
true | ||
) | ||
val designerNewsSourceUiModel = SourceUiModel( | ||
designerNewsSource.key, | ||
designerNewsSource.name, | ||
designerNewsSource.active, | ||
designerNewsSource.iconRes, | ||
designerNewsSource.isSwipeDismissable, | ||
{}, | ||
{} | ||
) | ||
val dribbbleSource = Source.DribbbleSearchSource("dribbble", true) | ||
|
||
val post = Post( | ||
id = 345L, | ||
title = "Plaid", | ||
url = "www.plaid.amazing", | ||
tagline = "amazing", | ||
discussionUrl = "www.disc.plaid", | ||
redirectUrl = "www.d.plaid", | ||
commentsCount = 5, | ||
votesCount = 100 | ||
) | ||
|
||
val player = User( | ||
id = 1L, | ||
name = "Nick Butcher", | ||
username = "nickbutcher", | ||
avatarUrl = "www.prettyplaid.nb" | ||
) | ||
|
||
val shot = Shot( | ||
id = 1L, | ||
title = "Foo Nick", | ||
description = "", | ||
images = Images(), | ||
user = player | ||
).also { | ||
it.dataSource = dribbbleSource.key | ||
} | ||
|
||
const val userId = 5L | ||
const val storyId = 1345L | ||
val createdDate: Date = GregorianCalendar(2018, 1, 13).time | ||
val commentIds = listOf(11L, 12L) | ||
val storyLinks = StoryLinks( | ||
user = userId, | ||
comments = commentIds, | ||
upvotes = emptyList(), | ||
downvotes = emptyList() | ||
) | ||
|
||
val story = Story( | ||
id = storyId, | ||
title = "Plaid 2.0 was released", | ||
createdAt = createdDate, | ||
userId = userId, | ||
links = storyLinks | ||
).also { | ||
it.dataSource = designerNewsSource.key | ||
} |
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