Esempio n. 1
0
        public ISillyView Index(ISillyContext context)
        {
            Stopwatch timer2 = new Stopwatch();
            Stopwatch timer3 = new Stopwatch();

            timer3.Start();

            Task <Document> data = base.DynamoGetItemAsync(Amazon.RegionEndpoint.USWest1, "sillywidgets", "*****@*****.**");

            timer2.Start();

            SillyView   home    = new SillyView();
            SillyView   content = new SillyView();
            SillyView   header  = new SillyView();
            Task <bool> result  = home.LoadS3Async("sillywidgets.com", "diagnostic/diag.html", Amazon.RegionEndpoint.USWest1);
            Task <bool> result2 = content.LoadS3Async("sillywidgets.com", "diagnostic/content.html", Amazon.RegionEndpoint.USWest1);
            Task <bool> result3 = header.LoadS3Async("sillywidgets.com", "diagnostic/header.html", Amazon.RegionEndpoint.USWest1);

            data.Wait();
            timer3.Stop();
            result.Wait();
            result2.Wait();
            result3.Wait();

            timer2.Stop();

            home.Bind(data.Result);
            home.Bind("content", content);
            home.Bind("header", header);
            home.Bind("dynamoGetValue", timer3.Elapsed.TotalMilliseconds + "ms");
            home.Bind("s3source", "diagnostic/diag.html");
            home.Bind("loadViewValue", timer2.Elapsed.TotalMilliseconds + "ms");

            return(home);
        }
Esempio n. 2
0
        public void GetFromS3Test()
        {
            Console.Write("Controller Get S3 -> ");
            SillyView view = new SillyView();

            Task <bool> result = view.LoadS3Async("sillywidgets.com", "testdata/testS3.html", Amazon.RegionEndpoint.USWest1);

            result.Wait();

            Assert.True(result.Result);

            Console.WriteLine(view.Render());
        }
Esempio n. 3
0
        public ISillyView Index(ISillyContext context)
        {
            SillyView       home   = new SillyView();
            Task <bool>     result = home.LoadS3Async("sillywidgets.com", "index.html", Amazon.RegionEndpoint.USWest1);
            Task <Document> data   = base.DynamoGetItemAsync(Amazon.RegionEndpoint.USWest1, "sillywidgets", "*****@*****.**");

            result.Wait();
            data.Wait();

            if (!result.Result)
            {
                return(null);
            }

            home.Bind(data.Result);

            return(home);
        }
Esempio n. 4
0
        public void WidgetTest()
        {
            Console.Write("Controller Widget Test -> ");
            SillyController controller = new SillyController();
            SillyView       view       = new SillyView();

            Task <Document> data        = controller.DynamoGetItemAsync(Amazon.RegionEndpoint.USWest1, "sillywidgets", "*****@*****.**");
            Task <bool>     result      = view.LoadS3Async("sillywidgets.com", "diagnostic/diag.html", Amazon.RegionEndpoint.USWest1);
            Task <bool>     bound       = view.BindAsync("content", "sillywidgets.com", "diagnostic/content.html", Amazon.RegionEndpoint.USWest1);
            Task <bool>     widgetBound = view.BindAsync("header", "sillywidgets.com", "diagnostic/header.html", Amazon.RegionEndpoint.USWest1);

            data.Wait();
            result.Wait();
            bound.Wait();
            widgetBound.Wait();

            view.Bind(data.Result);
            view.Bind("dynamoGetValue", "This is a test");

            Console.WriteLine(view.Render());
        }