Skip to content

Commit

Permalink
Cherry pick branch 'genexuslabs:storage-unittest-localstack' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiamurialdo authored and Beta Bot committed Jan 8, 2025
1 parent 9824d05 commit 9e2c7c2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 26 deletions.
1 change: 1 addition & 0 deletions dotnet/test/DotNetCoreUnitTest/DotNetCoreUnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<ItemGroup>
<Compile Include="..\DotNetUnitTest\ImageUtils\ImageUtilTest.cs" Link="ImageUtils\ImageUtilTest.cs" />
<Compile Include="..\DotNetUnitTest\StringUtil\StringUtilTests.cs" Link="StringUtil\StringUtilTests.cs" />
<Compile Include="..\DotNetUnitTest\WindowOnlyFact.cs" Link="WindowOnlyFact.cs" />

</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion dotnet/test/DotNetUnitTest/Domain/GxHttpClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using DotNetUnitTest;
using GeneXus.Application;
using GeneXus.Http.Client;
using Xunit;
Expand Down Expand Up @@ -60,7 +61,7 @@ public void HttpClientInvalidURLWithCustomPort()
}
}

[Fact]
[WindowsOnlyFact]

Check failure on line 64 in dotnet/test/DotNetUnitTest/Domain/GxHttpClientTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFactAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 64 in dotnet/test/DotNetUnitTest/Domain/GxHttpClientTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFact' could not be found (are you missing a using directive or an assembly reference?)
public void HttpClientCookieHeader()
{
string headerValue = "CognitoIdentityServiceProvider.3tgmin25m9bkg6vgi7vpavu7a9.M00000936.refreshToken=eyJjdHkiOiJKV1QiLCJlbmMiSkRCAmMpYqndvORnWLTfHw; CognitoIdentityServiceProvider.3tgmin25m9bkg6vgi7vpavu7a9.LastAuthUser=M00000936";
Expand Down
26 changes: 5 additions & 21 deletions dotnet/test/DotNetUnitTest/Domain/ShellTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.IO;
using System.Runtime.InteropServices;
using DotNetUnitTest;
using GeneXus.Utils;
using Xunit;

Expand All @@ -8,52 +8,36 @@ namespace xUnitTesting

public class ShellTest
{
[Fact]
[WindowsOnlyFact]

Check failure on line 11 in dotnet/test/DotNetUnitTest/Domain/ShellTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFactAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 11 in dotnet/test/DotNetUnitTest/Domain/ShellTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFact' could not be found (are you missing a using directive or an assembly reference?)
public void ExecutableTest()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return; // Skip test on non-Windows platforms
}
string fileName = "hello.bat";
File.WriteAllText(fileName, "echo \"hello %1\"");
int errorCode = GXUtil.Shell($"{fileName} test", 1, 1);
Assert.Equal(0, errorCode);
}
[Fact]
[WindowsOnlyFact]

Check failure on line 19 in dotnet/test/DotNetUnitTest/Domain/ShellTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFactAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 19 in dotnet/test/DotNetUnitTest/Domain/ShellTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFact' could not be found (are you missing a using directive or an assembly reference?)
public void ExecutableWithSpacesTest()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return; // Skip test on non-Windows platforms
}
string fileName = "hello world.bat";
File.WriteAllText(fileName, "echo \"hello %1\"");
int errorCode = GXUtil.Shell($"'{fileName}' test", 1, 1);
Assert.Equal(0, errorCode);
}

[Fact]
[WindowsOnlyFact]

Check failure on line 28 in dotnet/test/DotNetUnitTest/Domain/ShellTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFactAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 28 in dotnet/test/DotNetUnitTest/Domain/ShellTest.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFact' could not be found (are you missing a using directive or an assembly reference?)
public void WorkingDirWithSpacesTest()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return; // Skip test on non-Windows platforms
}
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "my dir", "hello world.bat");
FileInfo fi = new FileInfo(fileName);
Directory.CreateDirectory(fi.DirectoryName);
File.WriteAllText(fileName, "echo \"hello %1\"");
int errorCode = GXUtil.Shell($"'{fileName}' test", 1, 1);
Assert.Equal(0, errorCode);
}
[Fact]
[WindowsOnlyFact]
public void WorkingDirForFullQualifiedBat()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return; // Skip test on non-Windows platforms
}
string pathName = Directory.GetParent(Directory.GetCurrentDirectory()).FullName; //bat is in a different directory to the current dir
string fileName = Path.Combine(pathName, "TestCurrentDir.bat");
string outputFileName = Path.Combine(Directory.GetCurrentDirectory(), "output.txt"); //Current dir of the process must be the main current dir
Expand Down
7 changes: 4 additions & 3 deletions dotnet/test/DotNetUnitTest/FileIO/FileIOTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using DotNetUnitTest;
using GeneXus.Configuration;
using GeneXus.Printer;
using GeneXus.Services;
Expand All @@ -16,7 +17,7 @@ public FileIOTests()
Config.ConfigFileName = Path.Combine(BaseDir, "client.exe.config");
#endif
}
[Fact]
[WindowsOnlyFact]

Check failure on line 20 in dotnet/test/DotNetUnitTest/FileIO/FileIOTests.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFactAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 20 in dotnet/test/DotNetUnitTest/FileIO/FileIOTests.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'WindowsOnlyFact' could not be found (are you missing a using directive or an assembly reference?)
public void FileSharedToCopy()
{
string target = @"\\192.168.86.3\printer";
Expand All @@ -26,7 +27,7 @@ public void FileSharedToCopy()
Assert.Equal(-1, f.ErrCode);
Assert.NotEqual(new NullReferenceException().Message, f.ErrDescription);
}
[Fact]
[WindowsOnlyFact]
public void FileSourceTest()
{
GxFileInfo fi = new GxFileInfo(string.Empty);
Expand Down Expand Up @@ -101,7 +102,7 @@ public void GXDBFilePathTest()
}
}

[Fact]
[WindowsOnlyFact]
public void PathUtilGetValidFileName()
{
string path = "file:///C:/Models/Upload/CSharpModel/web/PublicTempStorage/multimedia/Screen%20Shot%202016-02-15%20at%2011.41.55%20AM_ff107a3ba9fb4564bb4e1bf7f74d5fbf.png";
Expand Down
3 changes: 2 additions & 1 deletion dotnet/test/DotNetUnitTest/PDF/PDFTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using System.Threading.Tasks;
using com.genexus.reports;
using DotNetUnitTest;
using GeneXus.Programs;
using GeneXus.Utils;
using Xunit;
Expand All @@ -27,7 +28,7 @@ public void ConcurrencyPDFSearchPaths()
});

}
[Fact]
[WindowsOnlyFact]
public void ExtractTextFromPDF()
{
string text = DocumentHandler.GetText("sample.pdf", "pdf");
Expand Down

0 comments on commit 9e2c7c2

Please sign in to comment.