public void CalculatePriceDifferenceIncorrectRowItemsTest() { //Try an incorrect one with wrong row amount of items Dataset ds = new Dataset(2, 2); int[] conversionFactors = new[] { 2 }; int[] itemFactor1 = new[] { 1, 1 }; int[][] itemFactors = new[] { itemFactor1 }; //create the controller and pass everything to it DatasetController controller = new DatasetController(); controller.CalculatePriceDifference(ds, conversionFactors, itemFactors); }
public void CalculatePriceDifferenceIncorrectConversionTest() { //Now check with bad values for conversionFactors Dataset ds = new Dataset(2, 2); int[] conversionFactors = new[] { 2, 2 }; int[] itemFactor1 = new[] { 1, 1 }; int[][] itemFactors = new[] { itemFactor1, itemFactor1 }; //create the controller and pass everything to it DatasetController controller = new DatasetController(); //if throws error it worked controller.CalculatePriceDifference(ds, conversionFactors, itemFactors); }
public void CalculatePriceDifferenceTest() { //Try a correct one Dataset ds = new Dataset(2, 2); int[] conversionFactors = { 2 }; int[] itemFactor1 = { 1, 1 }; int[][] itemFactors = { itemFactor1, itemFactor1 }; //create the controller and pass everything to it DatasetController controller = new DatasetController(); if (controller.CalculatePriceDifference(ds, conversionFactors, itemFactors) != 1) { Assert.Fail("Calculated price was expected to be 1"); } }