public void TestMul() { Calculator_ m = new Calculator_(); double a = 11; double b = 653.1; double c = 7184.1; double res = m.Mul(a, b); Assert.AreEqual(res.ToString("0.000"), c.ToString("0.000")); }
public void CallMethods() { // TODO: Generator should create a parameterless constructor. Calculator_ calc = new Calculator_(new CalculatorProps()); calc.Add(10); Assert.Equal((double)10, calc.Value); calc.Mul(2); Assert.Equal((double)20, calc.Value); calc.Pow(5); Assert.Equal((double)20 * 20 * 20 * 20 * 20, calc.Value); calc.Neg(); Assert.Equal((double)-3200000, calc.Value); }
public void Maps() { // TODO: Generator should create a parameterless constructor. Calculator_ calc = new Calculator_(new CalculatorProps()); calc.Add(10); calc.Add(20); calc.Mul(2); Assert.Collection( calc.OperationsMap["add"], val => { }, val => Assert.Equal((double)30, val.Value) ); Assert.Collection( calc.OperationsMap["mul"], val => { } ); }