Skip to content

Commit

Permalink
Fixed Failing UnitTests
Browse files Browse the repository at this point in the history
  • Loading branch information
sufyannisar committed Jan 28, 2024
1 parent 2b5e570 commit d546ca8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/Hangfire.Console.Tests/Dashboard/ConsoleRendererFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,18 @@ public void RenderLine_WithFractionalProgress()

ConsoleRenderer.RenderLine(builder, line, new DateTime(2016, 1, 1, 0, 0, 0, DateTimeKind.Utc));

Assert.Equal("<div class=\"line pb\" data-id=\"3\"><span data-moment-title=\"1451606400\">+ &lt;1ms</span><div class=\"pv\" style=\"width:17.3%\" data-value=\"17\"></div></div>", builder.ToString());
Assert.Equal("<div class=\"line pb\" data-id=\"3\"><span data-moment-title=\"1451606400\">+ &lt;1ms</span><div class=\"pv\" style=\"width:17.3%\" data-value=\"17.3\"></div></div>", builder.ToString());
}

[Fact]
public void RenderLine_WithFractionalProgressWith4DecimalPlaces()
{
var line = new ConsoleLine { TimeOffset = 0, Message = "3", ProgressValue = 17.3213 };
var builder = new StringBuilder();

ConsoleRenderer.RenderLine(builder, line, new DateTime(2016, 1, 1, 0, 0, 0, DateTimeKind.Utc));

Assert.Equal("<div class=\"line pb\" data-id=\"3\"><span data-moment-title=\"1451606400\">+ &lt;1ms</span><div class=\"pv\" style=\"width:17.3213%\" data-value=\"17.3213\"></div></div>", builder.ToString());
}

[Fact]
Expand Down Expand Up @@ -341,4 +352,4 @@ private void SetupStorage(StateData? stateData, params ConsoleLine[] lines)
_storage.Setup(x => x.GetLines(It.IsAny<ConsoleId>(), It.IsAny<int>(), It.IsAny<int>()))
.Returns((ConsoleId _, int start, int end) => lines.Where((_, i) => i >= start && i <= end));
}
}
}

0 comments on commit d546ca8

Please sign in to comment.