public void PriorityReturnsValueLowerThanEmailValueGenerator() { var sut = new AddressValueGenerator(); var other = new EmailValueGenerator(); sut.Priority.Should().BeLessThan(other.Priority); }
public void PriorityReturnsValueHigherThanStringValueGenerator() { var sut = new AddressValueGenerator(); var other = new StringValueGenerator(); sut.Priority.Should().BeGreaterThan(other.Priority); }
public void GenerateThrowsExceptionWithNullTypeTest() { var target = new AddressValueGenerator(); Action action = () => target.Generate(null, null, null); action.ShouldThrow<ArgumentNullException>(); }
public void GenerateThrowsExceptionWithInvalidParametersTest(Type type, string referenceName) { var target = new AddressValueGenerator(); Action action = () => target.Generate(type, referenceName, null); action.ShouldThrow<NotSupportedException>(); }
public void GenerateReturnsValuesForSeveralNameFormatsTest(Type type, string referenceName, bool expected) { var target = new AddressValueGenerator(); var actual = (string) target.Generate(type, referenceName, null); actual.Should().NotBeNullOrEmpty(); }
public void GenerateReturnsNullForAddressLinesBeyondSecondTest(string referenceName) { var target = new AddressValueGenerator(); var actual = (string) target.Generate(typeof(string), referenceName, null); actual.Should().BeNullOrEmpty(); }
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); }
public void HasLowerPriorityThanEmailValueGeneratorTest() { var target = new AddressValueGenerator(); var other = new EmailValueGenerator(); target.Priority.Should().BeLessThan(other.Priority); }
public void HasHigherPriorityThanStringValueGeneratorTest() { var target = new AddressValueGenerator(); var other = new StringValueGenerator(); target.Priority.Should().BeGreaterThan(other.Priority); }
public void IsSupportedTest(Type type, string referenceName, bool expected) { var target = new AddressValueGenerator(); var actual = target.IsSupported(type, referenceName, null); actual.Should().Be(expected); }