Esempio n. 1
0
        public MainWindow()
        {
            MethodTreeModel = new RootViewModel();
            InitializeComponent();
            selectClient = new SelectClient();
            selectClient.Source.Loaded += Source_Loaded;
            var empty = new EmptyMethodViewModel();
            ResultBlock.DataContext = empty;
            HelpBlock.DataContext = empty;
            paramview.Source = MethodTreeModel.GlobalParameters;
            controllersAndCommands.DataContext = MethodTreeModel.Controllers;

            var conn = new IsopClient(new JsonHttpClient(), ConfigurationManager.AppSettings["server_url"]);
            InitFromClient(new JsonClient(conn), _ =>
            {
                var assemblies = new LoadAssemblies().LoadFrom(ExecutionAssembly.Path()).ToArray();
                var build = new Build();
                foreach (var assembly in assemblies)
                {
                    build.ConfigurationFrom(assembly);
                }
                InitFromClient(new BuildClient(build));
            });
        }
        private RootViewModel RootVmWithMethodSelected()
        {
            var mt = RootModelFromSource();
            var treemodel = new RootViewModel(new JsonClient(_isopClient), mt);

            treemodel.CurrentMethod = treemodel.Controllers.Single()
                .Methods.Single(m => m.Name == "Action");
            return treemodel;
        }
        private RootViewModel RootVmWithMethodSelected()
        {
            A.CallTo(() => _jsonHttpClient.Request(A<Request>._))
                .Returns(new JsonResponse(System.Net.HttpStatusCode.OK, JsonConvert.SerializeObject(
                    RootModelFromSource())));

            var mt = _isopClient.GetModel().Result;
            var treemodel = new RootViewModel(new JsonClient(_isopClient), mt);

            treemodel.CurrentMethod = treemodel.Controllers.Single()
                .Methods.Single(m => m.Name == "Action");
            return treemodel;
        }