using System; public class Sum { public Int64 GetSum(Int64 a, Int64 b) => a + b; }
- using System;
- public class Sum
- {
public int GetSum(int a, int b) => a + b;- public Int64 GetSum(Int64 a, Int64 b) => a + b;
- }
namespace Solution { using NUnit.Framework; using System; [TestFixture] public class SolutionTest { [Test] public void MyTest() { Sum sum = new Sum(); Assert.AreEqual(19,sum.GetSum(9, 10)); Assert.AreEqual(22,sum.GetSum(12,10)); Assert.AreEqual(4294967292,sum.GetSum(2147483646,2147483646)); } } }
- namespace Solution {
- using NUnit.Framework;
- using System;
- [TestFixture]
- public class SolutionTest
- {
- [Test]
- public void MyTest()
- {
- Sum sum = new Sum();
Assert.AreEqual(19, sum.GetSum(9, 10));Assert.AreEqual(21, sum.GetSum(11, 10));Assert.AreEqual(4294967292, sum.GetSum(2147483646, 2147483646));}- Assert.AreEqual(19,sum.GetSum(9, 10));
- Assert.AreEqual(22,sum.GetSum(12,10));
- Assert.AreEqual(4294967292,sum.GetSum(2147483646,2147483646));
- }
- }
- }
Algorithms
Logic
public class BiggerNum{ public static int compare(int a, int b) { if(a>b) return a; else return b; } }
- public class BiggerNum{
- public static int compare(int a, int b) {
return 0;- if(a>b)
- return a;
- else
- return b;
- }
- }
import org.junit.Test; import static org.junit.Assert.assertEquals; import org.junit.runners.JUnit4; // TODO: Replace examples and use TDD development by writing your own tests public class SolutionTest { @Test public void testSomething() { int a = 10; int b = 5; assertEquals(10, BiggerNum.compare(a, b)); } }
- import org.junit.Test;
- import static org.junit.Assert.assertEquals;
- import org.junit.runners.JUnit4;
- // TODO: Replace examples and use TDD development by writing your own tests
- public class SolutionTest {
- @Test
- public void testSomething() {
- int a = 10;
- int b = 5;
//assertEquals(10, BiggerNum.compare(a, b));- assertEquals(10, BiggerNum.compare(a, b));
- }
- }