public override void Initialize() { base.Initialize(); _testBussinessCategory = _bussinessCategoryRepository.Create("TestCategory", "1"); _testProduct1 = _productRepository.Create("TestProduct1", new DateTime(2000, 1, 1)); _testProduct2 = _productRepository.Create("TestProduct2", new DateTime(2000, 2, 2)); }
public void Create() { var companyRepository = new CompanyRepository(); var company = companyRepository.Create("test", null); company = new CompanyRepository().Read(company.CompanyId); var bussinessRepository = new BussinessCategoryRepository(); var category = bussinessRepository.Create("aaa", "bbb"); var stockRepository = new StockRepository(); var stock = stockRepository.Create(company, category, "123"); var stock2 = new StockRepository(); var result = stock2.Read(stock.StockId); result.Company.CompanyId.Is(company.CompanyId); result.BussinessCategory.BussinessCategoryId.Is(category.BussinessCategoryId); result.StockCode.Is("123"); company = new CompanyRepository().Read(company.CompanyId); company.Stock.IsNotNull(); }