示例#1
0
        public void RegisterMemberWithoutDisplayName()
        {
            // Generate a random email address
            userName      = Guid.NewGuid().ToString().Replace("-", "_");
            emailAddress += userName + "@test.com";

            try
            {
                var member = new MemberVm()
                {
                    Email    = emailAddress,
                    Password = "******",
                    Username = userName
                };

                var dbMember = MemberSvc.CreateWithApplication(Manager.Id, member);

                _member        = dbMember.Member;
                _memberOptions = dbMember.Options;
                _memberLogin   = dbMember.Login;

                Assert.AreEqual(MemberManagerMessages.Error.MEMBER_DISPLAY_NAME_REQUIRED, dbMember.Message);
            }
            catch (Exception e)
            {
                Assert.AreEqual(MemberManagerMessages.Error.MEMBER_DISPLAY_NAME_REQUIRED, e.Message);
            }
        }
示例#2
0
        public void ExistingUsernameValidation()
        {
            var member = new MemberVm()
            {
                Email    = emailAddress,
                Password = "******",
                Username = userName
            };

            try
            {
                var dbMember = MemberSvc.CreateWithApplication(Manager.Id, member);
                Assert.AreEqual(MemberManagerMessages.Error.USERNAME_EXISTS, dbMember.Message);
            }
            catch (Exception e)
            {
                Assert.AreEqual(e.Message, MemberManagerMessages.Error.USERNAME_EXISTS);
            }
        }
示例#3
0
        public void RegisterMember()
        {
            // Generate a random email address
            userName      = Guid.NewGuid().ToString().Replace("-", "_");
            emailAddress += userName + "@test.com";

            var member = new MemberVm()
            {
                Email       = emailAddress,
                Password    = "******",
                DisplayName = "Sam Sample",
                Username    = userName
            };

            var dbMember = MemberSvc.CreateWithApplication(Manager.Id, member);

            _member        = dbMember.Member;
            _memberOptions = dbMember.Options;
            _memberLogin   = dbMember.Login;

            Assert.AreNotEqual(_member.Id, 0);
        }