Пример #1
0
 public void deleteC()
 {
     _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
     var tempcm = _sample.GetCustomerById(16);
     _sample.delete(tempcm);
     Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsFalse(_sample.GetCustomerById(16)!=null);
 }
Пример #2
0
        public void deleteC()
        {
            _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
            var tempcm = _sample.GetCustomerById(16);

            _sample.delete(tempcm);
            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsFalse(_sample.GetCustomerById(16) != null);
        }
Пример #3
0
        public void updateCname()
        {
            _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
            Customer cm = _sample.GetCustomerById(1);

            _sample.changename(cm, "混蛋");
            string name = _sample.GetCustomerById(1).name;

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("混蛋", name);
        }
Пример #4
0
        public void GetCustomerByIdTest()
        {
            _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
            var tempCutomer = new Customer { id=16,name = "永京" };
            _sample.CreateCustomer(tempCutomer);
            Customer customer = _sample.GetCustomerById(1);

            int customerId = customer.id;
            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(1, customerId);
        }
Пример #5
0
 public void insertCustomer()
 {
     _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
     var tempCutomer = new Customer { id = 36, name = "永京", password = "******" };
     _sample.CreateCustomer(tempCutomer);
     Customer cm = _sample.GetCustomerById(36);
     string name = cm.name;
     string password = cm.password;
     Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("永京", name);
     Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("minjie", password);
 }
Пример #6
0
        public void GetCustomerByIdTest()
        {
            _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));

            //this will be delete at the deleteC method in the end
            //so that it will success the next time run this whole TEST
            var tempCutomer = new Customer { id=16,name = "永京" };
            _sample.CreateCustomer(tempCutomer);

            Customer customer = _sample.GetCustomerById(1);
            int customerId = customer.id;
            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(1, customerId);
        }
Пример #7
0
        public void GetCustomerByIdTest()
        {
            _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
            var tempCutomer = new Customer {
                id = 16, name = "永京"
            };

            _sample.CreateCustomer(tempCutomer);
            Customer customer = _sample.GetCustomerById(1);

            int customerId = customer.id;

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(1, customerId);
        }
Пример #8
0
        public void insertCustomer()
        {
            _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
            var tempCutomer = new Customer {
                id = 36, name = "永京", password = "******"
            };

            _sample.CreateCustomer(tempCutomer);
            Customer cm       = _sample.GetCustomerById(36);
            string   name     = cm.name;
            string   password = cm.password;

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("永京", name);
            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("minjie", password);
        }
Пример #9
0
 public void updateCname()
 {
     _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
     Customer cm = _sample.GetCustomerById(1);
     _sample.changename(cm, "混蛋");
     string name = _sample.GetCustomerById(1).name;
     Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("混蛋", name);
 }
Пример #10
0
 public void updateCpass()
 {
     _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer));
     Customer cm = _sample.GetCustomerById(22);
     _sample.changepassword(cm,"skyisblue");
     string password = _sample.GetCustomerById(22).password;
     Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("skyisblue", password);
 }