root/UnityWeb/UnityWeb/Repository/Test/NHibernateRepositoryTest/ProductDataProviderTest.cs
| 55 | 56 | ||
|---|---|---|---|
1 | #region Using Statements | 1 | #region Using Statements |
2 | 2 | ||
3 | using System.Collections.Generic; | ||
4 | using Domain.Business; | ||
5 | using Microsoft.Practices.Unity; | 3 | using Microsoft.Practices.Unity; |
6 | using Microsoft.VisualStudio.TestTools.UnitTesting; | 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; |
7 | using Repository.NHibernateDataAccess; | 5 | using Repository.NHibernateDataAccess; |
... | ... | ||
82 | [TestMethod] | 80 | [TestMethod] |
83 | public void ProductDataProviderGetProducts() | 81 | public void ProductDataProviderGetProducts() |
84 | { | 82 | { |
85 | IList<Product> Products = _provider.GetProducts(); | 83 | var Products = _provider.GetProducts(); |
86 | Assert.IsNotNull(Products); | 84 | Assert.IsNotNull(Products); |
87 | Assert.IsTrue(Products.Count > 0); | 85 | Assert.IsTrue(Products.Count > 0); |
88 | Assert.IsTrue(Products[0].Id > 0); | 86 | Assert.IsTrue(Products[0].Id > 0); |
... | ... | ||
92 | Assert.IsTrue(Products[0].Category.Id > 0); | 90 | Assert.IsTrue(Products[0].Category.Id > 0); |
93 | } | 91 | } |
94 | 92 | ||
95 | //[TestMethod] | 93 | [TestMethod] |
96 | //public void ProductDataProviderGetProduct() | 94 | public void ProductDataProviderGetProduct() |
97 | //{ | 95 | { |
98 | // const int id = 9; | 96 | const int id = 9; |
99 | // Product Product = _provider.GetProduct(id); | 97 | var Product = _provider.GetProduct(id); |
100 | 98 | ||
101 | // Assert.IsNotNull(Product); | 99 | Assert.IsNotNull(Product); |
102 | // //Assert.IsTrue(Product.Id.HasValue); | 100 | Assert.IsTrue(Product.Id == id); |
103 | // Assert.IsTrue(Product.Id == id); | 101 | Assert.IsNotNull(Product.Supplier); |
104 | // // Assert.IsTrue(!string.IsNullOrEmpty(Product.Address.AddressLine1)); | 102 | Assert.IsTrue(Product.Supplier.Id > 0); |
105 | //} | 103 | Assert.IsNotNull(Product.Category); |
104 | Assert.IsTrue(Product.Category.Id > 0); | ||
105 | } | ||
106 | 106 | ||
107 | //[TestMethod] | 107 | //[TestMethod] |
108 | //public void ProductDataProviderAddProduct() | 108 | //public void ProductDataProviderAddProduct() |
Download diff