public void Setup()
        {
            var config = new LibraryConfig();

            config.Assembly = "NRobot.Server.Test";
            config.TypeName = RunKeywordType;
            _keywordManager = new KeywordManager();
            _keywordManager.AddLibrary(config);
            config.TypeName = TestKeywordType;
            _keywordManager.AddLibrary(config);
        }
Пример #2
0
        public void LoadAssembly_WithNullConfig()
        {
            //setup
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            //load
            kwmanager.AddLibrary(config);
        }
Пример #3
0
        public void ClassAccess_StaticClass()
        {
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            config.Assembly = "NRobot.Server.Test";
            config.TypeName = "NRobot.Server.Test.Keywords.StaticClass";
            kwmanager.AddLibrary(config);
        }
Пример #4
0
        public void ClassAccess_InternalClass()
        {
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            config.Assembly = "NRobot.Server.Test";
            config.TypeName = "NRobot.Server.Test.Keywords.InternalClass";
            kwmanager.AddLibrary(config);
            Assert.True(kwmanager.GetKeywordNamesForType("NRobot.Server.Test.Keywords.InternalClass").Length == 0);
        }
Пример #5
0
        public void Setup()
        {
            var config = new LibraryConfig();

            config.Assembly      = "NRobot.Server.Test";
            config.TypeName      = Typename;
            config.Documentation = "NRobot.Server.Test.xml";
            _keywordManager      = new KeywordManager();
            _keywordManager.AddLibrary(config);
        }
Пример #6
0
        public void LoadAssembly_LoadMultiple()
        {
            //setup
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            //config
            config.Assembly = "system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
            config.TypeName = "System.Timers.Timer";
            //load first
            kwmanager.AddLibrary(config);
            //config
            config.Assembly = "NRobot.Server.Test";
            config.TypeName = "NRobot.Server.Test.Keywords.TestKeywords";
            //load second
            kwmanager.AddLibrary(config);
            var result = kwmanager.GetKeywordNamesForType("NRobot.Server.Test.Keywords.TestKeywords");

            Assert.Contains("PUBLIC METHOD", result);
        }
Пример #7
0
        public void LoadAssembly_GACAssembly()
        {
            //setup
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            //config
            config.Assembly = "system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
            config.TypeName = "System.Timers.Timer";
            //load
            kwmanager.AddLibrary(config);
        }
Пример #8
0
        public void LoadAssembly_WithUnknownType()
        {
            //setup
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            //config
            config.Assembly = "NRobot.Server.Test";
            config.TypeName = "NRobot.Server.Test.Keywords.UnknownType";
            //load
            kwmanager.AddLibrary(config);
        }
Пример #9
0
        public void LoadAssembly_WithUnknownXMLDocumentation()
        {
            //setup
            var config    = new LibraryConfig();
            var kwmanager = new KeywordManager();

            //config
            config.Assembly      = "NRobot.Server.Test";
            config.TypeName      = "NRobot.Server.Test.Keywords.TestKeywords";
            config.Documentation = "NRobot.Server.Test.Unknown.xml";
            //load
            kwmanager.AddLibrary(config);
        }
Пример #10
0
        public void GetKeywordDocumentation_NoXMLFileLoaded()
        {
            var config = new LibraryConfig();

            config.Assembly = "NRobot.Server.Test";
            config.TypeName = "NRobot.Server.Test.Keywords.WithDocumentationClass";
            var keywordManager = new KeywordManager();

            keywordManager.AddLibrary(config);
            var keyword = keywordManager.GetKeyword(Typename, "MethodWithComments");

            Assert.IsTrue(String.IsNullOrEmpty(keyword.KeywordDocumentation));
        }
Пример #11
0
 /// <summary>
 /// Loads the keyword libraries
 /// </summary>
 private void LoadKeywords()
 {
     Log.Debug("Loading keywords");
     try
     {
         foreach (var libraryconfig in _config.AssemblyConfigs)
         {
             _keywordManager.AddLibrary(libraryconfig.Value);
         }
     }
     catch (Exception e)
     {
         Log.Error(String.Format("Unable to load all configured keywords, {0}", e.Message));
         throw;
     }
 }