public void CpuRandomShouldBeInRange() { var cpu = new Cpu32(2); var actual = cpu.RandomInRange(1, 1); var expected = 1; Assert.AreEqual(expected, actual); }
public void CpuRandomShouldBeDifferent() { var cpu = new Cpu32(2); var actual = cpu.RandomInRange(1, 10); var expected = 1; Assert.AreNotEqual(expected, actual); }
public void TestCpuSquareWithNegativeNumber() { var cpu = new Cpu32(2); var actual = cpu.SquareNumber(-1); var expected = "Number too low."; Assert.AreEqual(expected, actual); }
public void TestCpu64SquareWithMoreThanMaxNumber() { var cpu = new Cpu32(2); var actual = cpu.SquareNumber(1001); var expected = "Number too high."; Assert.AreEqual(expected, actual); }
public void TestCpu32SquareWithNormalNumber() { var cpu = new Cpu32(2); var actual = cpu.SquareNumber(10); var expected = "Square of 10 is 100."; Assert.AreEqual(expected, actual); }
public void CpuRandomShouldBeMoreThanMin() { var cpu = new Cpu32(2); for (int i = 0; i < 1000; i++) { var actual = cpu.RandomInRange(10, 100); Assert.IsTrue(actual >= 10); } }
public void CpuRandomShouldBeLessThanMax() { var cpu = new Cpu32(2); for (int i = 0; i < 1000; i++) { var actual = cpu.RandomInRange(1, 100); Assert.IsTrue(actual <= 100); } }