mer unit test

This commit is contained in:
Geir Okkenhaug Jerstad 2025-01-03 13:23:45 +01:00
parent 8ff1f69ea3
commit 5b6d47da85
15 changed files with 386 additions and 0 deletions

View file

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,29 @@
namespace Calc;
public class Calculator
{
public int LeggSammen(int a, int b)
{
return a + b;
}
public int TrekkFra(int a, int b)
{
return a - b;
}
public int Multipliser(int a, int b)
{
return a * b;
}
public int Divider(int a, int b)
{
if (b == 0)
{
throw new ArgumentException("Cannot divide by zero.");
}
return a / b;
}
}

View file

@ -0,0 +1,3 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");