Пример #1
0
        public async Task IUserEmailStore_SetEmailConfirmedAsync_User_Email_True()
        {
            // Arrange
            string name = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName;
            var    user = await StoreAsync(GetSession(), new SimpleUser()
            {
                UserName         = name,
                Email            = name,
                IsEmailConfirmed = true
            });

            IdentityResult result;

            // Act
            using (var mgr = new UserManager <SimpleUser>(new UserStore <SimpleUser, SimpleRole>(GetSession())
            {
                AutoSaveChanges = true
            })
            {
                UserValidator = MockHelper.CreateIdentityValidator <SimpleUser, string>(),
                UserTokenProvider = MockHelper.CreateUserTokenProvider <SimpleUser, string>()
            })
            {
                result = await mgr.ConfirmEmailAsync(user.Id, "wzdewfr3745ewf");
            }

            // Assert
            Assert.True(result.Succeeded);
            Assert.IsEmpty("TODO");

            // TearDown
            await base.Delete(GetSession(), user);
        }