public void Add_SimpleItem_OK()
        {
            FootballClub newEntity = new FootballClub
            {
                CityId        = 1,
                Name          = "New Team",
                Members       = 0,
                Stadium       = "New Stadium",
                FundationDate = DateTime.Today
            };

            int result   = instance.Add(newEntity);
            int expected = 1;

            Assert.AreEqual(expected, result);
        }
        private void InsertExecute()
        {
            _repository.Add(Model);

            AceptCallBack?.Invoke();

            Messenger.Default.Send(new NotificationMessage("Inserted"));
        }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,CityId,Name,Members,Stadium,FundationDate,Logo")] FootballClub footballClub)
        {
            if (ModelState.IsValid)
            {
                _repository.Add(footballClub);
                return(RedirectToAction("Index"));
            }

            return(View(footballClub));
        }