Skip to content

Commit

Permalink
Missing quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
mausch committed Nov 29, 2012
1 parent 01d67f8 commit 7164ef6
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
47 changes: 47 additions & 0 deletions QuartzNetWebConsole.Tests/DummyTrigger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using Quartz;

namespace QuartzNetWebConsole.Tests {
public class DummyTrigger : ITrigger {
public object Clone() {
throw new NotImplementedException();
}

public int CompareTo(ITrigger other) {
throw new NotImplementedException();
}

public IScheduleBuilder GetScheduleBuilder() {
throw new NotImplementedException();
}

public bool GetMayFireAgain() {
throw new NotImplementedException();
}

public DateTimeOffset? GetNextFireTimeUtc() {
return NextFireTimeUtc;
}

public DateTimeOffset? GetPreviousFireTimeUtc() {
throw new NotImplementedException();
}

public DateTimeOffset? GetFireTimeAfter(DateTimeOffset? afterTime) {
throw new NotImplementedException();
}

public DateTimeOffset? NextFireTimeUtc { get; set; }
public TriggerKey Key { get; set; }
public JobKey JobKey { get; set; }
public string Description { get; set; }
public string CalendarName { get; set; }
public JobDataMap JobDataMap { get; set; }
public DateTimeOffset? FinalFireTimeUtc { get; set; }
public int MisfireInstruction { get; set; }
public DateTimeOffset? EndTimeUtc { get; set; }
public DateTimeOffset StartTimeUtc { get; set; }
public int Priority { get; set; }
public bool HasMillisecondPrecision { get; set; }
}
}
5 changes: 5 additions & 0 deletions QuartzNetWebConsole.Tests/QuartzNetWebConsole.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=2.0.1.100, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Quartz.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
Expand All @@ -54,6 +58,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ControllerFactoryTests.cs" />
<Compile Include="DummyTrigger.cs" />
<Compile Include="LimitedListTests.cs" />
<Compile Include="PaginationInfoTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
23 changes: 23 additions & 0 deletions QuartzNetWebConsole.Tests/ViewsTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Linq;
using MiniMVC;
using NUnit.Framework;
using Quartz;
using QuartzNetWebConsole.Views;

namespace QuartzNetWebConsole.Tests {
Expand All @@ -24,5 +26,26 @@ public void TrClassAlt() {
Assert.AreEqual("alt", tr.Attribute("class").Value);
}
}

[Test]
public void TriggerTable() {
var trigger = new DummyTrigger {
Key = new TriggerKey("myCronTrigger", "DEFAULT"),
JobKey = new JobKey("someJob", "DEFAULT"),
};
var triggers = new[] {
new TriggerWithState(trigger, TriggerState.Normal),
};
var x = Views.Views.TriggerTable(triggers, "/", highlight: "DEFAULT.myCronTrigger");
var tr = x.Descendants().First(e => {
var id = e.Attribute("id");
if (id == null)
return false;
return id.Value == "DEFAULT.myCronTrigger";
});
Assert.AreEqual("highlight", tr.Attribute("class").Value);
//var html = x.MakeHTMLCompatible();
//Console.WriteLine(html);
}
}
}
2 changes: 1 addition & 1 deletion QuartzNetWebConsole.Views/Views.vb
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Public Module Views
"&next=" + HttpUtility.UrlEncode(thisUrl)
Select
<tr id=<%= trigger.Key.ToString() %>
class=<%= If(highlight = trigger.Key.ToString(), highlight, "") %>>
class=<%= If(highlight = trigger.Key.ToString(), "highlight", "") %>>
<td><%= trigger.Key.Name %></td>
<td><%= trigger.Description %></td>
<td><%= trigger.Priority %></td>
Expand Down

0 comments on commit 7164ef6

Please sign in to comment.