public void GenerateReturnsRandomValuesForGenderTypeTest() { var target = new GenderValueGenerator(); var maleFound = false; var femaleFound = false; for (var index = 0; index < 1000; index++) { var actual = (string)target.Generate(typeof(string), "Gender", null); if (actual == "Male") { maleFound = true; } else { femaleFound = true; } if (maleFound && femaleFound) { break; } } maleFound.Should().BeTrue(); femaleFound.Should().BeTrue(); }
public void GenerateThrowsExceptionWithNullTypeTest() { var target = new GenderValueGenerator(); Action action = () => target.Generate(null, null, null); action.ShouldThrow<ArgumentNullException>(); }
public void GenerateThrowsExceptionWithInvalidParametersTest(Type type, string referenceName) { var target = new GenderValueGenerator(); Action action = () => target.Generate(type, referenceName, null); action.ShouldThrow<NotSupportedException>(); }
public void GenerateReturnsValuesForSeveralNameFormatsTest(Type type, string referenceName, bool expected) { var target = new GenderValueGenerator(); var actual = (string)target.Generate(type, referenceName, null); actual.Should().NotBeNullOrEmpty(); }
public void GenerateReturnsValueForGenderTypeTest() { var target = new GenderValueGenerator(); var actual = target.Generate(typeof(string), "Sex", null); actual.Should().BeOfType<string>(); }