/*
 * Copyright 2021 Google LLC
 *
 * 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
 *
 *     https://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 com.google.android.gnd.repository;

import static com.google.common.truth.Truth.assertThat;

import com.google.android.gnd.HiltTestWithRobolectricRunner;
import dagger.hilt.android.testing.HiltAndroidTest;
import javax.inject.Inject;
import org.junit.Test;

@HiltAndroidTest
public class TermsOfServiceRepositoryTest extends HiltTestWithRobolectricRunner {

  @Inject TermsOfServiceRepository termsOfServiceRepository;

  @Test
  public void testTermsOfServiceAccepted() {
    termsOfServiceRepository.setTermsOfServiceAccepted(true);
    assertThat(termsOfServiceRepository.isTermsOfServiceAccepted()).isTrue();
  }

  @Test
  public void testTermsOfServiceNotAccepted() {
    assertThat(termsOfServiceRepository.isTermsOfServiceAccepted()).isFalse();
  }
}

@@ -724,37 +724,129 @@
 gnd.
-HiltTestWithRobolectricRunner
+FakeData;%0Aimport com.google.android.gnd.HiltTestWithRobolectricRunner;%0Aimport com.google.android.gnd.model.TermsOfService
 ;%0Aim
@@ -1047,16 +1047,16 @@
 nner %7B%0A%0A
-
   @Injec
@@ -1109,16 +1109,335 @@
 itory;%0A%0A
+  @Test%0A  public void testGetTermsOfService() %7B%0A    termsOfServiceRepository%0A        .getTermsOfService()%0A        .test()%0A        .assertResult(%0A            TermsOfService.builder()%0A                .setId(FakeData.TERMS_OF_SERVICE_ID)%0A                .setText(FakeData.TERMS_OF_SERVICE)%0A                .build());%0A  %7D%0A%0A
   @Test%0A

Improve coverage for TermsOfServiceRepository