public BaseGeneratorTests()
 {
     _smartAppPath = Path.Combine(Directory.GetCurrentDirectory(), "Manifest");
     _context      = new ActivityContext(new ExpandoObject(), null, null);
     _context.DynamicContext.Manifest        = JadeEngine.Parse(_smartAppPath);
     _context.DynamicContext.GeneratorPath   = Directory.GetCurrentDirectory();
     _context.DynamicContext.Theme           = "light";
     _context.DynamicContext.ViewModelSuffix = "ViewModel";
     _context.DynamicContext.ApiSuffix       = "Service";
     TransformSuffixes();
 }
        public BaseGeneratorTest()
        {
            _services = new ServiceCollection();
            _services.AddLogging();
            _services.AddWorkflow();
            _services.AddSingleton <IUnityServiceProvider, UnityServiceProvider>();
            _services.AddSingleton <IUnityContainer, UnityContainer>();
            _serviceProvider = _services.BuildServiceProvider();

            _unityServiceProvider = _serviceProvider.GetService <IUnityServiceProvider>();
            _container            = _serviceProvider.GetService <IUnityContainer>();
            _container.AddExtension(new UnityFallbackProviderExtension(_serviceProvider));
            _workflowHost        = _unityServiceProvider.GetService <IWorkflowHost>();
            _persistenceProvider = _unityServiceProvider.GetService <IPersistenceProvider>();

            _context = new SessionContext();
            _context.DynamicContext = new ExpandoObject();

            var basePath = AppDomain.CurrentDomain.BaseDirectory;

            _context.BasePath = Path.Combine(basePath, "GeneratedCode");

            var manifestPath = Path.Combine(basePath, "Manifest");

            _context.Manifest = JadeEngine.Parse(manifestPath);

            _context.GeneratorPath = basePath;

            var writingService     = new WritingService();
            var workflowNotifier   = new WorkflowNotifier();
            var workflowEndService = new WorkflowEndService();

            _container.RegisterInstance <IWorkflowEnd>(workflowEndService);
            _container.RegisterInstance <IWorkflowNotifier>(workflowNotifier);
            _container.RegisterInstance <IWriting>(writingService);
            _container.RegisterInstance <ISessionContext>(_context);
        }
 public BaseTest()
 {
     _smartApp = JadeEngine.Parse("Manifest");
 }