Esempio n. 1
0
        public string SetPptLabel(Office.IRibbonControl control)
        {
            Core.Metadata helper = new Core.Metadata(Globals.ThisAddIn.Application.ActivePresentation);
            string        key    = helper.HasProjects ? "SetPptChange" : "SetPpt";

            return(I18.ResManager.GetText(key));
        }
 public void HasProject_DataFound()
 {           
     var ppt = new Mocks.MockPollsProjectsBuilder();
     ppt.AddOnePollProject(new string[] { "1" });
     
     Metadata data = new Metadata(ppt.Build().Object);            
     Assert.IsTrue(data.HasProjects, "Namespace of desired custom part was found");
 }
        public void GetProject_HasDataProjectDoesNotExists_ReturnsNull()
        {
            var ppt = new Mocks.MockPollsProjectsBuilder();
            ppt.AddOnePollProject(new string[] { "1", "100" });

            Metadata data = new Metadata(ppt.Build().Object);
            var project = data.GetProject("99");

            Assert.IsNull(project);
        }
        public void GetProject_HasData_ReturnsTheProject()
        {
            var ppt = new Mocks.MockPollsProjectsBuilder();
            ppt.AddOnePollProject(new string[] { "1", "100" });
            
            Metadata data = new Metadata(ppt.Build().Object);
            var project = data.GetProject("100");

            Assert.AreEqual("100", project.Id);
        }
        public void GetProjects_HasData_ReturnDataWithOneProject()
        {
            var ppt = new Mocks.MockPollsProjectsBuilder();
            ppt.AddOnePollProject(new string[] { "1", "100" });

            Metadata data = new Metadata(ppt.Build().Object);
            var projects = data.GetProjects();

            Assert.AreEqual(2, projects.Projects.Count);
        }
        public void RemoveAll_HasPollData_RemovesAll()
        {
            var ppt = new Mocks.MockPollsProjectsBuilder();
            ppt.AddOnePollProject(new string[] { "1", "100" });

            Metadata data = new Metadata(ppt.Build().Object);
            var result = data.RemoveAll();

            Assert.IsTrue(result, "No exception thrown");
            Assert.AreEqual(0, ppt.CustomPartsCount);
        }
 public void HasProject_DoesNotHaveData()
 {
     var ppt = new Mocks.MockPollsProjectsBuilder();
     Metadata data = new Metadata(ppt.Build().Object);
     Assert.IsFalse(data.HasProjects,"Namespace doesn't exists");
 }
 public string SetPptLabel(Office.IRibbonControl control)
 {
     Core.Metadata helper = new Core.Metadata(Globals.ThisAddIn.Application.ActivePresentation);
     string key = helper.HasProjects ? "SetPptChange" : "SetPpt";
     return I18.ResManager.GetText(key);
 }