using Xunit;

namespace NetChris.Security.Tests.RNGCryptoServiceProviderRandomPasswordGenerator
{
    public class RNGCryptoServiceProviderRandomPasswordGenerator
    {
        [Fact]
        public void Generates_only_the_characters_requested()
        {
            string validCharacters = "328472-4-=235345-2345231@*!$%^()_+./87-==-=-sdfsdczczxvxzcv-=-=-\\";
            var passwordGenerator =
                new Cryptography.RNGCryptoServiceProviderRandomPasswordGenerator(validCharacters);

            var password = passwordGenerator.GeneratePassword(1000);

            foreach(char c in password.ToCharArray())
            {
                Assert.True(validCharacters.Contains(c.ToString()));
            }
        }
    }
}
