public void DeveRetornarParentesValidos() { parent = ParentFaker.Gerar(); var vO = parent.Generate(); add = new Parent(vO.ResponsibleName, vO.ResponsibleDocument, vO.EFamilyType, vO.Email, vO.Telephone); Assert.True(add.Valid); }
public void DeveRetornarParentesNomeTamanhoMinimoInvalido() { parent = ParentFaker.Gerar(); var vO = parent.Generate(); add = new Parent("a", vO.ResponsibleDocument, vO.EFamilyType, vO.Email, vO.Telephone); Assert.True(add.Invalid); }
public void DeveRetornarParentesNameTamanhoMaximoInvalido() { parent = ParentFaker.Gerar(); var vO = parent.Generate(); int i = 0; string length = ""; while (i < 100) { length += "teste"; i++; } add = new Parent(vO.ResponsibleName + length, vO.ResponsibleDocument, vO.EFamilyType, vO.Email, vO.Telephone); Assert.True(add.Invalid); }
public static Faker <Student> Gerar() { Faker <Student> student = new Faker <Student>("pt_BR") .RuleFor(s => s.Name, NameFaker.Gerar()) .RuleFor(s => s.Parents, ParentFaker.Gerar().Generate(2)) .RuleFor(s => s.Address, AddressFaker.Gerar()) .RuleFor(s => s.BirthDate, f => f.Date.Soon()) .RuleFor(s => s.ETypeOfEducation, f => f.PickRandom <ETypeOfEducation>()) .RuleFor(s => s.AcademicYear, f => f.Date.Soon()) .RuleFor(s => s.Serie, f => f.Random.Int(1)) .RuleFor(s => s.Grade, f => f.Random.String(1)) .RuleFor(s => s.Serie, f => f.Random.Int(1)) .RuleFor(s => s.Shifts, f => f.PickRandom <EShifts>()) .RuleFor(s => s.CalledNumber, f => f.Random.Int(1, 30)) .RuleFor(s => s.Note, f => f.Lorem.Paragraphs(1)) .RuleFor(s => s.School, SchoolFaker.Gerar()) .RuleFor(s => s.Occurrences, OccurrenceFaker.Gerar().Generate(1)); return(student); }