コード例 #1
0
        public void PriorityReturnsValueLowerThanEmailValueGenerator()
        {
            var sut   = new AddressValueGenerator();
            var other = new EmailValueGenerator();

            sut.Priority.Should().BeLessThan(other.Priority);
        }
コード例 #2
0
        public void PriorityReturnsValueHigherThanStringValueGenerator()
        {
            var sut   = new AddressValueGenerator();
            var other = new StringValueGenerator();

            sut.Priority.Should().BeGreaterThan(other.Priority);
        }
コード例 #3
0
        public void GenerateThrowsExceptionWithNullTypeTest()
        {
            var target = new AddressValueGenerator();

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

            action.ShouldThrow<ArgumentNullException>();
        }
コード例 #4
0
        public void GenerateThrowsExceptionWithInvalidParametersTest(Type type, string referenceName)
        {
            var target = new AddressValueGenerator();

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

            action.ShouldThrow<NotSupportedException>();
        }
コード例 #5
0
        public void GenerateReturnsValuesForSeveralNameFormatsTest(Type type, string referenceName, bool expected)
        {
            var target = new AddressValueGenerator();

            var actual = (string) target.Generate(type, referenceName, null);

            actual.Should().NotBeNullOrEmpty();
        }
コード例 #6
0
        public void GenerateReturnsNullForAddressLinesBeyondSecondTest(string referenceName)
        {
            var target = new AddressValueGenerator();

            var actual = (string) target.Generate(typeof(string), referenceName, null);

            actual.Should().BeNullOrEmpty();
        }
コード例 #7
0
        public void GenerateReturnsRandomAddressTest()
        {
            var target = new AddressValueGenerator();

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

            first.Should().BeOfType<string>();
            first.As<string>().Should().NotBeNullOrWhiteSpace();

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

            first.Should().NotBe(second);
        }
コード例 #8
0
        public void HasLowerPriorityThanEmailValueGeneratorTest()
        {
            var target = new AddressValueGenerator();
            var other = new EmailValueGenerator();

            target.Priority.Should().BeLessThan(other.Priority);
        }
コード例 #9
0
        public void HasHigherPriorityThanStringValueGeneratorTest()
        {
            var target = new AddressValueGenerator();
            var other = new StringValueGenerator();

            target.Priority.Should().BeGreaterThan(other.Priority);
        }
コード例 #10
0
        public void IsSupportedTest(Type type, string referenceName, bool expected)
        {
            var target = new AddressValueGenerator();

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

            actual.Should().Be(expected);
        }