public async Task SendConfirmationEmail_WhenValidUserIdRecieved()
        {
            var config = new Mock <IConfiguration>();
            var sms    = new Mock <ISMSVerification>();

            sms.Setup(x => x.SendVerificationToPhoneNumber(_testUser.PhoneNumber)).ReturnsAsync(true);

            var usrmgr = MockUserManager();
            var am     = new UserPhoneManager(config.Object, new NullLogger <UserPhoneManager>(), sms.Object, usrmgr.Object);
            var avatar = await am.GeneratePhoneConfirmation(_testUser.Id);

            Assert.True(avatar.Succeeded);
        }
        public async Task ReportError_WhenNotExistsUserIdRecieved()
        {
            var config = new Mock <IConfiguration>();
            var sms    = new Mock <ISMSVerification>();

            sms.Setup(x => x.SendVerificationToPhoneNumber(_testUser.PhoneNumber)).ReturnsAsync(true);

            var usrmgr = MockUserManager();
            var am     = new UserPhoneManager(config.Object, new NullLogger <UserPhoneManager>(), sms.Object, usrmgr.Object);
            var avatar = await am.GeneratePhoneConfirmation(Guid.NewGuid().ToString());

            Assert.False(avatar.Succeeded);
            Assert.Equal("Specified user does not exist!", avatar.Error.Description);
        }
        public async Task ReportError_WhenNullUserIdRecieved()
        {
            var config = new Mock <IConfiguration>();
            var sms    = new Mock <ISMSVerification>();

            sms.Setup(x => x.SendVerificationToPhoneNumber(_testUser.PhoneNumber)).ReturnsAsync(true);

            var usrmgr = MockUserManager();
            var am     = new UserPhoneManager(config.Object, new NullLogger <UserPhoneManager>(), sms.Object, usrmgr.Object);
            var avatar = await am.GeneratePhoneConfirmation(null);

            Assert.False(avatar.Succeeded);
            Assert.Equal("You must provide a user id  to genertae sms verification code!", avatar.Error.Description);
        }