Skip to content

Commit

Permalink
Add a console test project
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmada committed Apr 4, 2020
1 parent cbb9d08 commit bf8c313
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
16 changes: 16 additions & 0 deletions ConsoleApp1/ConsoleApp1.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Reactive" Version="4.4.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NetFabric.Hyperlinq\NetFabric.Hyperlinq.csproj" />
</ItemGroup>

</Project>
23 changes: 23 additions & 0 deletions ConsoleApp1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Reactive;
using System.Reactive.Linq;
using System.Threading.Tasks;
using NetFabric.Hyperlinq;

namespace ConsoleApp1
{
class Program
{
static async Task Main()
{
await Test();

Console.WriteLine("Done");
}

public static async Task Test() => _ = await Observable.Range(0, 100)
.AsValueObservable()
.Count()
.Do(value => Console.WriteLine(value));
}
}
6 changes: 6 additions & 0 deletions NetFabric.Hyperlinq.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetFabric.Hyperlinq.Interfa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetFabric.Hyperlinq.Generator", "NetFabric.Hyperlinq.Generator\NetFabric.Hyperlinq.Generator.csproj", "{35400B81-751A-4405-AC01-D9851D6DAE46}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{C0F2C403-B494-464D-8A1C-5826B5BB4EB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -55,6 +57,10 @@ Global
{35400B81-751A-4405-AC01-D9851D6DAE46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35400B81-751A-4405-AC01-D9851D6DAE46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35400B81-751A-4405-AC01-D9851D6DAE46}.Release|Any CPU.Build.0 = Release|Any CPU
{C0F2C403-B494-464D-8A1C-5826B5BB4EB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0F2C403-B494-464D-8A1C-5826B5BB4EB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0F2C403-B494-464D-8A1C-5826B5BB4EB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0F2C403-B494-464D-8A1C-5826B5BB4EB4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace NetFabric.Hyperlinq
{
public static partial class Observable
public static partial class ValueObservable
{
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -25,6 +25,9 @@ public AnonymousValueDisposable<IObservable<TSource>> Subscribe<TObserver>(TObse

IDisposable IObservable<TSource>.Subscribe(IObserver<TSource> observer)
=> source.Subscribe(observer);

public CountObservable<ValueObservableWrapper<TSource>, AnonymousValueDisposable<IObservable<TSource>>, TSource> Count()
=> ValueObservable.Count<ValueObservableWrapper<TSource>, AnonymousValueDisposable<IObservable<TSource>>, TSource>(this);
}
}
}

0 comments on commit bf8c313

Please sign in to comment.