예제 #1
0
 public void SqaureNumberShoudThrowErrorWhenValueIsMoreThanMax()
 {
     Cpu32 cpu = new Cpu32(4);
     var motherboardMock = new Mock<IMotherboard>();
     motherboardMock.Setup(x => x.LoadRamValue()).Returns(Cpu32.MaxValue + 1);
     cpu.AttachTo(motherboardMock.Object);
     cpu.SquareNumber();
     motherboardMock.Verify(x => x.DrawOnVideoCard(
         It.Is<string>(param => param == Cpu.NumberTooHighMessage)));
 }
예제 #2
0
 public void SqaureNumberShoudOutputCorrectValues()
 {
     Cpu32 cpu = new Cpu32(4);
     var motherboardMock = new Mock<IMotherboard>();
     motherboardMock.Setup(x => x.LoadRamValue()).Returns(123);
     cpu.AttachTo(motherboardMock.Object);
     cpu.SquareNumber();
     motherboardMock.Verify(x => x.DrawOnVideoCard(
         It.Is<string>(param => param.Contains("15129"))));
 }