Пример #1
0
 [Test] public void CanGetFieldsAsNodeMethods()
 {
     var application = new Application();
     var resource = ResourceFactory.Instance.Create(application, null, "");
     //var nodeMethodFromBehaviour = resource.NodeMethod("SignIn");
    // Assert.NotNull(nodeMethodFromBehaviour);
 }
Пример #2
0
        public static void SeedApplication(Application application)
        {
            application.Membership.Users.Add(new User()
            {
                DisplayName = "Mr Example",
                Email = "*****@*****.**",
                Password = "******"
            });
            var project = new Project("Wedding planning");
            application.Organisations.Items.Add(new Organisation("Your projects")
            {
                Projects =
                {
                    project
                }
            });
            project.DiscussionsManager.NewDiscussion(new Discussion() {Title = "Where should we get married?"},
                                                     new Message() {Text = "I'd like to do it at the zoo"});
            var toDoList = new ToDoList() {ListName = "Things to buy"};
            project.ToDoLists.AddList(toDoList);
            toDoList.AddTask(new Task() { Title = "Wedding Dress" });
            toDoList.AddTask(new Task() { Title = "Wedding Rings" });

            application.Organisations.Items.Add(new Organisation("ACME Corps Projects")
            {
                Projects =
                {
                    new Project("North Korea Marketing Campaign"),
                    new Project("South Korea Marketing Campaign"),

                }
            });
        }
Пример #3
0
        public static void Main(string[] args)
        {


            HttpSelfHostServer server = null;
            try
            {
                var config = new HttpSelfHostConfiguration("http://localhost:3002/")
                {
                };
                //config.Formatters.Add(new HtmlMediaTypeFormatter());
                var todoList = new Application();
                config.Routes.Add("Noodles", config.Routes.CreateRoute("{*path}",
                    new HttpRouteValueDictionary("route"),
                    constraints: null,
                    dataTokens: null,
                    handler: new NoodlesHttpMessageHandler((r) => todoList)
                    ));
                server = new HttpSelfHostServer(config);

                server.OpenAsync().Wait();

                Console.WriteLine("Hit ENTER to exit");
                Console.ReadLine();
            }
            finally
            {
                if (server != null)
                {
                    server.CloseAsync().Wait();
                }
            }


        }