Ejemplo n.º 1
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ı");
            }
        }