public void ChangePasswordQuestionAndAnswerTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         Assert.IsTrue(target.ChangePasswordQuestionAndAnswer("", "", "", ""));
     }
 }
        public void CreateRoleTest()
        {
            using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
            {
                const string NEW_ROLE = "New Role";
                XmlRoleProvider target = this.MakeProvider(); // TODO: Initialize to an appropriate value
                string roleName = NEW_ROLE; // TODO: Initialize to an appropriate value
                target.CreateRole(roleName);

                Assert.IsTrue(target.RoleExists(NEW_ROLE));
            }
        }
 public void ApplicationNameTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         string expected = string.Empty; // TODO: Initialize to an appropriate value
         string actual;
         target.ApplicationName = expected;
         actual = target.ApplicationName;
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
        public void AddUsersToRolesTest()
        {
            using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
            {

                XmlRoleProvider target = this.MakeProvider(); // TODO: Initialize to an appropriate value
                string[] usernames = new[] { "Roman" }; // TODO: Initialize to an appropriate value
                string[] roleNames = new[] { "Admins", "Editors" }; // TODO: Initialize to an appropriate value

                Assert.IsFalse(target.IsUserInRole("Roman", "Admins"));
                Assert.IsTrue(target.IsUserInRole("Roman", "Editors"));

                target.AddUsersToRoles(usernames, roleNames);

                Assert.IsTrue(target.IsUserInRole("Roman", "Admins"));
                Assert.IsTrue(target.IsUserInRole("Roman", "Editors"));
            }
        }
 public void UpdateUserTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         MembershipUser user = null; // TODO: Initialize to an appropriate value
         target.UpdateUser(user);
         Assert.Inconclusive("A method that does not return a value cannot be verified.");
     }
 }
 public void RequiresUniqueEmailTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         bool actual;
         actual = target.RequiresUniqueEmail;
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
 public void PasswordStrengthRegularExpressionTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         string actual;
         actual = target.PasswordStrengthRegularExpression;
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
 public void MinRequiredPasswordLengthTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         int actual;
         actual = target.MinRequiredPasswordLength;
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
 public void InitializeTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         string name = string.Empty; // TODO: Initialize to an appropriate value
         NameValueCollection config = null; // TODO: Initialize to an appropriate value
         target.Initialize(name, config);
         Assert.Inconclusive("A method that does not return a value cannot be verified.");
     }
 }
 public void GetUserFromElementTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider_Accessor target = new XmlMembershipProvider_Accessor(); // TODO: Initialize to an appropriate value
         XElement userElement = null; // TODO: Initialize to an appropriate value
         MembershipUser expected = null; // TODO: Initialize to an appropriate value
         MembershipUser actual;
         actual = target.GetUserFromElement(userElement);
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
 public void GetNumberOfUsersOnlineTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         int expected = 0; // TODO: Initialize to an appropriate value
         int actual;
         actual = target.GetNumberOfUsersOnline();
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
 public void GetAllUsersTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         int pageIndex = 0; // TODO: Initialize to an appropriate value
         int pageSize = 0; // TODO: Initialize to an appropriate value
         int totalRecords = 0; // TODO: Initialize to an appropriate value
         int totalRecordsExpected = 0; // TODO: Initialize to an appropriate value
         MembershipUserCollection expected = null; // TODO: Initialize to an appropriate value
         MembershipUserCollection actual;
         actual = target.GetAllUsers(pageIndex, pageSize, out totalRecords);
         Assert.AreEqual(totalRecordsExpected, totalRecords);
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
 public void EncodePasswordTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider_Accessor target = new XmlMembershipProvider_Accessor(); // TODO: Initialize to an appropriate value
         string password = string.Empty; // TODO: Initialize to an appropriate value
         string expected = string.Empty; // TODO: Initialize to an appropriate value
         string actual;
         actual = target.EncodePassword(password);
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
Esempio n. 14
0
        public void DeleteRoleTest()
        {
            using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
            {
                XmlRoleProvider target = this.MakeProvider(); // TODO: Initialize to an appropriate value

                Assert.IsTrue(target.RoleExists("Admins"));
                target.DeleteRole("Admins", false);
                Assert.IsFalse(target.RoleExists("Admins"));
            }
        }
 public void ValidateUserTest()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         string username = string.Empty; // TODO: Initialize to an appropriate value
         string password = string.Empty; // TODO: Initialize to an appropriate value
         bool expected = false; // TODO: Initialize to an appropriate value
         bool actual;
         actual = target.ValidateUser(username, password);
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }
        public void CreateUserTest()
        {
            using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
            {
                XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
                string username = "******"; // TODO: Initialize to an appropriate value
                string password = "******"; // TODO: Initialize to an appropriate value
                string email = "*****@*****.**"; // TODO: Initialize to an appropriate value
                string passwordQuestion = string.Empty; // TODO: Initialize to an appropriate value
                string passwordAnswer = string.Empty; // TODO: Initialize to an appropriate value
                bool isApproved = true; // TODO: Initialize to an appropriate value
                object providerUserKey = null; // TODO: Initialize to an appropriate value
                MembershipCreateStatus status = new MembershipCreateStatus(); // TODO: Initialize to an appropriate value
                MembershipUser actual;

                actual = target.CreateUser(username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status);

                Assert.AreEqual("NewUser", actual.UserName);
                Assert.AreEqual("p1", actual.GetPassword());

            }
        }
 public void GetUserTest1()
 {
     using (var docPreserver = new XDocumentPreserver(ProviderHelper.TEST_XML_PATH))
     {
         XmlMembershipProvider target = MakeXmlMembershipProvider(); // TODO: Initialize to an appropriate value
         object providerUserKey = null; // TODO: Initialize to an appropriate value
         bool userIsOnline = false; // TODO: Initialize to an appropriate value
         MembershipUser expected = null; // TODO: Initialize to an appropriate value
         MembershipUser actual;
         actual = target.GetUser(providerUserKey, userIsOnline);
         Assert.AreEqual(expected, actual);
         Assert.Inconclusive("Verify the correctness of this test method.");
     }
 }