Beispiel #1
0
        public void AddRouteMapForProduct()
        {
            Product product = repository.FindMany(p => p.RouteMapInfo == null).OrderBy(p => Guid.NewGuid()).FirstOrDefault();

            if (product != null)
            {
                RouteMap newEntity = new RouteMap();
                newEntity.InsertDate = DateTime.Now;
                newEntity.ItemType = typeof(Product).FullName;
                newEntity.ItemId = product.ProductId;
                newEntity.Slug = "{0}-{1}".FormatWith(StringOperations.UrlFriendlyString(product.ProductName), StringOperations.GetRandomString(2));

                product.RouteMapInfo = newEntity;

                dataService.Update(product);
                dataService.Save();

                Assert.AreNotEqual(Guid.Empty, newEntity.RouteMapId);
            }
            else
            {
                Assert.Inconclusive("Rota atanacak ürün bilgisi kalmadı");
            }
        }
Beispiel #2
0
        public void AddRouteMapForCategory()
        {
            Category category = repository.FindMany(c => c.RouteMapInfo == null).OrderBy(c => Guid.NewGuid()).FirstOrDefault();

            if (category != null)
            {
                RouteMap newEntity = new RouteMap();
                newEntity.InsertDate = DateTime.Now;
                newEntity.ItemType = typeof(Category).FullName;
                newEntity.ItemId = category.CategoryId;
                newEntity.Slug = StringOperations.UrlFriendlyString(category.Name);

                category.RouteMapInfo = newEntity;

                dataService.Update(category);
                dataService.Save();

                Assert.AreNotEqual(Guid.Empty, newEntity.RouteMapId);
            }
            else
            {
                Assert.Inconclusive("Rota atanacak kategori bilgisi kalmadı");
            }
        }
Beispiel #3
0
        public void AddRouteMapForManufacturer()
        {
            Manufacturer manufacturer = repository.FindMany(m => m.RouteMapInfo == null).OrderBy(m => Guid.NewGuid()).FirstOrDefault();

            if (manufacturer != null)
            {
                RouteMap newEntity = new RouteMap();
                newEntity.InsertDate = DateTime.Now;
                newEntity.ItemType = typeof(Manufacturer).FullName;
                newEntity.ItemId = manufacturer.ManufacturerId;
                newEntity.Slug = "{0}".FormatWith(StringOperations.UrlFriendlyString(manufacturer.Name));

                manufacturer.RouteMapInfo = newEntity;

                dataService.Update(manufacturer);
                dataService.Save();

                Assert.IsNotNull(newEntity.RouteMapId);
            }
            else
            {
                Assert.Inconclusive("Rota atanacak üretici bilgisi kalmadı");
            }
        }