Ejemplo n.º 1
0
        public void GetPersonTitlesByIdTeam_PersonTitleExists_ReturnsList()
        {
            PersonTitleCreator.CreatePersonTitle(Context, out var person, out var title, out var team);

            var personTitles = PersonTitleQueries.GetAllPersonsTitlesByIdTeam(Context, team.IdTeam);

            Assert.IsTrue(personTitles.Any());
            Assert.IsNotNull(personTitles.FirstOrDefault(pt => pt.IdTeam == team.IdTeam));
        }
Ejemplo n.º 2
0
        public override void SaveEntity_EntityExists_EntityIsUpdated()
        {
            var personTitle = PersonTitleCreator.CreatePersonTitle(Context, out var person, out var title);
            var team        = TeamCommands.SaveTeam(new Team {
                Description = RandomUtil.GetRandomString(), Name = RandomUtil.GetRandomString()
            }, Context);

            personTitle.IdTeam = team.IdTeam;
            personTitle.SavePersonTitle(Context);
            using (var context = new FootBallContext())
            {
                var personTitleDb = PersonTitleQueries.GetAllPersonsTitlesByIdTeam(context, team.IdTeam);
                Assert.IsNotNull(personTitleDb);
            }
        }
Ejemplo n.º 3
0
 public void GetPersonTitlesByIdTeam_PersonTitleDoesNotExists_ReturnsEmptyList()
 {
     Assert.IsEmpty(PersonTitleQueries.GetAllPersonsTitlesByIdTeam(Context, -1));
 }