Skip to content

Commit 289a143

Browse files
committed
fix test on linux
1 parent b3b23e4 commit 289a143

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/WriterTests/ScheduleEventsTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ public void VerifyScheduleEventInput_RelativeFilePath_ReadsFileContents(CloudFor
183183
public void VerifyScheduleEventInput_AbsoluteFilePath_ReadsFileContents(CloudFormationTemplateFormat templateFormat)
184184
{
185185
// ARRANGE - Set up a mock file manager with a JSON file at an absolute path
186+
// Use Path.GetTempPath() to ensure the path is rooted on both Windows and Linux
186187
var mockFileManager = GetMockFileManager(string.Empty);
187188
var expectedJson = "{\"environment\": \"production\"}";
188-
var absoluteInputPath = Path.Combine("C:", "config", "schedule-input.json");
189+
var absoluteInputPath = Path.Combine(Path.GetTempPath(), "config", "schedule-input.json");
189190
mockFileManager.WriteAllText(absoluteInputPath, expectedJson);
190191

191192
var lambdaFunctionModel = GetLambdaFunctionModel();

0 commit comments

Comments
 (0)