KalkulatorISP-31rrrrr/source/repos/РоговаИСП33тест/UnitTest1.cs
2025-11-11 14:18:33 +04:00

72 lines
1.7 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using BaseCalculator;
namespace РоговаИСП33тест
{
public class UnitTest1
{
[TestMethod]
public void Add()
{
long a = 5;
long b = 2;
long result = 7;
long fact = CalcClass.Add(a, b);
Assert.AreEqual(fact, result);
}
[TestMethod]
public void Sub()
{
long a = 5;
long b = 2;
long result = 3;
long fact = CalcClass.Sub(a, b);
Assert.AreEqual(fact, result);
}
[TestMethod]
public void Mult()
{
long a = 5;
long b = 2;
long result = 10;
long fact = CalcClass.Mult(a, b);
Assert.AreEqual(fact, result);
}
[TestMethod]
public void Div()
{
long a = 6;
long b = 2;
long result = 3;
long fact = CalcClass.Div(a, b);
Assert.AreEqual(fact, result);
}
[TestMethod]
public void Mod()
{
long a = 5;
long b = 2;
long result = 1;
long fact = CalcClass.Mod(a, b);
Assert.AreEqual(fact, result);
}
[TestMethod]
public void ABS()
{
long a = -6;
long result = 6;
long fact = CalcClass.ABS(a);
Assert.AreEqual(fact, result);
}
[TestMethod]
public void IABS()
{
long a = 6;
long result = -6;
long fact = CalcClass.IABS(a);
Assert.AreEqual(fact, result);
}
}
}