public void ServiceAPI_IntegrationTests_1()
        {
            var engine = new ServiceEngine();

            var session = engine.CreateSession("-f /dev/stdin", InputText);

            Assert.True(session.IsActive);

            var response = session.ExecuteCommand("bal checking --account=code");

            Assert.False(response.HasErrors);
            Assert.Equal(BalCheckingOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());

            response = session.ExecuteCommand("bal checking --account=code");
            Assert.False(response.HasErrors);
            Assert.Equal(BalCheckingOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());

            response = session.ExecuteCommand("bal");
            Assert.False(response.HasErrors);
            Assert.Equal(BalOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());

            response = session.ExecuteCommand("reg");
            Assert.False(response.HasErrors);
            Assert.Equal(RegOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());
        }
        public void ServiceAPI_IntegrationTests_2()
        {
            var engine   = new ServiceEngine();
            var response = ServiceAPI_IntegrationTests_2_Exec(engine).Result;

            Assert.False(response.HasErrors);
            Assert.Equal(BalCheckingOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());
        }
        public void ServiceAPI_IntegrationTests_7()
        {
            var engine = new ServiceEngine(
                configureContext: context =>
            {
                context.SetEnvironmentVariables(new Dictionary <string, string>()
                {
                    { "COLUMNS", "120" }
                });
            });

            var session  = engine.CreateSession("-f /dev/stdin", InputText);
            var response = session.ExecuteCommand("bal checking --account=code");

            Assert.False(response.HasErrors);
            Assert.Equal(BalCheckingOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());
        }
        public void ServiceAPI_IntegrationTests_6()
        {
            var fs = new MemoryFileSystemProvider();

            fs.CreateFile("input.dat", InputText);

            var engine = new ServiceEngine(
                createCustomProvider: mem =>
            {
                return(new ApplicationServiceProvider(
                           fileSystemProviderFactory: () => fs,
                           virtualConsoleProviderFactory: () => new VirtualConsoleProvider(mem.ConsoleInput, mem.ConsoleOutput, mem.ConsoleError)));
            });

            var session  = engine.CreateSession("-f input.dat");
            var response = session.ExecuteCommand("bal checking --account=code");

            Assert.False(response.HasErrors);
            Assert.Equal(BalCheckingOutputText.Replace("\r", "").Trim(), response.OutputText.Trim());
        }