当前位置: 首页>>代码示例>>C#>>正文


C# EmailAddress.Equals方法代码示例

本文整理汇总了C#中EmailAddress.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# EmailAddress.Equals方法的具体用法?C# EmailAddress.Equals怎么用?C# EmailAddress.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmailAddress的用法示例。


在下文中一共展示了EmailAddress.Equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WhenGivenAnEmailWithUpperCases_WhenMatchingSameEmailWithLowerCase_ThenShouldMatch

        public void WhenGivenAnEmailWithUpperCases_WhenMatchingSameEmailWithLowerCase_ThenShouldMatch()
        {
            // arrange
            var lower = new EmailAddress("[email protected]");
            var upper = new EmailAddress("[email protected]");

            // act
            var result = lower.Equals(upper);

            // assert
            result.Should().BeTrue();
        }
开发者ID:Jork,项目名称:Billboard,代码行数:12,代码来源:EmailAddressSpecs.cs

示例2: EqualsMethod

        public void EqualsMethod()
        {
            var email1 = new EmailAddress("[email protected]");
            var email2 = new EmailAddress("[email protected]");

            Assert.True(email1.Equals(email2));
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:7,代码来源:EmailAddressTests.cs

示例3: EmailAddress_Unit_Equals2_ObjIsSameObject

        public void EmailAddress_Unit_Equals2_ObjIsSameObject()
        {
            String localPart = "Chad.Greer";
            String domain = "ParivedaSolutions.com";
            EmailAddress target = new EmailAddress(localPart, domain);
            EmailAddress other = target;

            Boolean actual = target.Equals(other);
            Assert.AreEqual(true, actual);
        }
开发者ID:cegreer,项目名称:Common,代码行数:10,代码来源:EmailAddressTests.cs

示例4: EmailAddress_Unit_Equals2_ObjHasDifferentLocalPart

        public void EmailAddress_Unit_Equals2_ObjHasDifferentLocalPart()
        {
            String localPart = "Chad.Greer";
            String domain = "ParivedaSolutions.com";
            EmailAddress target = new EmailAddress(localPart, domain);
            EmailAddress other = new EmailAddress(localPart + "Test", domain);

            Boolean actual = target.Equals(other);
            Assert.AreEqual(false, actual);
        }
开发者ID:cegreer,项目名称:Common,代码行数:10,代码来源:EmailAddressTests.cs

示例5: EmailAddress_Unit_Equals1_ObjIsNull

        public void EmailAddress_Unit_Equals1_ObjIsNull()
        {
            String localPart = "Chad.Greer";
            String domain = "ParivedaSolutions.com";
            EmailAddress target = new EmailAddress(localPart, domain);
            Object obj = null;

            Boolean actual = target.Equals(obj);
            Assert.AreEqual(false, actual);
        }
开发者ID:cegreer,项目名称:Common,代码行数:10,代码来源:EmailAddressTests.cs

示例6: EmailAddress_Unit_Equals1_ObjIsEquivalentObject

        public void EmailAddress_Unit_Equals1_ObjIsEquivalentObject()
        {
            String localPart = "Chad.Greer";
            String domain = "ParivedaSolutions.com";
            EmailAddress target = new EmailAddress(localPart, domain);
            Object obj = new EmailAddress(localPart.ToUpperInvariant(), domain.ToUpperInvariant());

            Boolean actual = target.Equals(obj);
            Assert.AreEqual(true, actual);
        }
开发者ID:cegreer,项目名称:Common,代码行数:10,代码来源:EmailAddressTests.cs

示例7: SignUp

        public ActionResult SignUp(AccountRegistration information)
        {
            var username = new Username(information.Username);

            bool usernameIsAvailable = _accountRegistrationService.IsUsernameAvailable(username);
            if (!usernameIsAvailable) {
                TempData.RegistrationFailureReason.Store(RegistrationFailureReason.UsernameNotAvailable);
                TempData.AccountRegistrationInformation.Store(information);
                return RedirectToAction<AccountController>(c => c.SignUp());
            }

            var password = new Password(information.Password);
            var passwordConfirmation = new Password(information.PasswordConfirmation);
            if (!password.Equals(passwordConfirmation)) {
                TempData.RegistrationFailureReason.Store(RegistrationFailureReason.PasswordsDoNotMatch);
                return RedirectToAction<AccountController>(c => c.SignUp());
            }

            var emailAddress = new EmailAddress(information.Email);
            var emailAddressConfirmation = new EmailAddress(information.EmailConfirmation);
            if (!emailAddress.Equals(emailAddressConfirmation)) {
                TempData.RegistrationFailureReason.Store(RegistrationFailureReason.EmailsDoNotMatch);
                return RedirectToAction<AccountController>(c => c.SignUp());
            }

            var foo = new GivenNames();

            var fullName = new FullName(new Name(information.LastName), new GivenNames(information.FirstName));
            var accountRegistration = new AccountManagement.AccountRegistration(username, password, fullName, new EmailAddress(information.Email));
            _accountRegistrationService.CreateAccount(accountRegistration);

            TempData.NewAccountUsername.Store(accountRegistration.Username);
            return RedirectToAction<AccountController>(c => c.SignUpComplete());
        }
开发者ID:rgavrilov,项目名称:thcard,代码行数:34,代码来源:AccountController.cs


注:本文中的EmailAddress.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。