Exemple #1
0
        public async Task NTaskHost_ContainerShouldNotBeNullAfterInit()
        {
            var hostName        = "DefaultHost";
            var sampleDirectory = @"..\..\..\NTasker.Core.Tests\bin\Debug";
            var host            = new NTasker.NTaskHost(hostName, sampleDirectory);
            var token           = new CancellationToken(false);
            await host.Init(new CancellationToken(false));

            Assert.IsNotNull(host.Container);
        }
Exemple #2
0
        public void NTaskHost_InitializationTests()
        {
            var hostName        = "DefaultHost";
            var sampleDirectory = @"..\..\..\NTasker.Core.Tests\bin\Debug";
            var host            = new NTasker.NTaskHost(hostName, sampleDirectory);

            Assert.IsNotNull(host.Name);
            Assert.AreEqual(hostName, host.Name);
            Assert.IsNotNull(host.Catalog);
            Assert.IsNull(host.Container);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var hostName = "DefaultHost";
            // TODO: Get this from args parameter
            var sampleDirectory = @"..\..\..\NTasker.Core.Tests\bin\Debug";
            var host            = new NTasker.NTaskHost(hostName, sampleDirectory);
            // Create a token that never expires
            var tokenSource = new CancellationTokenSource();
            var token       = tokenSource.Token;

            // Create a token that expires after N seconds
            // var tokenSource = new CancellationTokenSource(40 * 1000);
            // var token = tokenSource.Token;
            host.Init(token).Wait();
            Console.Read();
        }