From 44742090d3b143bfe211f3ae4dc85ee5164628be Mon Sep 17 00:00:00 2001 From: Dor Date: Fri, 5 Jul 2019 15:44:19 -0700 Subject: [PATCH] Styling (#255) --- .../Php/PhpLanguageDetectorTest.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/BuildScriptGenerator.Tests/Php/PhpLanguageDetectorTest.cs b/tests/BuildScriptGenerator.Tests/Php/PhpLanguageDetectorTest.cs index aa70e1151e..51a58e04c8 100644 --- a/tests/BuildScriptGenerator.Tests/Php/PhpLanguageDetectorTest.cs +++ b/tests/BuildScriptGenerator.Tests/Php/PhpLanguageDetectorTest.cs @@ -8,6 +8,7 @@ using Microsoft.Extensions.Options; using Microsoft.Oryx.BuildScriptGenerator.Exceptions; using Microsoft.Oryx.BuildScriptGenerator.Php; +using Microsoft.Oryx.Common; using Microsoft.Oryx.Tests.Common; using Xunit; @@ -26,7 +27,7 @@ public PhpLanguageDetectorTest(TestTempDirTestFixture testFixture) public void Detect_ReturnsNull_WhenSourceDirectoryIsEmpty() { // Arrange - var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { Common.PhpVersions.Php73Version }); + var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { PhpVersions.Php73Version }); var repo = new MemorySourceRepo(); // No files in source repo // Act @@ -40,7 +41,7 @@ public void Detect_ReturnsNull_WhenSourceDirectoryIsEmpty() public void Detect_ReutrnsNull_WhenComposerFileDoesNotExist() { // Arrange - var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { Common.PhpVersions.Php73Version }); + var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { PhpVersions.Php73Version }); var repo = new MemorySourceRepo(); repo.AddFile("foo.php content", "foo.php"); @@ -55,14 +56,15 @@ public void Detect_ReutrnsNull_WhenComposerFileDoesNotExist() public void Detect_Throws_WhenUnsupportedPhpVersion_FoundInComposerFile() { // Arrange - var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { Common.PhpVersions.Php73Version }); + var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { PhpVersions.Php73Version }); var repo = new MemorySourceRepo(); - repo.AddFile("{\"require\":{\"php\":\"0\"}}", PhpConstants.ComposerFileName); + var version = "0"; + repo.AddFile("{\"require\":{\"php\":\"" + version + "\"}}", PhpConstants.ComposerFileName); // Act & Assert var exception = Assert.Throws(() => detector.Detect(repo)); Assert.Equal( - $"Platform 'php' version '0' is unsupported. Supported versions: {Common.PhpVersions.Php73Version}", + $"Platform 'php' version '{version}' is unsupported. Supported versions: {PhpVersions.Php73Version}", exception.Message); } @@ -72,7 +74,7 @@ public void Detect_Throws_WhenUnsupportedPhpVersion_FoundInComposerFile() public void Detect_ReturnsResult_WithPhpDefaultRuntimeVersion_WithComposerFile(string composerFileContent) { // Arrange - var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { Common.PhpVersions.Php73Version }); + var detector = CreatePhpLanguageDetector(supportedPhpVersions: new[] { PhpVersions.Php73Version }); var repo = new MemorySourceRepo(); repo.AddFile(composerFileContent, PhpConstants.ComposerFileName); repo.AddFile("", "foo.php"); @@ -83,7 +85,7 @@ public void Detect_ReturnsResult_WithPhpDefaultRuntimeVersion_WithComposerFile(s // Assert Assert.NotNull(result); Assert.Equal(PhpConstants.PhpName, result.Language); - Assert.Equal(Common.PhpVersions.Php73Version, result.LanguageVersion); + Assert.Equal(PhpVersions.Php73Version, result.LanguageVersion); } private PhpLanguageDetector CreatePhpLanguageDetector(string[] supportedPhpVersions)