static void Main(string[] args) { Calculate cal = new Calculate(); int num1 = 30; int num2 = 10; int sub = cal.Subtract(num1, num2); int div = cal.Divide(num1, num2); int sum = Calculate.Add(num1, num2); int mult = Calculate.Multiply(num1, num2); Console.WriteLine("{0} + {1} => {2}", num1, num2, sum); Console.WriteLine("{0} - {1} => {2}", num1, num2, sub); Console.WriteLine("{0} * {1} => {2}", num1, num2, mult); Console.WriteLine("{0} / {1} => {2}", num1, num2, div); Console.ReadKey(); }
static void Main(string[] args) { Calculate obj = new Calculate(); int a = 8; int b = 7; int c = obj.Add(a, b); Console.WriteLine(c); string msg = obj.Greet("Anjani"); Console.WriteLine(msg); List <string> list = obj.getNames(); foreach (var i in list) { Console.WriteLine(i); } }
static void Main(string[] args) { Console.WriteLine("Static Key- " + Calculate.Add(1, 2) + " " + Calculate.Add(1, 2, 3, 4)); Calculate aCalculate = new Calculate(); double result = aCalculate.Multiply(3, 3, 3, 3); Console.WriteLine("Object create Multiply " + result); Calculate aCalculateSub = new Calculate(); double resultSub = aCalculateSub.Substractor(3, 3, 3, 3); Console.WriteLine("Object create Substrator " + resultSub); Console.WriteLine("CalculateTwo Class below:"); Console.WriteLine(CalculateAbstract.Substractor(30, 3)); Console.ReadKey(); }
public void WhenTheTwoNumbersAreAdded() { //TODO: implement act (action) logic _result = calculator.Add(); }
public void PassingTest() { Assert.AreEqual(4, calculate.Add(2, 2)); }
public void Add() { Calculate ex = new Calculate(); Assert.AreEqual(31, ex.Add(20, 11)); }
public void TestAdd1() { Assert.Equal(2, Calculate.Add(1, 1)); }
public void AddTest2() { Assert.Equal(3, Calculate.Add(1, 1)); }
public void AddTest() { var actual = _target.Add(2, 3); Assert.AreEqual(5, actual); }
public ActionResult Index(Data cal) { ViewBag.Result = Calculate.Add(cal.Value1, cal.Value2); return(View("Result")); }