Skip to content

Commit

Permalink
New Async API, net45, Sample WebApi App
Browse files Browse the repository at this point in the history
* Upgrade net45, fluent assertions, VS, version rev

* Add badges

* Expose  inner object cache

* Add GetOrAddAsync api

* Upgrade nunit to 3.4.1

* Lots of async tests

* Add GetAsync method

* upgrade nuget restore and use appveyor to pack not msbuild

* Remove packages and restore on build

* Add a sample web app to demonstrate async caching

* Update docs
  • Loading branch information
alastairtree authored Sep 10, 2016
1 parent 36240d9 commit 57618d7
Show file tree
Hide file tree
Showing 51 changed files with 1,185 additions and 54,033 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,6 @@ Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

packages/
.vs/
6 changes: 0 additions & 6 deletions .nuget/NuGet.Config

This file was deleted.

Binary file removed .nuget/NuGet.exe
Binary file not shown.
144 changes: 0 additions & 144 deletions .nuget/NuGet.targets

This file was deleted.

25 changes: 25 additions & 0 deletions LazyCache.UnitTests/AsyncHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LazyCache.UnitTests
{
public static class AsyncHelper
{
public static Task<T> CreateCancelledTask<T>()
{
var tcs = new TaskCompletionSource<T>();
tcs.SetCanceled();
return tcs.Task;
}

public static Task<T> CreateTaskWithException<T, TException>() where TException : Exception
{
var tcs = new TaskCompletionSource<T>();
tcs.SetException(Activator.CreateInstance<TException>());
return tcs.Task;
}
}
}
35 changes: 18 additions & 17 deletions LazyCache.UnitTests/LazyCache.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LazyCache.UnitTests</RootNamespace>
<AssemblyName>LazyCache.UnitTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -30,14 +31,20 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions">
<HintPath>..\packages\FluentAssertions.2.2.0.0\lib\net40\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -49,12 +56,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AsyncHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServiceCacheTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LazyCache\LazyCache.csproj">
<Project>{E6A1EF20-94AD-4A1C-9A89-3B2FA8AD8EC7}</Project>
Expand All @@ -64,14 +69,10 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Loading

0 comments on commit 57618d7

Please sign in to comment.