All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pkware.truth.android.playservices.location.ActivityRecognitionResultSubject Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
/*
 * Copyright 2013 Square, Inc.
 * Copyright 2016 PKWARE, 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 com.pkware.truth.android.playservices.location;

import com.google.android.gms.location.ActivityRecognitionResult;
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Subject;

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

/**
 * Propositions for {@link ActivityRecognitionResult} subjects.
 */
public class ActivityRecognitionResultSubject
    extends Subject {
  protected ActivityRecognitionResultSubject(FailureMetadata failureMetadata, ActivityRecognitionResult subject) {
    super(failureMetadata, subject);
  }

  public static Subject.Factory type() {
    return new Subject.Factory() {
      @Override
      public ActivityRecognitionResultSubject createSubject(FailureMetadata fm, ActivityRecognitionResult that) {
        return new ActivityRecognitionResultSubject(fm, that);
      }
    };
  }

  public ActivityRecognitionResultSubject hasElapsedRealtimeMillis(long millis) {
    assertThat(actual().getElapsedRealtimeMillis())
        .named("elapsed real-time millis")
        .isEqualTo(millis);
    return this;
  }

  public ActivityRecognitionResultSubject hasTime(long time) {
    assertThat(actual().getTime())
        .named("time")
        .isEqualTo(time);
    return this;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy