예제 #1
0
 public TestEventArgs(string dll, ActionTestCase testcase, int currentRun, int totalRuns, Status status)
 {
     m_dll = dll;
     m_testcase = testcase;
     m_currentRun = currentRun;
     m_totalRuns = totalRuns;
     m_status = status;
 }
예제 #2
0
        public void InitializeTxtStreamForExecute(ActionTestCase testcase)
        {
            //m_txtStream = new System.IO.FileStream(Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(@"\Projects\Hygiene\src\TestDocuments\email.txt"), System.IO.FileMode.Open);
            m_txtStream = GetType().Assembly.GetManifestResourceStream("Workshare.Policy.Actions.Tester.TestFiles.email.txt");

            m_txtStreamProps.Add("DisplayName", "email.txt");
            m_txtStreamProps.Add("FileName", @"c:\temp\email.txt");

            IActionPropertySet propertySet = GetIActionPropertySet() as IActionPropertySet;

            InitSystemPropertiesForStream(propertySet, m_txtStreamProps);

            testcase.Inputs.Add(m_txtStream);
            testcase.Inputs.Add(propertySet);
            testcase.Inputs.Add(m_txtStreamProps);
        }
예제 #3
0
        public void InitializeDocStreamForExecute(ActionTestCase testcase)
        {
            Workshare.ApplicationControllers.OfficeApplicationCache.Instance.Create(FileType.WordDocument);

            //m_docStream = new System.IO.FileStream(Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(@"\Projects\Hygiene\src\TestDocuments\TestGood.doc"), System.IO.FileMode.Open);
            m_docStream = GetType().Assembly.GetManifestResourceStream("Workshare.Policy.Actions.Tester.TestFiles.TestGood.doc");

            m_docStreamProps.Add("DisplayName", "TestGood.doc");
            m_docStreamProps.Add("FileName", @"c:\temp\TestGood.doc");

            IActionPropertySet propertySet = GetIActionPropertySet() as IActionPropertySet;

            InitSystemPropertiesForStream(propertySet, m_docStreamProps);

            testcase.Inputs.Add(m_docStream);
            testcase.Inputs.Add(propertySet);
            testcase.Inputs.Add(m_docStreamProps);
        }
예제 #4
0
 public bool CompareForTemplateExecute(object result, ActionTestCase testcase)
 {
     return result == null;
 }
예제 #5
0
        private void InitializeTests()
        {
            ActionTestCase testCase1 = new ActionTestCase(this);
            testCase1.Description = "Assembly has a derived IAction3 class";
            testCase1.ErrorSolution = "Derive a class from the IAction3 interface";
            testCase1.Executor("GetIAction", false);
            testCase1.OutputVerifier = this.GetType().GetMethod("CompareForIAction");
            m_testCases.Add(testCase1);
   
            ActionTestCase testCase2 = new ActionTestCase(GetIAction());
            testCase2.Description = "Name property: not null or empty";
            testCase2.ErrorSolution = "Return a valid name for your action that is meaningfull to the end user";
            testCase2.Executor("Name", true);
            testCase2.OutputVerifier = this.GetType().GetMethod("CompareForName");
            m_testCases.Add(testCase2);

            if (IsBlockAction())
            {
                ActionTestCase testCase3 = new ActionTestCase(GetIAction());
                testCase3.Setup = this.GetType().GetMethod("InitializeDocStreamForExecute");
                testCase3.TearDown = this.GetType().GetMethod("DisposeDocStream");

                testCase3.Description = "Blocking action: returns null from Execute";
                testCase3.ErrorSolution = "Return null if this action is blocking";
                testCase3.Executor("Execute", false);
                testCase3.OutputVerifier = this.GetType().GetMethod("CompareForBlockExecute");
                m_testCases.Add(testCase3);
            }

            ActionTestCase testCase4 = new ActionTestCase(GetIAction());
            testCase4.Description = "RunAt property: is set to either, client or server or both items";
            testCase4.ErrorSolution = "Return either one enum or both enums for client, server - do not return both as this is being depreciated";
            testCase4.Executor("Runat", true);
            testCase4.OutputVerifier = this.GetType().GetMethod("CompareForRunAt");
            m_testCases.Add(testCase4);

            ActionTestCase testCase5 = new ActionTestCase(GetIAction());
            testCase5.Description = "Supported Files: contains a valid list of supported or non-supported files";
            testCase5.ErrorSolution = "Return a valid list of files supported or files not-supported by your action";
            testCase5.Executor("SupportedFileCollection", true);
            testCase5.OutputVerifier = this.GetType().GetMethod("CompareForSupportedFiles");
            m_testCases.Add(testCase5);

            ActionTestCase testCase6 = new ActionTestCase(GetIAction());
            testCase6.Description = "Supported Channels: contains a valid list of supported channels";
            testCase6.ErrorSolution = "Return a valid list of channels supported by your action";
            testCase6.Executor("SupportedChannels", true);
            testCase6.OutputVerifier = this.GetType().GetMethod("CompareForSupportedChannels");
            m_testCases.Add(testCase6);

            if (IsTemplateAction())
            {
                ActionTestCase testCase7 = new ActionTestCase(GetIAction());
                testCase7.Setup = this.GetType().GetMethod("InitializeDocStreamForExecute");
                testCase7.TearDown = this.GetType().GetMethod("DisposeDocStream");

                testCase7.Description = "Template action: returns null from Execute";
                testCase7.ErrorSolution = "Return null if this action is a Template";
                testCase7.Executor("Execute", false);
                testCase7.OutputVerifier = this.GetType().GetMethod("CompareForTemplateExecute");
                m_testCases.Add(testCase7);
            }

            if (!(IsBlockAction() || IsTemplateAction()))
            {
                ActionTestCase testCase8 = new ActionTestCase(GetIAction());
                testCase8.Setup = this.GetType().GetMethod("InitializeDocStreamForExecute");
                testCase8.TearDown = this.GetType().GetMethod("DisposeDocStream");

                testCase8.Description = "Execute: returns content on supported file types or null for non-supported types";
                testCase8.ErrorSolution = "Return the original or modified content/null for non supported file types";
                testCase8.Executor("Execute", false);
                testCase8.OutputVerifier = (IsFileSupported(".doc") ? this.GetType().GetMethod("CompareForSupportedFileType") : this.GetType().GetMethod("CompareForNonSupportedFileType"));
                m_testCases.Add(testCase8);

                ActionTestCase testCase9 = new ActionTestCase(GetIAction());
                testCase9.Setup = this.GetType().GetMethod("InitializeTxtStreamForExecute");
                testCase9.TearDown = this.GetType().GetMethod("DisposeTxtStream");

                testCase9.Description = "Execute: returns content on supported file types or null for non-supported types";
                testCase9.ErrorSolution = "Return the original or modified content/null for non supported file types";
                testCase9.Executor("Execute", false);
                testCase9.OutputVerifier = (IsFileSupported(".txt") ? this.GetType().GetMethod("CompareForSupportedFileType") : this.GetType().GetMethod("CompareForNonSupportedFileType"));
                m_testCases.Add(testCase9);

                ActionTestCase testCase10 = new ActionTestCase(GetIAction());
                testCase10.Setup = this.GetType().GetMethod("InitializeEmailStreamForExecute");
                testCase10.TearDown = this.GetType().GetMethod("DisposeEmailStream");

                testCase10.Description = "Execute: returns content on supported file types or null for non-supported types";
                testCase10.ErrorSolution = "Return the original or modified content/null for non supported file types";
                testCase10.Executor("Execute", false);
                testCase10.OutputVerifier = (IsFileSupported(".email") ? this.GetType().GetMethod("CompareForSupportedFileType") : this.GetType().GetMethod("CompareForNonSupportedFileType"));
                m_testCases.Add(testCase10);
            }
        }