예제 #1
0
        public void AddGetTest()
        {
            using (var db = new db_context())
            {
                int id   = db.Osoby.First().ID;
                var ctrl = new NieruchmoscController();
                var add  = ctrl.Add(id);                      //add Nie pobiera lczby argumentów

                Assert.IsInstanceOf(typeof(ViewResult), add);
            }
        }
예제 #2
0
        public void AddPostTest()
        {
            using (var db = new db_context())
            {
                Nieruchomosc model = new Nieruchomosc
                {
                    IDOsoby = 1,
                    Nazwa   = "Dom",
                    Adres   = "Orkana 27",
                    lat     = 21.00000,
                    lng     = 52.06543
                };
                var ctrl = new NieruchmoscController();
                var add  = ctrl.Add(model);

                bool exist = db.Nieruchomosci.Any(x => x.IDOsoby == model.IDOsoby && x.Nazwa == model.Nazwa && x.Adres == model.Adres &&
                                                  x.lat == model.lat && x.lng == model.lng);
                Assert.IsTrue(exist);
            }
        }