public class Multiplication { //Changed Multip to Multiply, rules of clean code, never shorten names //Multiplies two integer parameters.. (leave comments on your code for better readability) public int Multiply(int a, int b) { return a * b; } }
- public class Multiplication
- {
public int Multip(int a, int b)- //Changed Multip to Multiply, rules of clean code, never shorten names
- //Multiplies two integer parameters.. (leave comments on your code for better readability)
- public int Multiply(int a, int b)
- {
- return a * b;
- }
- }
namespace Solution { using NUnit.Framework; using System; [TestFixture] public class SolutionTest { [Test] public void MyTest() { Multiplication test = new Multiplication(); Assert.AreEqual(150,test.Multiply(10,15)); Assert.AreEqual(100,test.Multiply(10,10)); Assert.AreEqual(80,test.Multiply(40,2)); Assert.AreEqual(16,test.Multiply(4,4)); Assert.AreEqual(1000000,test.Multiply(1000,1000)); } } }
- namespace Solution {
- using NUnit.Framework;
- using System;
- [TestFixture]
- public class SolutionTest
- {
- [Test]
- public void MyTest()
- {
int a = 10;int b = 5;int expected = 50;- Multiplication test = new Multiplication();
int actural = test.Multip(a, b);Assert.AreEqual(expected, actural);- Assert.AreEqual(150,test.Multiply(10,15));
- Assert.AreEqual(100,test.Multiply(10,10));
- Assert.AreEqual(80,test.Multiply(40,2));
- Assert.AreEqual(16,test.Multiply(4,4));
- Assert.AreEqual(1000000,test.Multiply(1000,1000));
- }
- }
- }