NBuilder

Ce este NBuilder  ? Un generator automat de obiecte – la care adauga proprietati default. De ex: var generator = new UniqueRandomGenerator(); var seq = new SequentialGenerator<int> { Direction = GeneratorDirection.Ascending, Increment = 1}; seq.StartingWith(1); BuilderSetup.DisablePropertyNamingFor<Linii, int>(x => x.Pret); Factura oh = Builder<Factura>.CreateNew().Build(); var q = Builder<Linii>.CreateListOfSize(10)     .WhereAll()     .Have(x=>x.Qty=generator.Next(1,100))     .And(x=>x.LineNumber = seq.Generate())                […]

Continue reading →