Exemplo n.º 1
0
        public void UpdateTest()
        {
            //Arrange
            var db = new NovA("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\\TestDB.mdf';Integrated Security=True;Connect Timeout=30");
            //Act
            var person = db.GetList <Person>().Find(x => x.FirstName == "Henry");

            person.FirstName = "Hendrick";
            db.UpdateWithValues <Person>(person);
            person = db.GetList <Person>().Find(x => x.FirstName == "Hendrick");

            //Assert
            Assert.AreEqual(person.FirstName, "Hendrick");
        }
Exemplo n.º 2
0
        public void GetListTest()
        {
            //Arrange
            var db = new NovA("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\\TestDB.mdf';Integrated Security=True;Connect Timeout=30");
            //Act
            var people = db.GetList <Person>();

            //Assert
            Assert.AreEqual(people.Count, 10);
        }
Exemplo n.º 3
0
        public void InsertTest()
        {
            //Arrange
            var db = new NovA("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\\TestDB.mdf';Integrated Security=True;Connect Timeout=30");
            //Act
            var person = new Person()
            {
                FirstName = "Henry", LastName = "Franklin"
            };

            db.InsertWithValues(person);
            var people = db.GetList <Person>();

            //Assert
            Assert.AreEqual(people.Count, 11);
        }