public void GetEmailAddress_WhenDomainAndFixedTransformsExists_ReturnsTranslationInLowerCase()
        {
            var appSettings = new Mock <IConfigurationSettings>(MockBehavior.Strict);

            appSettings.Setup(a => a.GetApplicationSetting(DomainAppSetting, null)).Returns("mycompany\\.com:othercompany.com");
            appSettings.Setup(a => a.GetApplicationSetting(UserRegexAppSetting, null)).Returns((string)null);
            appSettings.Setup(a => a.GetApplicationSetting(UserFixedAppSetting, null)).Returns("bvila:bavila");

            var logger = new Mock <ILogger>();

            var transformer = new UsernameTransformer(appSettings.Object, logger.Object);

            transformer.Initalize();

            var result = transformer.GetEmailAddress("*****@*****.**");

            Assert.AreEqual("*****@*****.**", result);

            appSettings.VerifyAll();
        }
        public void GetEmailAddress_WhenOriginalStringIsMalformedEmail_ReturnsValueInLowerCase()
        {
            var appSettings = new Mock <IConfigurationSettings>(MockBehavior.Strict);

            appSettings.Setup(a => a.GetApplicationSetting(DomainAppSetting, null)).Returns("mycompany\\.com:othercompany.com");
            appSettings.Setup(a => a.GetApplicationSetting(UserRegexAppSetting, null)).Returns((string)null);
            appSettings.Setup(a => a.GetApplicationSetting(UserFixedAppSetting, null)).Returns((string)null);


            var logger = new Mock <ILogger>();

            var transformer = new UsernameTransformer(appSettings.Object, logger.Object);

            transformer.Initalize();

            var result = transformer.GetEmailAddress("FOO@");

            Assert.AreEqual("foo@", result);

            appSettings.VerifyAll();
        }