Example #1
0
 public void Setup()
 {
     Resolver = new SimpleEntryPointResolver();
     Lines    = new List <string>()
     {
         "(44,33)   FNF:File not found",
         @"In line 44 of Macro C:\Aveva\Plant\E3D21~1.0\PMLLIB\common\functions\runsynonym.pmlmac",
         "^^$M \"/%PMLUI%/CLIB/FILES/UELEMSEL\" =1/1",
         "Called from line 34 of PML function runsynonym",
         "  $m \"$!<macro>\" $<$!<action>$>",
         "Called from line 62 of PML function pmlasserttest.TESTEQUALWITHUNEQUALVALUES",
         "    !!runSynonym('CALLIB UELEMSEL =1/1')",
         "Called from line 53 of PML function pmltestrunner.RUNINTERNAL",
         "    !testCase.$!<testName>(object PmlAssert())",
         "Called from line 37 of PML function pmltestrunner.RUN",
         "    !this.runInternal(!testCaseName, !testName, !hasSetup, !hasTearDown)"
     };
     MissingStackTrace = new List <string>()
     {
         "(61,123)   FM: Form FOOBAR not found",
         " *** Error Line not available",
         " *** Error Command not available"
     };
     ExpectedStackTrace = new List <StackFrame>()
     {
         new StackFrame(
             @"In line 44 of Macro C:\Aveva\Plant\E3D21~1.0\PMLLIB\common\functions\runsynonym.pmlmac",
             "^^$M \"/%PMLUI%/CLIB/FILES/UELEMSEL\" =1/1",
             Resolver
             ),
         new StackFrame(
             "Called from line 34 of PML function runsynonym",
             "  $m \"$!<macro>\" $<$!<action>$>",
             Resolver
             ),
         new StackFrame(
             "Called from line 62 of PML function pmlasserttest.TESTEQUALWITHUNEQUALVALUES",
             "    !!runSynonym('CALLIB UELEMSEL =1/1')",
             Resolver
             ),
         new StackFrame(
             "Called from line 53 of PML function pmltestrunner.RUNINTERNAL",
             "    !testCase.$!<testName>(object PmlAssert())",
             Resolver
             ),
         new StackFrame(
             "Called from line 37 of PML function pmltestrunner.RUN",
             "    !this.runInternal(!testCaseName, !testName, !hasSetup, !hasTearDown)",
             Resolver
             )
     };
 }
Example #2
0
        public void Constructor_ShouldCheckForNullArguments()
        {
            Clock              clock      = Mock.Of <Clock>();
            Clock              noClock    = null;
            MethodInvoker      invoker    = Mock.Of <MethodInvoker>();
            MethodInvoker      noInvoker  = null;
            EntryPointResolver resolver   = Mock.Of <EntryPointResolver>();
            EntryPointResolver noResolver = null;
            ObjectProxy        proxy      = Mock.Of <ObjectProxy>();
            ObjectProxy        noProxy    = null;

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, noClock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, clock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(invoker, noClock));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(invoker, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, resolver));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, noClock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, noClock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, clock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noInvoker, clock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(invoker, noClock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(invoker, noClock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(invoker, clock, noResolver));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, noClock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, clock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, noClock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, clock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, noClock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, clock));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, invoker, noClock));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, invoker, noResolver));

            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, noClock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, noClock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, clock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, noInvoker, clock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, noClock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, noClock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, clock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(noProxy, invoker, clock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, noClock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, noClock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, clock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, noInvoker, clock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, invoker, noClock, noResolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, invoker, noClock, resolver));
            Assert.Throws <ArgumentNullException>(() => new PmlTestRunner(proxy, invoker, clock, noResolver));
        }