Пример #1
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);
        }
Пример #2
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);
 }
Пример #3
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);
        }
Пример #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);
        }