Beispiel #1
0
        public void TestGetVersion()
        {
            var    pp     = new TestLogPlugin();
            Action action = () => pp.Version.ToString();

            action.Should().NotThrow();
        }
Beispiel #2
0
        public void TestLog()
        {
            var lp = new TestLogPlugin();

            lp.LogMessage("Hello");
            lp.Output.Should().Be("Plugin:TestLogPlugin_Info_Hello");
        }
Beispiel #3
0
        public void TestGetConfigFile()
        {
            var pp   = new TestLogPlugin();
            var file = pp.ConfigFile;

            file.EndsWith("config.json").Should().BeTrue();
        }
Beispiel #4
0
        public void TestNotifyPluginsLoadedAfterSystemConstructed()
        {
            var    pp     = new TestLogPlugin();
            Action action = () => Plugin.NotifyPluginsLoadedAfterSystemConstructed();

            action.Should().NotThrow();
        }
Beispiel #5
0
 public void TestResumeNodeStartupAndSuspendNodeStartup()
 {
     TestLogPlugin.TestLoadPlugins(TestBlockchain.TheNeoSystem);
     TestLogPlugin.TestSuspendNodeStartup();
     TestLogPlugin.TestSuspendNodeStartup();
     TestLogPlugin.TestResumeNodeStartup().Should().BeFalse();
     TestLogPlugin.TestResumeNodeStartup().Should().BeTrue();
 }
Beispiel #6
0
        public void TestResumeNodeStartupAndSuspendNodeStartup()
        {
            var system = TestBlockchain.InitializeMockNeoSystem();

            TestLogPlugin.TestLoadPlugins(system);
            TestLogPlugin.TestSuspendNodeStartup();
            TestLogPlugin.TestSuspendNodeStartup();
            TestLogPlugin.TestResumeNodeStartup().Should().BeFalse();
            TestLogPlugin.TestResumeNodeStartup().Should().BeTrue();
        }
Beispiel #7
0
        public void TestSendMessage()
        {
            lock (locker)
            {
                Plugin.Plugins.Clear();
                Plugin.SendMessage("hey1").Should().BeFalse();

                var lp = new TestLogPlugin();
                Plugin.SendMessage("hey2").Should().BeTrue();
            }
        }
Beispiel #8
0
        public void TestGetConfiguration()
        {
            var pp = new TestLogPlugin();

            pp.TestGetConfiguration().Key.Should().Be("PluginConfiguration");
        }
Beispiel #9
0
        public void TestGetName()
        {
            var pp = new TestLogPlugin();

            pp.Name.Should().Be("TestLogPlugin");
        }