/*-
 * #%L
 * Java implementation of the SciJava Ops matching engine.
 * %%
 * Copyright (C) 2016 - 2024 SciJava developers.
 * %%
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 * #L%
 */
/*
 * This is autogenerated source code -- DO NOT EDIT. Instead, edit the
 * corresponding template in templates/ and rerun bin/generate.groovy.
 */

package org.scijava.ops.engine.adapt.functional;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.scijava.ops.engine.AbstractTestEnvironment;
import org.scijava.ops.engine.create.CreateOpCollection;

public class ComputerToFunctionAdaptTest extends AbstractTestEnvironment {

	@BeforeAll
	public static void AddNeededOps() {
		ops.register(new ComputerToFunctionAdaptTestOps());
		ops.register(new CreateOpCollection());
		Object[] objects = objsFromNoArgConstructors(ComputersToFunctionsViaFunction.class.getDeclaredClasses());
		ops.register(objects);
	}

	@Test
	public void testComputer1ToFunction1() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in).outType(double[].class).apply();
		double[] expected = {2, 4}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer2ToFunction2() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in).outType(double[].class).apply();
		double[] expected = {4, 8}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer3ToFunction3() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in).outType(double[].class).apply();
		double[] expected = {6, 12}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer4ToFunction4() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in).outType(double[].class).apply();
		double[] expected = {8, 16}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer5ToFunction5() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {10, 20}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer6ToFunction6() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {12, 24}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer7ToFunction7() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {14, 28}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer8ToFunction8() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {16, 32}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer9ToFunction9() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {18, 36}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer10ToFunction10() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {20, 40}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer11ToFunction11() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {22, 44}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer12ToFunction12() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {24, 48}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer13ToFunction13() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {26, 52}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer14ToFunction14() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {28, 56}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer15ToFunction15() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {30, 60}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}

	@Test
	public void testComputer16ToFunction16() {
		double[] in = {2, 4};
		double[] output = ops.op("test.CtF").input(in, in, in, in, in, in, in, in, in, in, in, in, in, in, in, in).outType(double[].class).apply();
		double[] expected = {32, 64}; 
		Assertions.assertArrayEquals(expected, output, 0);
	}
}

