Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
tmat committed Apr 7, 2023
commit f1f7383705075d006196185836c9d3e86b4f596f
19 changes: 12 additions & 7 deletions src/SourceLink.Common.UnitTests/GenerateSourceLinkFileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ public void Empty(bool noWarning)

Assert.True(task.Execute());

AssertEx.AssertEqualToleratingWhitespaceDifferences(
noWarning ? "" : "WARNING : " + string.Format(Resources.SourceControlInformationIsNotAvailableGeneratedSourceLinkEmpty),
engine.Log);
var expectedOutput =
(noWarning ? "" : "WARNING : " + string.Format(Resources.SourceControlInformationIsNotAvailableGeneratedSourceLinkEmpty) + Environment.NewLine) +
string.Format(Resources.SourceLinkEmptyNoExistingFile, sourceLinkFilePath);

AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedOutput, engine.Log);

Assert.Null(task.SourceLink);
Assert.Null(task.FileWrite);
Expand Down Expand Up @@ -64,9 +66,11 @@ public void NoRepositoryUrl(bool noWarning)

Assert.True(task.Execute());

AssertEx.AssertEqualToleratingWhitespaceDifferences(
noWarning ? "" : "WARNING : " + string.Format(Resources.SourceControlInformationIsNotAvailableGeneratedSourceLinkEmpty),
engine.Log);
var expectedOutput =
(noWarning ? "" : "WARNING : " + string.Format(Resources.SourceControlInformationIsNotAvailableGeneratedSourceLinkEmpty) + Environment.NewLine) +
string.Format(Resources.SourceLinkEmptyNoExistingFile, sourceLinkFilePath);

AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedOutput, engine.Log);

Assert.Null(task.SourceLink);
Assert.Null(task.FileWrite);
Expand All @@ -92,7 +96,8 @@ public void Empty_DeleteExistingFile()

Assert.True(task.Execute());

AssertEx.AssertEqualToleratingWhitespaceDifferences("", engine.Log);
AssertEx.AssertEqualToleratingWhitespaceDifferences(
string.Format(Resources.SourceLinkEmptyDeletingExistingFile, sourceLinkFile.Path), engine.Log);

Assert.Null(task.SourceLink);
Assert.Equal(sourceLinkFile.Path, task.FileWrite);
Expand Down