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

hydra.testing.TestCase Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
// Note: this is an automatically generated file. Do not edit.

package hydra.testing;

import java.io.Serializable;

/**
 * A simple test case with an input and an expected output
 */
public class TestCase implements Serializable {
  public static final hydra.core.Name NAME = new hydra.core.Name("hydra/testing.TestCase");
  
  public final hydra.util.Opt description;
  
  public final hydra.testing.EvaluationStyle evaluationStyle;
  
  public final hydra.core.Term input;
  
  public final hydra.core.Term output;
  
  public TestCase (hydra.util.Opt description, hydra.testing.EvaluationStyle evaluationStyle, hydra.core.Term input, hydra.core.Term output) {
    java.util.Objects.requireNonNull((description));
    java.util.Objects.requireNonNull((evaluationStyle));
    java.util.Objects.requireNonNull((input));
    java.util.Objects.requireNonNull((output));
    this.description = description;
    this.evaluationStyle = evaluationStyle;
    this.input = input;
    this.output = output;
  }
  
  @Override
  public boolean equals(Object other) {
    if (!(other instanceof TestCase)) {
      return false;
    }
    TestCase o = (TestCase) (other);
    return description.equals(o.description) && evaluationStyle.equals(o.evaluationStyle) && input.equals(o.input) && output.equals(o.output);
  }
  
  @Override
  public int hashCode() {
    return 2 * description.hashCode() + 3 * evaluationStyle.hashCode() + 5 * input.hashCode() + 7 * output.hashCode();
  }
  
  public TestCase withDescription(hydra.util.Opt description) {
    java.util.Objects.requireNonNull((description));
    return new TestCase(description, evaluationStyle, input, output);
  }
  
  public TestCase withEvaluationStyle(hydra.testing.EvaluationStyle evaluationStyle) {
    java.util.Objects.requireNonNull((evaluationStyle));
    return new TestCase(description, evaluationStyle, input, output);
  }
  
  public TestCase withInput(hydra.core.Term input) {
    java.util.Objects.requireNonNull((input));
    return new TestCase(description, evaluationStyle, input, output);
  }
  
  public TestCase withOutput(hydra.core.Term output) {
    java.util.Objects.requireNonNull((output));
    return new TestCase(description, evaluationStyle, input, output);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy