コード例 #1
0
        public void Init()
        {
            args = new Dictionary <string, NSScriptCommandArgumentDescription> {
                { "firstArg", new NSScriptCommandArgumentDescription {
                      Name = "firstArg", AppleEventCode = "fArg", Type = "integer", IsOptional = true
                  } },
                { "secondArg", new NSScriptCommandArgumentDescription {
                      Name = "secondArg", AppleEventCode = "sArg", Type = "NSNumber"
                  } },
                { "thirdArg", new NSScriptCommandArgumentDescription {
                      Name = "thirdArg", AppleEventCode = "tArg", Type = "integer"
                  } }
            };

            suiteName        = "Chromium Suite";
            commandName      = "Exec Python";
            cmdClass         = "NSScriptCommand";
            eventCode        = "ExPy";
            eventClass       = "CrSu";
            returnType       = "NSString";
            resultAppleEvent = "text";
            dict             = new NSScriptCommandDescriptionDictionary {
                CommandClass        = cmdClass,
                AppleEventCode      = eventCode,
                AppleEventClassCode = eventClass,
                Type = returnType,
                ResultAppleEventCode = resultAppleEvent
            };

            foreach (var arg in args.Values)
            {
                dict.Add(arg);
            }
            scriptDescription = NSScriptCommandDescription.Create(suiteName, commandName, dict);
        }
コード例 #2
0
        public void TestCreateWithDictNullOrEmptyCommandName(string code)
        {
            var description = new NSScriptCommandDescriptionDictionary();

            NSScriptCommandDescription.Create(suiteName, code, description);
        }
コード例 #3
0
        public void TestCreateWithDictWrongArgDescription()
        {
            var description = new NSScriptCommandDescriptionDictionary();

            NSScriptCommandDescription.Create(suiteName, commandName, description);
        }
コード例 #4
0
 public void TestCreateEventCodeNullOrEmpty(string code)
 {
     dict.AppleEventCode = code;
     NSScriptCommandDescription.Create(suiteName, commandName, dict);
 }
コード例 #5
0
 public void TestCreateResultAppleEventWrongLength(string code)
 {
     dict.ResultAppleEventCode = code;
     NSScriptCommandDescription.Create(suiteName, commandName, dict);
 }
コード例 #6
0
 public void TestCreateCommandNameNullOrEmpty(string code)
 {
     NSScriptCommandDescription.Create(suiteName, code, dict);
 }
コード例 #7
0
 public void TestCreateCmdClassNullOrEmpty(string code)
 {
     dict.CommandClass = code;
     NSScriptCommandDescription.Create(suiteName, commandName, dict);
 }
コード例 #8
0
        public void TestCreateWithDictNullDict()
        {
            NSScriptCommandDescriptionDictionary dict = null;

            Assert.Throws <ArgumentNullException> (() => NSScriptCommandDescription.Create(suiteName, commandName, dict));
        }
コード例 #9
0
        public void TestCreateWithDictNullDict()
        {
            NSScriptCommandDescriptionDictionary dict = null;

            NSScriptCommandDescription.Create(suiteName, commandName, dict);
        }
コード例 #10
0
        public void TestCreateWithDictNullOrEmptyCommandName(string code)
        {
            var description = new NSScriptCommandDescriptionDictionary();

            Assert.Throws <ArgumentException> (() => NSScriptCommandDescription.Create(suiteName, code, description));
        }
コード例 #11
0
        public void TestCreateWithDictWrongArgDescription()
        {
            var description = new NSScriptCommandDescriptionDictionary();

            Assert.Throws <ArgumentException> (() => NSScriptCommandDescription.Create(suiteName, commandName, description));
        }
コード例 #12
0
 public void TestCreateResultAppleEventWrongLength(string code)
 {
     dict.ResultAppleEventCode = code;
     Assert.Throws <ArgumentException> (() => NSScriptCommandDescription.Create(suiteName, commandName, dict));
 }
コード例 #13
0
 public void TestCreateEventCodeNullOrEmpty(string code)
 {
     dict.AppleEventCode = code;
     Assert.Throws <ArgumentException> (() => NSScriptCommandDescription.Create(suiteName, commandName, dict));
 }
コード例 #14
0
 public void TestCreateSuiteNameNullOrEmpty(string code)
 {
     Assert.Throws <ArgumentException> (() => NSScriptCommandDescription.Create(code, commandName, dict));
 }