コード例 #1
0
        /// <summary>
        /// Provides a deterministic way to create the TestViewModel property.
        /// </summary>
        public static void CreateTestViewModel()
        {
            if (_testViewModel == null)
            {
                //trigger an add to productbrand for testing
                IProductBrandRepository pbr = ObjectFactory.GetInstance<IProductBrandRepository>();
                if (pbr.GetAll().Count() == 0)
                {
                    //ProductBrandLocal l1 = new ProductBrandLocal
                    //{
                    //    Code = "code1",
                    //    DateCreated = DateTime.Now,
                    //    DateLastUpdated = DateTime.Now,
                    //    Description = "desc1",
                    //    StatusId = (int)EntityStatus.Active,
                    //    MasterId = Guid.NewGuid(),
                    //    Name = "name1",
                    //};
                   // pbr.AddOrReplace(l1);
                    //ProductBrandLocal l2 = new ProductBrandLocal
                    //{
                    //    Code = "code2",
                    //    DateCreated = DateTime.Now,
                    //    DateLastUpdated = DateTime.Now,
                    //    Description = "desc2",
                    //    StatusId =(int)EntityStatus.Active ,
                    //    MasterId = Guid.NewGuid(),
                    //    Name = "name2",
                    //};
                    //pbr.AddOrReplace(l2);
                }
                _testViewModel = new TestViewModel();


            }
        }
コード例 #2
0
 /// <summary>
 /// Provides a deterministic way to delete the TestViewModel property.
 /// </summary>
 public static void ClearTestViewModel()
 {
     _testViewModel.Cleanup();
     _testViewModel = null;
 }