public void preTreatment_calculation_IntegrationgTest() { var proc = new Calculate(); proc.expression = "w(3.14)"; proc.preTreatment(); proc.calculation(); Assert.AreEqual("3.14:cos", proc.polish); Assert.AreEqual("-1.00", proc.result); }
public void preTreatment_addToOutput_IntegrationTest() { bool k = true; int i = 0, n = polishRecord.Count(); var proc = new Calculate(); proc.expression = "w(x(3.14/2))"; polishRecord.Add("3.14"); polishRecord.Add("2"); polishRecord.Add("x"); polishRecord.Add("w"); proc.preTreatment(); while (i < n) { k = polishRecord.ElementAt(i) == proc.polishRecord.ElementAt(i); i += 1; } Assert.IsTrue(k); proc = null; }