コード例 #1
0
        public void AddUserItemTest()
        {
            //Arrange
            DatabaseSvc testDAL = new DatabaseSvc(_connectionString);

            UserItem testUser = new UserItem
            {
                FirstName = "Jimmi",
                LastName  = "Test",
                Email     = "*****@*****.**",
                UserName  = "******",
                Password  = "******",
                Salt      = "JimmiSalt",
                IsAdmin   = false
            };

            //Act
            int      testUserId      = testDAL.AddUserItem(testUser);
            UserItem confirmTestUser = testDAL.GetUserItem(testUser.UserName);

            //Assert
            int confirmTestUserId = _userId + 1;

            Assert.AreEqual(confirmTestUserId, confirmTestUser.Id);
            Assert.AreEqual(confirmTestUser.Password, testUser.Password);
            Assert.AreEqual(confirmTestUser.Salt, testUser.Salt);
        }
コード例 #2
0
        public void GetUserItemTest()
        {
            //Arrange
            DatabaseSvc testDAL = new DatabaseSvc(_connectionString);

            //Act
            UserItem user = testDAL.GetUserItem(TestUserName);

            //Assert
            Assert.AreEqual(_userId, user.Id);
            Assert.AreEqual(TestPassword, user.Password);
            Assert.AreEqual(TestSalt, user.Salt);
        }