<commit_before>package ru.rulex.conclusion.dagger;

import org.junit.Test;
import ru.rulex.conclusion.Model;
import ru.rulex.conclusion.PhraseBuildersFacade.AbstractEventOrientedPhrasesBuilder;

import javax.inject.Named;

import static dagger.ObjectGraph.create;
import static org.fest.assertions.api.Assertions.assertThat;
import static ru.rulex.conclusion.dagger.DaggerDependencyAnalyzerModule.*;
import static ru.rulex.conclusion.delegate.ProxyUtils.callOn;

public class DaggerEventOrientedEngineTest
{
  @Test
  public void testDaggerBuilderWithDifferentTypes()
  {
    final AbstractEventOrientedPhrasesBuilder builder = create(
            $expression(
              $less( 19, callOn( Model.class ).getInteger() ),
              $less( 19, callOn( Model.class ).getOtherInteger() ),
              $more( 56.78f, callOn( Model.class ).getFloat() ) ) )
            .get( AbstractEventOrientedPhrasesBuilder.class );

    assertThat( builder.sync( Model.values( 20, 78 ) ) ).isTrue();
  }

  @Test
  public void testDaggerBuilderWithSameType()
  {
    final AbstractEventOrientedPhrasesBuilder builder = create(
      $expression(
        $less( 19, callOn( Model.class ).getInteger() ),
        $more( 79, callOn( Model.class ).getOtherInteger() ),
        $moreOrEquals( 56.78f, callOn( Model.class ).getFloat() ) ) )
          .get( AbstractEventOrientedPhrasesBuilder.class );

    assertThat( builder.sync( Model.values( 20, 78 ) ) ).isTrue();
  }

  /*
  TODO: implement like this API , with AnnotationProcessor
  public void testAnnotationApi() {<commit_msg>Just simple formatting<commit_after>package ru.rulex.conclusion.dagger;

import org.junit.Test;
import ru.rulex.conclusion.Model;
import ru.rulex.conclusion.PhraseBuildersFacade.AbstractEventOrientedPhrasesBuilder;

import javax.inject.Named;

import static dagger.ObjectGraph.create;
import static org.fest.assertions.api.Assertions.assertThat;
import static ru.rulex.conclusion.dagger.DaggerDependencyAnalyzerModule.*;
import static ru.rulex.conclusion.delegate.ProxyUtils.callOn;

public class DaggerEventOrientedEngineTest
{
  @Test
  public void testDaggerBuilderWithDifferentTypes()
  {
    final AbstractEventOrientedPhrasesBuilder builder = create(
      $expression(
        $less( 19, callOn( Model.class ).getInteger() ),
        $less( 19, callOn( Model.class ).getOtherInteger() ),
        $more( 56.78f, callOn( Model.class ).getFloat() ) ) )
      .get( AbstractEventOrientedPhrasesBuilder.class );

    assertThat( builder.sync( Model.values( 20, 78 ) ) ).isTrue();
  }

  @Test
  public void testDaggerBuilderWithSameType()
  {
    final AbstractEventOrientedPhrasesBuilder builder = create(
      $expression(
        $less( 19, callOn( Model.class ).getInteger() ),
        $more( 79, callOn( Model.class ).getOtherInteger() ),
        $moreOrEquals( 56.78f, callOn( Model.class ).getFloat() ) ) )
          .get( AbstractEventOrientedPhrasesBuilder.class );

    assertThat( builder.sync( Model.values( 20, 78 ) ) ).isTrue();
  }

  /*
  TODO: implement like this API , with AnnotationProcessor
  public void testAnnotationApi() {
{'fraction_non_alphanumeric': 0.11278436398590196, 'fraction_numerical': 0.01537968599807754, 'mean_word_length': 3.901098901098901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2772098', 'n_tokens_mistral': 998, 'n_tokens_neox': 942, 'n_words': 200}