public void CheckPin_WithCorrectPinBlock_ReturnsSuccess() { //setup var hsmSrvMock = new Mock <IHsmService>(); hsmSrvMock.Setup(x => x.CheckPin(It.IsAny <string>())).Returns(PinResult.SuccessfullPin); var atmService = new AtmService(hsmSrvMock.Object, null, null); //act PinResult pr = atmService.CheckPin("32423"); //assert Assert.Equal((int)PinResult.SuccessfullPin, (int)pr); }
public void CheckPin_WithWrongPinBlock_ReturnsWrongPin() { //setup string pinBlock = "8778"; var hsmSrvMock = new Mock <IHsmService>(); hsmSrvMock.Setup(x => x.CheckPin(pinBlock)).Returns(PinResult.WrongPin); var atmService = new AtmService(hsmSrvMock.Object, null, null); //act PinResult pr = atmService.CheckPin(pinBlock); //assert Assert.Equal((int)PinResult.ExpiredPin, (int)pr); }