public void IsSupportedReturnsWhetherScenarioIsValidTest(Type type, string referenceName, bool supported) { var target = new IPAddressValueGenerator(); var actual = target.IsSupported(type, referenceName, null); actual.Should().Be(supported); }
public void GenerateReturnsStringTest() { var target = new IPAddressValueGenerator(); var actual = target.Generate(typeof(string), "IpAddress", null); actual.Should().NotBeNull(); actual.As<string>().Should().MatchRegex(@"\d+(\.\d+){3}"); }
public void GenerateReturnsIPAddressTest() { var target = new IPAddressValueGenerator(); var actual = target.Generate(typeof(IPAddress), null, null); actual.Should().NotBeNull(); actual.As<IPAddress>().GetAddressBytes().Any(x => x != 0).Should().BeTrue(); }
public void GenerateThrowsExceptionWithNullTypeTest() { var buildChain = new LinkedList<object>(); buildChain.AddFirst(Guid.NewGuid().ToString()); var target = new IPAddressValueGenerator(); Action action = () => target.Generate(null, Guid.NewGuid().ToString(), buildChain); action.ShouldThrow<ArgumentNullException>(); }
public void GenerateValidatesUnsupportedScenariosTest(Type type, string referenceName, bool supported) { var target = new IPAddressValueGenerator(); Action action = () => target.Generate(type, referenceName, 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); }