<commit_before>package testCal;

import junit.framework.TestCase;
import cal.Addition;
import cal.Division;
import cal.Exponentiation;
import cal.Multiplication;
import cal.Operator;
import cal.Subtraction;
import cal.TrigoOperator;

public class OperatorTest extends TestCase{

	  private Operator factory;
	  
	  @Override
	public void tearDown() throws Exception {
	    factory = null;
	  }
	  
	  public void testCalculate1() {
		double expected = 3+4;
		factory = new Addition();
	    double actual = factory.calculate(3, 4);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate2() {
		double expected = 5-2;
		factory = new Subtraction();
	    double actual = factory.calculate(5, 2);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate3() {
		double expected = 4*5;
		factory = new Multiplication();
	    double actual = factory.calculate(4, 5);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate4() {
		double expected = 4/2;
		factory = new Division();
	    double actual = factory.calculate(4, 2);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate5() {
		double expected = Math.pow(2, 4);
		factory = new Exponentiation();
	    double actual = factory.calculate(2, 4);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate6(){
		  class StubSine extends TrigoOperator{
				public StubSine() {
					super("sin");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return Math.sin(val2);
				}
			}
		  double expected = 0.5;
		  factory = new StubSine();
		  double actual = factory.calculate(0, 30);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate7(){
		  class StubCosine extends TrigoOperator{
				public StubCosine() {
					super("cos");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return Math.cos(val2);
				}
			}
		  double expected = 0.5;
		  factory = new StubCosine();
		  double actual = factory.calculate(0, 60);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate8(){
		  class StubTangent extends TrigoOperator{
				public StubTangent() {
					super("tan");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return Math.tan(val2);
				}
			}
		  double expected = 1;
		  factory = new StubTangent();
		  double actual = factory.calculate(0, 45);
		  assertEquals(expected, actual);
	  }
	  
}<commit_msg>[Add] test case of Csc, Sec, Cot<commit_after>package testCal;

import junit.framework.TestCase;
import cal.Addition;
import cal.Division;
import cal.Exponentiation;
import cal.Multiplication;
import cal.Operator;
import cal.Subtraction;
import cal.TrigoOperator;

public class OperatorTest extends TestCase{

	  private Operator factory;
	  
	  @Override
	public void tearDown() throws Exception {
	    factory = null;
	  }
	  
	  public void testCalculate1() {
		double expected = 3+4;
		factory = new Addition();
	    double actual = factory.calculate(3, 4);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate2() {
		double expected = 5-2;
		factory = new Subtraction();
	    double actual = factory.calculate(5, 2);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate3() {
		double expected = 4*5;
		factory = new Multiplication();
	    double actual = factory.calculate(4, 5);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate4() {
		double expected = 4/2;
		factory = new Division();
	    double actual = factory.calculate(4, 2);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate5() {
		double expected = Math.pow(2, 4);
		factory = new Exponentiation();
	    double actual = factory.calculate(2, 4);
	    assertEquals(expected, actual);
	  }
	  
	  public void testCalculate6(){
		  class StubSine extends TrigoOperator{
				public StubSine() {
					super("sin");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return Math.sin(val2);
				}
			}
		  double expected = 0.5;
		  factory = new StubSine();
		  double actual = factory.calculate(0, 30);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate7(){
		  class StubCosine extends TrigoOperator{
				public StubCosine() {
					super("cos");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return Math.cos(val2);
				}
			}
		  double expected = 0.5;
		  factory = new StubCosine();
		  double actual = factory.calculate(0, 60);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate8(){
		  class StubTangent extends TrigoOperator{
				public StubTangent() {
					super("tan");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return Math.tan(val2);
				}
			}
		  double expected = 1;
		  factory = new StubTangent();
		  double actual = factory.calculate(0, 45);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate9(){
		  class StubScs extends TrigoOperator{
				public StubScs() {
					super("csc");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return 1/Math.sin(val2);
					
				}
			}
		  double expected = 2;
		  factory = new StubScs();
		  double actual = factory.calculate(0, 30);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate10(){
		  class StubSec extends TrigoOperator{
				public StubSec() {
					super("sec");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return 1/Math.cos(val2);
				}
			}
		  double expected = 1;
		  factory = new StubSec();
		  double actual = factory.calculate(0, 45);
		  assertEquals(expected, actual);
	  }
	  
	  public void testCalculate11(){
		  class StubCot extends TrigoOperator{
				public StubCot() {
					super("cot");	
				}

				@Override
				public double calculate(double val1, double val2) {
					return 1/Math.tan(val2);
				}
			}
		  double expected = 1;
		  factory = new StubCot();
		  double actual = factory.calculate(0, 45);
		  assertEquals(expected, actual);
	  }
	  
}
{'fraction_non_alphanumeric': 0.10690495532087733, 'fraction_numerical': 0.021283509341998377, 'mean_word_length': 2.8839116719242903, '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': '5912144', 'n_tokens_mistral': 2391, 'n_tokens_neox': 1862, 'n_words': 505}