public void ValidateUserTest2()
        {
            FelBookDBEntities  db = new FelBookDBEntities();
            IMembershipService MembershipService = new FelbookAccountMembershipService(db);
            bool result;

            // TODO - vytvoření uživatele "good user" s heslem "good passwod"
            // pokud existuje, tak je zálohován původní a nahrazen testovacím
            User user = User.CreateUser(0, "Ota", "Sandr",
                                        DateTime.Now, "mail", "good user", "");

            user.ChangePassword("good password");
            db.UserSet.AddObject(user);
            db.SaveChanges();

            result = MembershipService.ValidateUser("good user", "good password");
            Assert.IsTrue(result);

            result = MembershipService.ValidateUser("good user", "bad password");
            Assert.IsFalse(result);

            db.UserSet.DeleteObject(user);
            db.SaveChanges();

            // TODO - odstranění uživatele "good user" a vrácení původního, byl-li tam
            // TODO - pokud existuje uživatel "bad user", tak se vyjme z DB

            result = MembershipService.ValidateUser("bad user", "bad password");
            Assert.IsFalse(result);

            // TODO - pokud existoval předtím uživatel "bad user", tak ho tam vrať
        }
        public void ValidateUserTest1()
        {
            FelBookDBEntities  db = new FelBookDBEntities();
            IMembershipService MembershipService = new FelbookAccountMembershipService(db);

            #region usernameTests
            try
            {
                MembershipService.ValidateUser(null, "some password");
            }
            catch (ArgumentException ex)
            {
                Assert.AreEqual("Value cannot be null or empty." + Environment.NewLine + "Parameter name: userName", ex.Message);
            }

            try
            {
                MembershipService.ValidateUser("", "some password");
            }
            catch (ArgumentException ex)
            {
                Assert.AreEqual("Value cannot be null or empty." + Environment.NewLine + "Parameter name: userName", ex.Message);
            }
            #endregion

            #region passwordTests
            try
            {
                MembershipService.ValidateUser("some username", null);
            }
            catch (ArgumentException ex)
            {
                Assert.AreEqual("Value cannot be null or empty." + Environment.NewLine + "Parameter name: password", ex.Message);
            }

            try
            {
                MembershipService.ValidateUser("some username", "");
            }
            catch (ArgumentException ex)
            {
                Assert.AreEqual("Value cannot be null or empty." + Environment.NewLine + "Parameter name: password", ex.Message);
            }
            #endregion

            try
            {
                MembershipService.ValidateUser("some username", "some password");
            }
            catch (ArgumentException)
            {
                Assert.Fail();
            }
        }