コード例 #1
0
        public static void UpdateFirstLastName()
        {
            UserRepositoryADO repo = new UserRepositoryADO();
            var before             = repo.GetUserById("00000000-0000-0000-0000-000000000000");

            Assert.AreEqual("John", before.FirstName);
            Assert.AreEqual("smith", before.LastName);
            Assert.AreEqual("*****@*****.**", before.Email);
            repo.UpDateFirstLastName("Lee", "Bob", "00000000-0000-0000-0000-000000000000");
            var after = repo.GetUserById("00000000-0000-0000-0000-000000000000");

            Assert.AreEqual("Bob", after.FirstName);
            Assert.AreEqual("Lee", after.LastName);
            Assert.AreEqual("*****@*****.**", after.Email);
        }
コード例 #2
0
        public static void CanGetUser()
        {
            UserRepositoryADO repo = new UserRepositoryADO();
            var result             = repo.GetUserById("00000000-0000-0000-0000-000000000000");

            Assert.AreEqual("John", result.FirstName);
            Assert.AreEqual("smith", result.LastName);
            Assert.AreEqual("*****@*****.**", result.Email);
        }
コード例 #3
0
        public void CanGetUserById()
        {
            UserRepositoryADO repo = new UserRepositoryADO();

            User user = repo.GetUserById("00000000-0000-0000-0000-000000000000");

            Assert.AreEqual("00000000-0000-0000-0000-000000000000", user.Id);
            Assert.AreEqual("Sales", user.UserRole);
            Assert.AreEqual("*****@*****.**", user.UserName);
            Assert.AreEqual("*****@*****.**", user.Email);
            Assert.IsTrue(string.IsNullOrEmpty(user.PhoneNumber));
            Assert.IsFalse(string.IsNullOrEmpty(user.PasswordHash));
            Assert.IsFalse(string.IsNullOrEmpty(user.SecurityStamp));
            Assert.IsFalse(user.EmailConfirmed);
            Assert.IsFalse(user.PhoneNumberConfirmed);
            Assert.IsFalse(user.TwoFactorEnabled);
            Assert.AreEqual(user.LockoutEndDateUtc, DateTime.MinValue);
            Assert.IsFalse(user.LockoutEnabled);
            Assert.AreEqual(0, user.AccessFailedCount);
        }