public void GenerateThrowsExceptionWithInvalidParametersTest(Type type, string referenceName) { var target = new TimeZoneValueGenerator(); Action action = () => target.Generate(type, referenceName, null); action.ShouldThrow<NotSupportedException>(); }
public void GenerateThrowsExceptionWithNullTypeTest() { var target = new TimeZoneValueGenerator(); Action action = () => target.Generate(null, null, null); action.ShouldThrow<ArgumentNullException>(); }
public void GenerateReturnsValuesForSeveralNameFormatsTest(Type type, string referenceName, bool expected) { var target = new TimeZoneValueGenerator(); var actual = (string)target.Generate(type, referenceName, null); actual.Should().NotBeNullOrEmpty(); }
public void GenerateReturnsValueForTimeZoneTypeTest() { var target = new TimeZoneValueGenerator(); var actual = target.Generate(typeof(string), "TimeZone", null); actual.Should().BeOfType<string>(); }
public void GenerateReturnsRandomValueTest() { var target = new TimeZoneValueGenerator(); var first = target.Generate(typeof(string), "timezone", null); first.Should().BeOfType<string>(); first.As<string>().Should().NotBeNullOrWhiteSpace(); var second = target.Generate(typeof(string), "timezone", null); first.Should().NotBe(second); }
public void GenerateReturnsRandomValueMatchingCountryTest() { var source = new Address { Country = "Australia" }; var buildChain = new LinkedList<object>(); buildChain.AddFirst(source); var target = new TimeZoneValueGenerator(); var actual = (string)target.Generate(typeof(string), "timezone", buildChain); actual.Should().StartWith("Australia/"); }
public void IsSupportedTest(Type type, string referenceName, bool expected) { var target = new TimeZoneValueGenerator(); var actual = target.IsSupported(type, referenceName, null); actual.Should().Be(expected); }
public void PriorityReturnsPositiveValueTest() { var target = new TimeZoneValueGenerator(); target.Priority.Should().BeGreaterThan(0); }