Search in sources :

Example 6 with Message

use of com.kickstarter.models.Message in project android-oss by kickstarter.

the class MessageHolderViewModelTest method testParticipantAvatarImage_CurrentUserIsSender.

@Test
public void testParticipantAvatarImage_CurrentUserIsSender() {
    final User recipient = UserFactory.user().toBuilder().name("Ima Creator").id(123L).build();
    final User sender = UserFactory.user().toBuilder().name("Ima Backer").id(456L).build();
    final Message message = MessageFactory.message().toBuilder().recipient(recipient).sender(sender).build();
    final MockCurrentUser currentUser = new MockCurrentUser(sender);
    setUpEnvironment(environment().toBuilder().currentUser(currentUser).build());
    this.vm.inputs.configureWith(message);
    // Avatar hidden for sender who is the backer.
    this.participantAvatarImageHidden.assertValues(true);
    this.participantAvatarImageUrl.assertNoValues();
}
Also used : User(com.kickstarter.models.User) MockCurrentUser(com.kickstarter.libs.MockCurrentUser) Message(com.kickstarter.models.Message) MockCurrentUser(com.kickstarter.libs.MockCurrentUser) Test(org.junit.Test)

Aggregations

MockCurrentUser (com.kickstarter.libs.MockCurrentUser)6 Message (com.kickstarter.models.Message)6 Test (org.junit.Test)6 User (com.kickstarter.models.User)4 NonNull (androidx.annotation.NonNull)2 MockApiClient (com.kickstarter.mock.services.MockApiClient)2 MessageSubject (com.kickstarter.ui.data.MessageSubject)2