public void AddingDecimals_Equals1(string psDecDigit1, string psDecDigit2) { bool boolCarry = false; string strErrMessage = ""; //var result = AddingDecs.AddDecDigits_ByArrays(" ", " ", boolCarry, strErrMessage); //------string strResult = AddingDecs.AddDecDigits_ByArrays(psDecDigit1, psDecDigit2, string strResult = AddingDecimalStrings.AddDecDigits_ByArrays(psDecDigit1, psDecDigit2, ref boolCarry, ref strErrMessage); bool bMatchesExpectation = (strResult == "1"); Assert.IsTrue(bMatchesExpectation, $"Added {psDecDigit1} and {psDecDigit2} should be equal to \"1\" not \"{strResult}\". " + strErrMessage); }
public void AddingNegatives_Equals0(string psDecDigit1, string psDecDigit2) { // //What happens when one of the numbers is negative? // bool boolCarry = false; string strErrMessage = ""; //string strResult = AddingDecs.AddDecDigits_ByArrays(psDecDigit1, psDecDigit2, string strResult = AddingDecimalStrings.AddDecDigits_ByArrays(psDecDigit1, psDecDigit2, ref boolCarry, ref strErrMessage); bool bMatchesExpectation = (strResult == "0"); Assert.IsTrue(bMatchesExpectation, $"Added {psDecDigit1} and {psDecDigit2} should be equal to \"0 \" not \"{strResult}\". " + strErrMessage); }
public void AddingDecimals_Equals20(string psDecimalString1, string psDecimalString2) { // //Added 2/26/2020 thomas downes // //bool boolCarry = false; string strErrMessage = ""; //var result = AddingDecs.AddDecDigits_ByArrays(" ", " ", boolCarry, strErrMessage); //string strResult = AddingDecs.AddDecDigits_ByArrays(psDecDigit1, psDecDigit2, // ref boolCarry, ref strErrMessage); //Added 2/26/2020 thomas downes //------string strResult = AddingDecs.AddDecDigits_PaddedStrings(psDecimalString1, psDecimalString2, ref strErrMessage); string strResult = AddingDecimalStrings.AddDecDigits_PaddedStrings(psDecimalString1, psDecimalString2, ref strErrMessage); bool bMatchesExpectation = (strResult == "3"); //Added 2/26/2020 thomas downes Assert.IsTrue(bMatchesExpectation, $"Added {psDecimalString1} and {psDecimalString2} should be equal to \"20\" not \"{strResult}\". " + strErrMessage); }