public void Default_Description_Is_The_Name()
 {
     var commandFile = new IronPythonCommandFile(_engine,
                               @"def CommandName(args):
       return ""result""");
     Assert.Equal("Command Name", commandFile.First().Description);
     Assert.Equal("Command Name", commandFile.First().GetDescription(string.Empty));
 }
 public void DocString_Serves_As_Description_For()
 {
     var commandFile = new IronPythonCommandFile(_engine,
                               @"def CommandName(args):
       """"""This is the description""""""
       return ""result""");
     Assert.Equal("This is the description", commandFile.First().GetDescription(string.Empty));
     Assert.Equal("This is the description", commandFile.First().Description);
 }
Beispiel #3
0
        public void Default_Description_Is_The_Name()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"def CommandName(args):
  return ""result""");

            Assert.Equal("Command Name", commandFile.First().Description);
            Assert.Equal("Command Name", commandFile.First().GetDescription(string.Empty));
        }
Beispiel #4
0
        public void DocString_Serves_As_Description_For()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"def CommandName(args):
  """"""This is the description""""""
  return ""result""");

            Assert.Equal("This is the description", commandFile.First().GetDescription(string.Empty));
            Assert.Equal("This is the description", commandFile.First().Description);
        }
Beispiel #5
0
        public void Name_For_Class_With_CamelCase_Name_Has_Spaces_Separating_Words()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"class CommandName(BaseIronPythonCommand):
  def Execute(self, args): return 1");

            Assert.Equal("Command Name", commandFile.First().Name);
        }
        public void Can_Create_Command_From_Method()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                      @"def CommandName(args):
              return ""result""");

            Assert.True(commandFile.Any());
            var command = commandFile.First();
            Assert.Equal("Command Name",command.Name);
        }
        public void Can_Call_GetName_With_Two_Arguments()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                      @"class CommandName(BaseIronPythonCommand):
              def GetName(self): return ""Name""
              def Execute(self, args): return");

            var command = commandFile.First();
            Assert.Equal("Name",command.GetName(""));
        }
Beispiel #8
0
        public void Name_For_Class_With_GetName_Is_Result_Of_GetName()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"class Command(BaseIronPythonCommand):
  def GetName(self): return ""Name""
  def Execute(self, args): return 1");

            Assert.Equal(1, commandFile.Count());
            Assert.Equal("Name", commandFile.First().Name);
        }
Beispiel #9
0
        public void Can_Create_Command_From_Method()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"def CommandName(args):
  return ""result""");

            Assert.True(commandFile.Any());
            var command = commandFile.First();

            Assert.Equal("Command Name", command.Name);
        }
Beispiel #10
0
        public void Can_Call_GetName_With_Two_Arguments()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"class CommandName(BaseIronPythonCommand):
  def GetName(self): return ""Name""
  def Execute(self, args): return");

            var command = commandFile.First();

            Assert.Equal("Name", command.GetName(""));
        }
 public void Class_With_Docstring_Has_Description_And_No_Description_Method_Uses_Docstring_As_Description()
 {
     var commandFile = new IronPythonCommandFile(_engine,
                                                 @"
     class CommandName(BaseIronPythonCommand):
       """"""This is the description""""""
       def Execute(self, args):
     return ""None""
     ");
     var command = commandFile.First();
     Assert.Equal("This is the description", command.GetDescription(string.Empty));
     Assert.Equal("This is the description", command.Description);
 }
        public void Class_With_Docstring_Has_Description_And_No_Description_Method_Uses_Docstring_As_Description()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                                        @"
class CommandName(BaseIronPythonCommand):
  """"""This is the description""""""
  def Execute(self, args):
    return ""None""
");
            var command = commandFile.First();

            Assert.Equal("This is the description", command.GetDescription(string.Empty));
            Assert.Equal("This is the description", command.Description);
        }
        public void Name_For_Class_With_GetName_Is_Result_Of_GetName()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                      @"class Command(BaseIronPythonCommand):
              def GetName(self): return ""Name""
              def Execute(self, args): return 1");

            Assert.Equal(1, commandFile.Count());
            Assert.Equal("Name", commandFile.First().Name);
        }
        public void Name_For_Class_With_CamelCase_Name_Has_Spaces_Separating_Words()
        {
            var commandFile = new IronPythonCommandFile(_engine,
                                      @"class CommandName(BaseIronPythonCommand):
              def Execute(self, args): return 1");

            Assert.Equal("Command Name", commandFile.First().Name);
        }