Пример #1
0
        public void GetNinjaById()
        {
            INinjaRepository ninjaRepository = new NinjaRepository();

            var ninja = ninjaRepository.GetById(1);

            Assert.IsNotNull(ninja);
            Assert.AreEqual(ninja.Id, 1);
        }
Пример #2
0
        public void UpdateNinjaAndClan()
        {
            var ninjaRepository     = new NinjaRepository();
            var ninjaClanRepository = new NinjaClanRepository();

            var ninja     = ninjaRepository.GetById(1);
            var ninjaClan = ninjaClanRepository.GetById(ninja.NinjaClanId);

            ninja.NinjaName = "Murilo Cesar";
            ninjaRepository.Update(ninja);
            ninjaRepository.Save();

            ninjaClan.ClanName = "Gafanhotos";

            ninjaClanRepository.Update(ninjaClan);
            ninjaClanRepository.Save();
        }