public void TestAttributeAllowedGroup() { var testClass = new AttributeTestClass(); MethodInfo info = testClass.GetType().GetMethod("MethodWithoutAttributes"); Assert.IsNotNull(info); Assert.IsFalse(BaseMenuReportRegistrator.IsDenyInDataGroup(info)); }
public void TestAttributeForbiddenGroup() { var testClass = new AttributeTestClass(); MethodInfo info = testClass.GetType().GetMethod("ForbiddenAccessMethod"); Assert.IsNotNull(info); Assert.IsTrue(BaseMenuReportRegistrator.IsDenyInDataGroup(info)); }
public void TestAttributeForbiddenOtherCustomization() { var testClass = new AttributeTestClass(); MethodInfo info = testClass.GetType().GetMethod("ForbiddenCustomizationOtherCountryMethod"); Assert.IsNotNull(info); Assert.IsTrue(BaseMenuReportRegistrator.IsDenyInCustomization(info)); }
public void TestAttributeAllowedCustomizationCountry() { var testClass = new AttributeTestClass(); MethodInfo info = testClass.GetType().GetMethod("AllowedCustomizationCountryMethod"); Assert.IsNotNull(info); Assert.IsFalse(BaseMenuReportRegistrator.IsDenyInCustomization(info)); }
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)); }
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); }
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); }