예제 #1
0
        public void ShouldReturnDefaultOtpSender(string mobileNumber)
        {
            var otpSender        = new OtpSender(null, null, null, null);
            var otpSenderFactory = new OtpSenderFactory(
                otpSender,
                new FakeOtpSender(null),
                new List <string>
            {
                mobileNumber
            });

            var response = otpSenderFactory.ServiceFor(mobileNumber);

            response.As <OtpSender>().Should().NotBeNull().And.BeEquivalentTo(otpSender);
        }
예제 #2
0
        public void ShouldReturnFakeOtpSender(string mobileNumber)
        {
            var fakeOtpSender    = new FakeOtpSender(null);
            var otpSenderFactory = new OtpSenderFactory(
                new OtpSender(null, null, null, null),
                fakeOtpSender,
                new List <string>
            {
                "+91-9999999999"
            });

            var otpSender = otpSenderFactory.ServiceFor(mobileNumber);

            otpSender.As <FakeOtpSender>().Should().NotBeNull().And.BeEquivalentTo(fakeOtpSender);
        }