public void ModularExponentiationCorrect(int b, int e, int m, int expectedRes) { var modularExponentiation = new ModularExponentiation(); var actualRes = modularExponentiation.ModularPow(b, e, m); actualRes.Should().Be(expectedRes); }
public void ModularExponentiationNegativeMod(int b, int e, int m) { var modularExponentiation = new ModularExponentiation(); Action res = () => modularExponentiation.ModularPow(b, e, m); res.Should().Throw <ArgumentException>() .WithMessage(String.Format("{0} is not a positive integer", m)); }