示例#1
0
 private void Seed(Orchard1Context _orchard1Context)
 {
     _orchard1Context.Database.EnsureDeleted();
     _orchard1Context.AddRange(GetUsers());
     _orchard1Context.AddRange(GetContactRequest());
     _orchard1Context.AddRange(GetProductListingData());
     _orchard1Context.SaveChanges();
 }
示例#2
0
        private void Seed(Orchard1Context orchard1Context)
        {
            List <Users> check = orchard1Context.Users.ToList();

            if (check.Count == 0)
            {
                orchard1Context.AddRange(new UserTestData().GetUsers().ToArray());
                orchard1Context.SaveChanges();
            }
        }
示例#3
0
        public async Task GetProductTypes_ShouldReturnAllProductTypes_HappyFlow()
        {
            List <ProductType> productTypes = new List <ProductType>
            {
                new ProductType()
                {
                    ProductTypeId = 1, ProductType1 = "tomato", Msp = 50
                },
                new ProductType()
                {
                    ProductTypeId = 2, ProductType1 = "potato", Msp = 60
                }
            };

            _orchard1Context.AddRange(productTypes.ToArray());
            _orchard1Context.SaveChanges();
            List <ProductType> testResult = await _adminRepository.GetProductTypes();

            CollectionAssert.AreEqual(productTypes, testResult);
        }