Ejemplo n.º 1
0
        public void SendOTPNonBackOff(int otpCount, BackOff backOff, DateTime dateTime, string code, SendOTPResponse expected)
        {
            this.counter.Setup(x => x.GetOTP()).Returns(otpCount);
            this.dac.Setup(x => x.GetBackOff()).Returns(backOff);
            this.time.Setup(x => x.GetNow()).Returns(dateTime);
            this.otp.Setup(x => x.GenerateOTP()).Returns(code);

            BackOffController backOffCtr = new BackOffController(counter.Object, dac.Object, time.Object, otp.Object);
            var result = backOffCtr.SendOTP();

            result.Should().BeEquivalentTo(expected);
        }