Skip to content

Commit

Permalink
Update coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lekman committed Aug 10, 2023
1 parent 64d863c commit 207ae29
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions AzureLiquid.Preview/PreviewProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public PreviewProcess()
/// <value>
/// <c>true</c> if should watch; otherwise, <c>false</c>.
/// </value>
[ExcludeFromCodeCoverage]
internal bool ShouldWatch { get; private set; }

/// <summary>
Expand Down
23 changes: 22 additions & 1 deletion AzureLiquid.Tests/PreviewProcessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,27 @@ public void EnsureArgumentParsing(bool shouldLog, string arg1, string arg2, stri
}
}

[Fact]
public void EnsureObjectCreation()
{
// Arrange
var instance = new PreviewProcess
{
Template = Arrangement.GetPath("./Resources/albums.liquid"),
Content = Arrangement.GetPath("./Resources/albums.xml"),
Output = Arrangement.GetPath("./Resources/albums.json")
};

// Act
instance.Render();

// Assert
instance.Log.Should().BeEmpty("A log should not have been created");
instance.Template.Should().NotBeEmpty("The template should be empty");
instance.Content.Should().NotBeEmpty("The content should be empty");
instance.Output.Should().NotBeEmpty("The output should be empty");
}

/// <summary>
/// Ensure the preview process can use a file watcher.
/// </summary>
Expand Down Expand Up @@ -189,7 +210,7 @@ public Arrangement()
/// </summary>
/// <param name="path">The relative path.</param>
/// <returns>Full path.</returns>
private static string GetPath(string path)
public static string GetPath(string path)
{
var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
return Path.GetFullPath(path, basePath);
Expand Down

0 comments on commit 207ae29

Please sign in to comment.