File tree Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 7777 verbose : true
7878 - name : Build
7979 run : dotnet pack -c Release
80+
81+ - name : Test against Nuget package from local source
82+ if : inputs.redis_stack_type == 'edge'
83+ working-directory : dogfooding
84+ run : |
85+ mkdir -p test-source
86+ dotnet nuget add source $(readlink -f test-source) -n test-source
87+ find .. -name '*.nupkg' | xargs -I {} dotnet nuget push {} -s test-source
88+ ls -R
89+ dotnet nuget remove source nuget.org
90+ dotnet nuget list source
91+ find . -name '*.csproj' | xargs -I {} sed -E -i 's|<TargetFrameworks(.*)>.*</TargetFrameworks>|<TargetFramework\1>${{inputs.clr_version}}</TargetFramework>|' {}
92+ dotnet restore -s test-source
93+ dotnet run
Original file line number Diff line number Diff line change 1+ using NRedisStack ;
2+ using NRedisStack . Core . DataTypes ;
3+ using StackExchange . Redis ;
4+
5+ public class PackageTest
6+ {
7+ public static void Main ( )
8+ {
9+ ConfigurationOptions configurationOptions = new ConfigurationOptions ( ) ;
10+ configurationOptions . SyncTimeout = 20000 ;
11+ configurationOptions . EndPoints . Add ( "localhost:6379" ) ;
12+ ConnectionMultiplexer redis = ConnectionMultiplexer . Connect ( configurationOptions ) ;
13+
14+ IDatabase db = redis . GetDatabase ( ) ;
15+ db . Execute ( "FLUSHALL" ) ;
16+
17+ // Try a command from StackExchange.
18+ db . SortedSetAdd ( "X" , "foo" , 5.1 ) ;
19+
20+ // And a command from NRedisStack.
21+ var result = db . BZMPop ( 0 , "X" , MinMaxModifier . Min ) ;
22+ Assert ( 1 == result ! . Item2 . Count ) ;
23+ Assert ( "foo" == result ! . Item2 [ 0 ] . Value ) ;
24+
25+ Console . WriteLine ( "All good." ) ;
26+ }
27+
28+ /// <summary>
29+ /// Poor Man's assert, since we don't want to depend on NUnit.
30+ /// </summary>
31+ private static void Assert ( bool condition )
32+ {
33+ if ( ! condition )
34+ {
35+ throw new System . Exception ( ) ;
36+ }
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >Exe</OutputType >
5+ <TargetFrameworks >netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks >
6+ <ImplicitUsings >enable</ImplicitUsings >
7+ <Nullable >enable</Nullable >
8+ </PropertyGroup >
9+
10+ <ItemGroup >
11+ <PackageReference Include =" NRedisStack" Version =" *" />
12+ </ItemGroup >
13+
14+ </Project >
You can’t perform that action at this time.
0 commit comments