public static bool TestGetMinValue() { //arrange ControlFlowStatements1 minValue = new ControlFlowStatements1(); int expectedValue = 0; //act //assert if (expectedValue != minValue.getMinValue(minValue.initArray())) { return(false); } else { return(true); } }
public static bool TestInitArray() { //arrange ControlFlowStatements1 mas = new ControlFlowStatements1(); int[,] expectedArray = { { 0, 0, 0, 0, 0 }, { 0, 1, 2, 3, 4 } }; //act int[,] actualArray = mas.initArray(); //assert for (int i = 0; i < 2; i++) { for (int j = 0; j < 5; j++) { if (expectedArray[i, j] != actualArray[i, j]) { return(false); } } } return(true); }
public static bool TestGetFunctionValue() { ControlFlowStatements1 test = new ControlFlowStatements1(); if (Math.Round(test.GetFunctionValue(2), 1) != 1.8) { return(false); } if (test.GetFunctionValue(0) != 6) { return(false); } if (test.GetFunctionValue(-2) != 8) { return(false); } return(true); }
public static bool TestCalculateDeposite() { //arrange ControlFlowStatements1 obj = new ControlFlowStatements1(); BankDeposit expected = new BankDeposit(); BankDeposit actual = new BankDeposit(); expected.deposit = 5062.5; expected.year = 4; //act actual = obj.calculateDeposite(50); //assert if (expected.year != actual.year) { return(false); } if (expected.deposit != actual.deposit) { return(false); } return(true); }