예제 #1
0
        public void CpuReturnsRandNumberInCorrectInterval()
        {
            int min = 10;
            int max = 100;

            var ram = new Ram(8);
            var cpu = new Cpu(2, 32, ram);

            cpu.Rand(min, max);
            var actual = ram.LoadValue();

            Assert.IsTrue(min <= actual && actual < max);
        }
예제 #2
0
 public void CpuRandShouldThrowIfMinLessThanMax()
 {
     var cpu = new Cpu(2, 32, new Ram(8));
     cpu.Rand(100, 10);
 }