diff --git a/Emne 3/Calc/Calculator.Test/UnitTest1.cs b/Emne 3/Calc/Calculator.Test/UnitTest1.cs index 7a5ad80..7d1f67a 100644 --- a/Emne 3/Calc/Calculator.Test/UnitTest1.cs +++ b/Emne 3/Calc/Calculator.Test/UnitTest1.cs @@ -8,6 +8,14 @@ public class Tests var calc = new Calc.Calculator(); var sum = calc.LeggSammen(1, 2); Assert.That(sum, Is.EqualTo(3)); + + } + [Test] + public void TestLeggSammenNetgativ() + { + var calc = new Calc.Calculator(); + var sum = calc.LeggSammen(-1, 2); + Assert.That(sum, Is.EqualTo(1)); } [Test] @@ -17,7 +25,13 @@ public class Tests var sum = calc.TrekkFra(2, 1); Assert.That(sum, Is.EqualTo(1)); } - + [Test] + public void TestTrekkFraNetgativ() + { + var calc = new Calc.Calculator(); + var sum = calc.TrekkFra(1, -2); + Assert.That(sum, Is.EqualTo(3)); + } [Test] public void TestMultipliser() { @@ -25,6 +39,13 @@ public class Tests var sum = calc.Multipliser(2, 2); Assert.That(sum, Is.EqualTo(4)); } + [Test] + public void TestMultipliserNegativ() + { + var calc = new Calc.Calculator(); + var sum = calc.Multipliser(3, -3); + Assert.That(sum, Is.EqualTo(-9)); + } [Test] public void TestDivision() @@ -33,7 +54,13 @@ public class Tests var sum = calc.Divider(4, 2); Assert.That(sum, Is.EqualTo(2)); } - + [Test] + public void TestDivisionNegative() + { + var calc = new Calc.Calculator(); + var sum = calc.Divider(4, -2); + Assert.That(sum, Is.EqualTo(-2)); + } [Test] public void TestDivisionByZero() {