public void HasHigherPriorityThanStringValueGenerator()
        {
            var sut   = new Wrapper();
            var other = new StringValueGenerator();

            sut.Priority.Should().BeGreaterThan(other.Priority);
        }
Ejemplo n.º 2
0
        public void PriorityReturnsHigherPriorityThanStringValidator()
        {
            var sut   = new LastNameValueGenerator();
            var other = new StringValueGenerator();

            sut.Priority.Should().BeGreaterThan(other.Priority);
        }
        public void HasHigherPriorityThanStringValueGeneratorTest()
        {
            var target = new SuburbValueGenerator();
            var other = new StringValueGenerator();

            target.Priority.Should().BeGreaterThan(other.Priority);
        }
        public void PriorityReturnsValueHigherThanStringValueGenerator()
        {
            var sut   = new AddressValueGenerator();
            var other = new StringValueGenerator();

            sut.Priority.Should().BeGreaterThan(other.Priority);
        }
        public void IsSupportedThrowsExceptionWithNullTypeTest()
        {
            var target = new StringValueGenerator();

            Action action = () => target.IsSupported(null, null, null);

            action.ShouldThrow<ArgumentNullException>();
        }
        public void IsSupportedReturnsWhetherTypeIsSupportedTest(Type type, bool supported)
        {
            var target = new StringValueGenerator();

            var actual = target.IsSupported(type, null, null);

            actual.Should().Be(supported);
        }
Ejemplo n.º 7
0
        public void AddWithValueGeneratorThrowsExceptionWithNullConfiguration()
        {
            var generator = new StringValueGenerator();

            Action action = () => BuildConfigurationExtensions.Add(null !, generator);

            action.Should().Throw <ArgumentNullException>();
        }
        public void GenerateReturnsRandomValueTest()
        {
            var target = new StringValueGenerator();

            var first = target.Generate(typeof(string), null, null);
            var second = target.Generate(typeof(string), null, null);

            first.Should().NotBeNull();
            second.Should().NotBeNull();
            first.Should().NotBe(second);
        }
Ejemplo n.º 9
0
        public void AddWithValueGeneratorAddsRuleToConfiguration()
        {
            var generator = new StringValueGenerator();

            var sut = new BuildConfiguration();

            var config = sut.Add(generator);

            config.Should().Be(sut);

            sut.ValueGenerators.Should().Contain(generator);
        }
        public void Creates_GUID_strings()
        {
            var generator = new StringValueGenerator(generateTemporaryValues: true);

            var values = new HashSet<Guid>();
            for (var i = 0; i < 100; i++)
            {
                var generatedValue = generator.Next(null);

                values.Add(Guid.Parse(generatedValue));
            }

            Assert.Equal(100, values.Count);
        }
Ejemplo n.º 11
0
    public void Creates_GUID_strings()
    {
        var generator = new StringValueGenerator();

        var values = new HashSet <Guid>();

        for (var i = 0; i < 100; i++)
        {
            var generatedValue = generator.Next(null);

            values.Add(Guid.Parse(generatedValue));
        }

        Assert.Equal(100, values.Count);
    }
        public void GenerateReturnsValidatesTypeSupportTest(Type type, bool supported)
        {
            var target = new StringValueGenerator();

            Action action = () => target.Generate(type, null, null);

            if (supported)
            {
                action.ShouldNotThrow();
            }
            else
            {
                action.ShouldThrow<NotSupportedException>();
            }
        }
        public void PriorityIsHigherThanStringValueGeneratorProprityTest()
        {
            var target = new IPAddressValueGenerator();
            var other = new StringValueGenerator();

            target.Priority.Should().BeGreaterThan(other.Priority);
        }
        public void PriorityReturnsHigherPriorityThanStringValidatorTest()
        {
            var target = new LastNameValueGenerator();
            var other = new StringValueGenerator();

            target.Priority.Should().BeGreaterThan(other.Priority);
        }
        public void AddWithValueGeneratorThrowsExceptionWithNullCompilerTest()
        {
            var rule = new StringValueGenerator();

            IBuildStrategyCompiler target = null;

            Action action = () => target.Add(rule);

            action.ShouldThrow<ArgumentNullException>();
        }
        public void AddWithValueGeneratorAddsRuleToCompilerTest()
        {
            var rule = new StringValueGenerator();

            var target = new BuildStrategyCompiler();

            target.Add(rule);

            target.ValueGenerators.Should().Contain(rule);
        }