Example #1
0
        private static Developer MapDeveloperFromProviderResult(DotNetOpenAuth.AspNet.AuthenticationResult clientResult)
        {
            var dev = new Developer()
            {
                Username = DeveloperUI.GetUsernameFromEmail(clientResult.UserName)
            };

            dev.Username = DeveloperMustHaveValidUsernameSpecification.RemoveUsernameInvalidChars(dev.Username);

            var data = clientResult.ExtraData;

            if (data.ContainsKey("email"))
            {
                dev.Email = data["email"];
            }

            if (data.ContainsKey("fullName"))
            {
                dev.FullName = data["fullName"];
            }

            return(dev);
        }
Example #2
0
 public void RemoveUsernameInvalidChars_InvalidChars_CharsRemoved()
 {
     Assert.AreEqual("1234567890_asdfghjkl", DeveloperMustHaveValidUsernameSpecification.RemoveUsernameInvalidChars("1234567890-=!@#$%&*()_ asdfghjkl;'"));
 }