コード例 #1
0
 private Person CreatePerson(string firstName = null, string lastName = null, DateTime?bDate = null)
 {
     return(PersonCommands.SavePerson(new Person
     {
         FirstName = firstName ?? RandomUtil.GetRandomString(),
         LastName = lastName ?? RandomUtil.GetRandomString(),
         BirthDate = bDate ?? RandomUtil.GetRandomDateInThePast(1)
     }, Context));
 }
コード例 #2
0
        public override void SaveEntity_EntityIsNew_EntityIsCreated()
        {
            var person = PersonCommands.SavePerson(new Person
            {
                FirstName = RandomUtil.GetRandomString(),
                LastName  = RandomUtil.GetRandomString()
            }, Context);
            var title = TitleCommands.SaveTitle(new Title {
                Description = RandomUtil.GetRandomString()
            }, Context);
            var personTitle = PersonTitleCommands.SavePersonTitle(new PersonTitle {
                IdPerson = person.IdPerson, IdTitle = title.IdTitle
            }, Context);

            Assert.IsNotNull(personTitle);
        }
コード例 #3
0
        public static PersonTitle CreatePersonTitle(FootBallContext context, out Person person, out Title title)
        {
            person = PersonCommands.SavePerson(
                new Person {
                FirstName = RandomUtil.GetRandomString(), LastName = RandomUtil.GetRandomString()
            },
                context);
            Assert.IsNotNull(person);

            title = TitleCommands.SaveTitle(new Title {
                Description = RandomUtil.GetRandomString()
            }, context);
            Assert.IsNotNull(title);

            return(PersonTitleCommands.SavePersonTitle(new PersonTitle {
                IdPerson = person.IdPerson, IdTitle = title.IdTitle
            },
                                                       context));
        }