Ejemplo n.º 1
0
        public void TestAttributeAllowedGroup()
        {
            var        testClass = new AttributeTestClass();
            MethodInfo info      = testClass.GetType().GetMethod("MethodWithoutAttributes");

            Assert.IsNotNull(info);

            Assert.IsFalse(BaseMenuReportRegistrator.IsDenyInDataGroup(info));
        }
Ejemplo n.º 2
0
        public void TestAttributeForbiddenGroup()
        {
            var        testClass = new AttributeTestClass();
            MethodInfo info      = testClass.GetType().GetMethod("ForbiddenAccessMethod");

            Assert.IsNotNull(info);

            Assert.IsTrue(BaseMenuReportRegistrator.IsDenyInDataGroup(info));
        }
Ejemplo n.º 3
0
        public void TestAttributeForbiddenOtherCustomization()
        {
            var        testClass = new AttributeTestClass();
            MethodInfo info      = testClass.GetType().GetMethod("ForbiddenCustomizationOtherCountryMethod");

            Assert.IsNotNull(info);

            Assert.IsTrue(BaseMenuReportRegistrator.IsDenyInCustomization(info));
        }
Ejemplo n.º 4
0
        public void TestAttributeAllowedCustomizationCountry()
        {
            var        testClass = new AttributeTestClass();
            MethodInfo info      = testClass.GetType().GetMethod("AllowedCustomizationCountryMethod");

            Assert.IsNotNull(info);

            Assert.IsFalse(BaseMenuReportRegistrator.IsDenyInCustomization(info));
        }
Ejemplo n.º 5
0
        public void DeleteEmptyFoldersTest()
        {
            List <AvrTreeElement> layouts = LoadLayouts();
            List <AvrTreeElement> folders = LoadFolders();

            BaseMenuReportRegistrator.DeleteAvrEmptyFolders(layouts, folders);
            Assert.AreEqual(3, layouts.Count);
            Assert.AreEqual(4, folders.Count);
            Assert.IsNotNull(folders.Find(tmp => tmp.ID == 10));
            Assert.IsNotNull(folders.Find(tmp => tmp.ID == 11));
            Assert.IsNotNull(folders.Find(tmp => tmp.ID == 14));
            Assert.IsNotNull(folders.Find(tmp => tmp.ID == 15));
        }
Ejemplo n.º 6
0
        public void TestAttributeCaption()
        {
            var        testClass = new AttributeTestClass();
            MethodInfo info      = testClass.GetType().GetMethod("CaptionMethod");

            Assert.IsNotNull(info);
            MenuReportDescriptionAttribute attribute = BaseMenuReportRegistrator.GetMenuActionDescriptionAttribute(info);

            Assert.IsNotNull(attribute);

            Assert.AreEqual("xxx", attribute.Caption);
            Assert.AreEqual(100, attribute.Order);
        }
Ejemplo n.º 7
0
        public void CreateFoldersLayoutsMenuTest()
        {
            List <AvrTreeElement> layouts = LoadLayouts();
            List <AvrTreeElement> folders = LoadFolders();

            BaseMenuReportRegistrator.DeleteAvrEmptyFolders(layouts, folders);

            var queryMenuAction = new MenuAction(null, null, "query", 1);

            WinMenuReportRegistrator registrator = FakeMenuregistrator.GetRegistrator();

            registrator.CreateAvrFoldersLayoutsMenu(queryMenuAction, layouts, folders);
            Assert.AreEqual(2, queryMenuAction.Items.Count);
        }