public void Build_BuildCalled_ThrowsException()
        {
            var subject = new ValidationConfigurationBuilder();

            subject.Build();

            Action action = () => subject.Build();

            action.Should().Throw <InvalidOperationException>();
        }
        public void Build_ConfigurationMethodsNotCalled_ReturnsDefaultConfiguration()
        {
            var subject       = new ValidationConfigurationBuilder();
            var defaultConfig = subject.Configuration;

            var config = subject.Build();

            config.Should().BeSameAs(defaultConfig);
        }
        public void SetZeroWidthChars_BuildCalled_ThrowsException()
        {
            var subject = new ValidationConfigurationBuilder();

            subject.Build();

            Action action = () => subject.SetZeroWidthChars(_sampleCharCollection);

            action.Should().Throw <InvalidOperationException>();
        }
        /// <summary> Initialize static configuration instance </summary>
        public static void Initialize(Action <IValidationConfigurationExpression> configAction)
        {
            if (configAction == null)
            {
                throw new ArgumentNullException(nameof(configAction));
            }

            if (Configuration != null)
            {
                throw new InvalidOperationException($"{nameof(LykkeValidation)} is already initialized");
            }

            var builder = new ValidationConfigurationBuilder();

            configAction.Invoke(builder);
            Configuration = builder.Build();
        }