Esempio n. 1
0
        public static void AssertMappedCorrectlyFrom(this CatalogItemInfo source, CatalogItem catalogItem)
        {
            switch (catalogItem.Type)
            {
                case ItemTypeEnum.Report:
                    Assert.AreEqual(CatalogItemType.Report, source.Type);
                    break;
                case ItemTypeEnum.Folder:
                    Assert.AreEqual(CatalogItemType.Folder, source.Type);
                    break;
                default:
                    throw new Exception();
            }

            Assert.AreEqual(catalogItem.Name, source.Name);
            Assert.AreEqual(catalogItem.Path, source.Path);
        }
        public CatalogItemInfo MapFromCatalogItem(CatalogItem catalogItem)
        {
            CatalogItemType type;

            if (catalogItem.Type == ItemTypeEnum.Report)
            {
                type = CatalogItemType.Report;
            }
            else if (catalogItem.Type == ItemTypeEnum.Folder)
            {
                type = CatalogItemType.Folder;
            }
            else
            {
                type = CatalogItemType.Other;
            }

            return new CatalogItemInfo(catalogItem.Name, catalogItem.Path, type);
        }
        public CatalogItemInfo MapFromCatalogItem(CatalogItem catalogItem)
        {
            var nameWithoutRDL = catalogItem.Name.Replace(".rdl", "");

            CatalogItemType type;

            if(catalogItem.Type == ItemTypeEnum.Report)
            {
                type = CatalogItemType.Report;
            }
            else if(catalogItem.Type == ItemTypeEnum.Folder)
            {
                type = CatalogItemType.Folder;
            }
            else
            {
                type = CatalogItemType.Other;
            }

            return new CatalogItemInfo(nameWithoutRDL, catalogItem.Path, type);
        }