Skip to content

Commit

Permalink
#25 Get all objects and refactor mock provider
Browse files Browse the repository at this point in the history
RealmWinOnly.sln
- add DebugMock configuration

Realm.sln
- added DebugMock configuration for all as copy of Debug

CoreProvider.cs
- copied to common CoreProvider.shared.cs

Interop.Win32.csproj
Interop.XamrainAndroid.csproj
Interop.XamarinIOS.csproj
Interop.XamarinMac.csproj
- linked in CoreProviderFactory.shared.cs
- removed its own CoreProvider.cs
- linked in CoreProvider.shared.cs

RealmNet.Tests.csproj
- linked in CoreProviderFactory.shared.cs
- added DebugMock configuration for AnyCPU defining MOCKING_CONFIG
- discard TestHelpers\CoreProviderStub.cs (temporarily)

CoreProviderFactory.shared.cs
- added file

WeaverTests.cs
- removed using clause for Tests.TestHelpers
- remove coreProviderStub_ to use ProviderFactory instead
- commented out asserts checking the coreProvierStub because mock will be evaluated differently

QueryTests.cs
- comment out for now as expects queryProviderStub to implement different interface
  • Loading branch information
AndyDentFree committed Jul 27, 2015
1 parent db919c4 commit d3f9acf
Show file tree
Hide file tree
Showing 20 changed files with 826 additions and 841 deletions.
File renamed without changes.
26 changes: 26 additions & 0 deletions realm/Interop/CoreProviderFactory.shared.cs
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using InteropShared;
using RealmNet;
using RealmNet.Interop;

namespace Interop.Providers
{
// Helper that returns MockCoreProvider when build using the DebugMock config
public static class ProviderFactory
{
public static ICoreProvider Make()
{
#if MOCKING_CONFIG
return new MockCoreProvider();
#else
return new Interop.Providers.CoreProvider();
#endif
}
}
}


22 changes: 19 additions & 3 deletions realm/Interop/Interop.Win32/Interop.Win32.csproj 100755 → 100644
Expand Up @@ -31,6 +31,17 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugMock|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugMock\</OutputPath>
<DefineConstants>TRACE;DEBUG;MOCKING_CONFIG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -42,6 +53,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CoreProvider.shared.cs">
<Link>CoreProvider.shared.cs</Link>
</Compile>
<Compile Include="..\CoreProviderFactory.shared.cs">
<Link>CoreProviderFactory.shared.cs</Link>
</Compile>
<Compile Include="..\GroupHandle.shared.cs">
<Link>GroupHandle.shared.cs</Link>
</Compile>
Expand Down Expand Up @@ -72,17 +89,16 @@
<Compile Include="..\UnsafeNativeMethods.shared.cs">
<Link>UnsafeNativeMethods.shared.cs</Link>
</Compile>
<Compile Include="CoreProvider.cs" />
<Compile Include="InteropConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\RealmNet\RealmNet.csproj">
<Project>{2494214e-6005-4eb9-ad2c-1d4bcd7b0223}</Project>
<Project>{2494214E-6005-4EB9-AD2C-1D4BCD7B0223}</Project>
<Name>RealmNet</Name>
</ProjectReference>
<ProjectReference Include="..\InteropShared\InteropShared.csproj">
<Project>{8b451911-321f-4244-9999-c1678bed060d}</Project>
<Project>{8B451911-321F-4244-9999-C1678BED060D}</Project>
<Name>InteropShared</Name>
</ProjectReference>
</ItemGroup>
Expand Down
142 changes: 0 additions & 142 deletions realm/Interop/Interop.XamarinAndroid/CoreProvider.cs

This file was deleted.

Expand Up @@ -32,6 +32,15 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMock|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;MOCKING_CONFIG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
Expand All @@ -41,6 +50,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CoreProvider.shared.cs">
<Link>CoreProvider.shared.cs</Link>
</Compile>
<Compile Include="..\CoreProviderFactory.shared.cs">
<Link>CoreProviderFactory.shared.cs</Link>
</Compile>
<Compile Include="..\GroupHandle.shared.cs">
<Link>GroupHandle.shared.cs</Link>
</Compile>
Expand Down Expand Up @@ -68,7 +83,6 @@
<Compile Include="..\UnsafeNativeMethods.shared.cs">
<Link>UnsafeNativeMethods.shared.cs</Link>
</Compile>
<Compile Include="CoreProvider.cs" />
<Compile Include="InteropConfig.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
20 changes: 10 additions & 10 deletions realm/Interop/Interop.XamarinAndroid/Resources/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3f9acf

Please sign in to comment.