-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create output directory if missing (#23)
This fixes issue #18 where TREATASCONTENT will fail if the output directory is missing.
- Loading branch information
1 parent
3bd0a51
commit 0109c39
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2022, salesforce.com, inc. | ||
// All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/Apache-2.0 | ||
|
||
using Sage.Engine.Runtime; | ||
|
||
namespace Sage.Engine.Tests.Functions | ||
{ | ||
[TestFixture] | ||
internal class ContentTests : FunctionTestBase | ||
{ | ||
[Test] | ||
[TestCase("%%=ADD(1,2)=%%", "3")] | ||
public void TestTreatAsContentNoOutputDirectory(string input, string expected) | ||
{ | ||
var options = TestCompilationOptions(); | ||
options.OutputDirectory = new DirectoryInfo(Path.Combine(options.OutputDirectory.FullName, "doesnotexist")); | ||
var context = new RuntimeContext(_serviceProvider, options); | ||
|
||
string results = context.TREATASCONTENT(input); | ||
Assert.That(results, Is.EqualTo(expected)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters