public void DashboardMetric_Returns_Value(DashboardMetric dashboardMetric)
        {
            var page = new TestPage();

            var metric = dashboardMetric.Func(page);

            Assert.NotEqual("???", metric.Value);
        }
示例#2
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 4 "..\..\Dashboard\Pages\_InlineMetric.cshtml"

            var metric      = DashboardMetric.Func(this);
            var className   = metric == null ? "metric-null" : metric.Style.ToClassName();
            var highlighted = metric != null && metric.Highlighted ? "highlighted" : null;



            #line default
            #line hidden
            WriteLiteral("<span data-metric=\"");



            #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml"
            Write(DashboardMetric.Name);


            #line default
            #line hidden
            WriteLiteral("\" class=\"metric ");



            #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml"
            Write(className);


            #line default
            #line hidden
            WriteLiteral(" ");



            #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml"
            Write(highlighted);


            #line default
            #line hidden
            WriteLiteral("\">");



            #line 9 "..\..\Dashboard\Pages\_InlineMetric.cshtml"
            Write(metric?.Value);


            #line default
            #line hidden
            WriteLiteral("</span>");
        }
        public void GetInfo_Threaded()
        {
            DashboardMetric Result1 = null;
            DashboardMetric Result2 = null;

            var t  = new Thread(() => Result1 = Redis.Storage.GetDashboardInfo("Version", "redis_version"));
            var t2 = new Thread(() => Result2 = Redis.Storage.GetDashboardInfo("Blocked Clients", "blocked_clients"));

            t.IsBackground  = true;
            t2.IsBackground = true;
            t.Start();
            t2.Start();

            t.Join();
            t2.Join();
            Assert.Equal("2.8.19", Result1.Func(null).Value);
            Assert.Equal("0", Result2.Func(null).Value);
        }
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 5 "..\..\Dashboard\Pages\_BlockMetric.cshtml"

            var metric      = DashboardMetric.Func(this);
            var className   = metric == null ? "metric-null" : metric.Style.ToClassName();
            var highlighted = metric != null && metric.Highlighted ? "highlighted" : null;



            #line default
            #line hidden
            WriteLiteral("<div class=\"metric ");



            #line 10 "..\..\Dashboard\Pages\_BlockMetric.cshtml"
            Write(className);


            #line default
            #line hidden
            WriteLiteral(" ");



            #line 10 "..\..\Dashboard\Pages\_BlockMetric.cshtml"
            Write(highlighted);


            #line default
            #line hidden
            WriteLiteral("\">\r\n    <div class=\"metric-body\" data-metric=\"");



            #line 11 "..\..\Dashboard\Pages\_BlockMetric.cshtml"
            Write(DashboardMetric.Name);


            #line default
            #line hidden
            WriteLiteral("\">\r\n        ");



            #line 12 "..\..\Dashboard\Pages\_BlockMetric.cshtml"
            Write(metric?.Value);


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div class=\"metric-description\">\r\n        ");



            #line 15 "..\..\Dashboard\Pages\_BlockMetric.cshtml"
            Write(Strings.ResourceManager.GetString(DashboardMetric.Title) ?? DashboardMetric.Title);


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n</div>");
        }