コード例 #1
0
        public void Change_Email()
        {
            var context = new MockContext();
            var encryptor = new Mock<IEncryptor>();
            context.Users.Add(new User { Username = "******", Email = "*****@*****.**" });

            var userStore = new UserStore(context, encryptor.Object);

            userStore.ChangeEmail("test", "*****@*****.**");

            var user = context.Users.First();
            Assert.AreEqual("*****@*****.**", user.Email);
            Assert.AreEqual(1, context.SaveChangesCalls);
        }
コード例 #2
0
        public void Change_Email_User_Not_Found()
        {
            var context = new MockContext();
            var encryptor = new Mock<IEncryptor>();

            var userStore = new UserStore(context, encryptor.Object);

            userStore.ChangeEmail("test", "*****@*****.**");
        }