use of com.kickstarter.models.MessageThread in project android-oss by kickstarter.
the class MessagesViewModelTest method testProjectData_ExistingMessages.
@Test
public void testProjectData_ExistingMessages() {
final MessageThread messageThread = MessageThreadFactory.messageThread();
final MockApiClient apiClient = new MockApiClient() {
@Override
@NonNull
public Observable<MessageThreadEnvelope> fetchMessagesForThread(@NonNull final MessageThread thread) {
return Observable.just(MessageThreadEnvelopeFactory.messageThreadEnvelope());
}
};
setUpEnvironment(environment().toBuilder().apiClient(apiClient).currentUser(new MockCurrentUser(UserFactory.user())).build());
// Start the view model with a message thread.
this.vm.intent(messagesContextIntent(messageThread));
this.creatorNameTextViewText.assertValues(messageThread.project().creator().name());
this.projectNameTextViewText.assertValues(messageThread.project().name());
this.projectNameToolbarTextViewText.assertValues(messageThread.project().name());
}
use of com.kickstarter.models.MessageThread in project android-oss by kickstarter.
the class MessagesViewModelTest method testMessageEditTextHint.
@Test
public void testMessageEditTextHint() {
final MessageThread messageThread = MessageThreadFactory.messageThread();
final MockApiClient apiClient = new MockApiClient() {
@Override
@NonNull
public Observable<MessageThreadEnvelope> fetchMessagesForThread(@NonNull final MessageThread thread) {
return Observable.just(MessageThreadEnvelopeFactory.messageThreadEnvelope());
}
};
setUpEnvironment(environment().toBuilder().apiClient(apiClient).currentUser(new MockCurrentUser(UserFactory.user())).build());
// Start the view model with a message thread.
this.vm.intent(messagesContextIntent(messageThread));
this.messageEditTextHint.assertValues(messageThread.project().creator().name());
}
Aggregations