Skip to content

Commit

Permalink
Merge pull request #66 from jimitndiaye/master
Browse files Browse the repository at this point in the history
ReactiveUI.Sample does not compile
  • Loading branch information
Paul Betts committed Jun 7, 2012
2 parents c877d36 + 6b0a7dc commit 58b6dc2
Show file tree
Hide file tree
Showing 13 changed files with 184 additions and 61 deletions.
Expand Up @@ -34,18 +34,15 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Reactive.Testing">
<HintPath>..\..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="ReactiveUI">
<HintPath>..\ext\ReactiveUI.dll</HintPath>
</Reference>
<Reference Include="ReactiveUI.Blend">
<HintPath>..\ext\ReactiveUI.Blend.dll</HintPath>
</Reference>
<Reference Include="ReactiveUI.Xaml">
<HintPath>..\ext\ReactiveUI.Xaml.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core">
Expand All @@ -54,10 +51,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Reactive">
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Reactive.Testing">
<HintPath>..\ext\Microsoft.Reactive.Testing.dll</HintPath>
<HintPath>..\..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
Expand All @@ -74,11 +68,31 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ReactiveUI.Blend\ReactiveUI.Blend.csproj">
<Project>{3870ea63-afdf-4d49-b4d6-8299506e67b4}</Project>
<Name>ReactiveUI.Blend</Name>
</ProjectReference>
<ProjectReference Include="..\..\ReactiveUI.Testing\ReactiveUI.Testing.csproj">
<Project>{e1f2ad19-276e-4d05-a41a-89aa133cecfc}</Project>
<Name>ReactiveUI.Testing</Name>
</ProjectReference>
<ProjectReference Include="..\..\ReactiveUI.Xaml\ReactiveUI.Xaml.csproj">
<Project>{761ac9ba-4a9c-440c-9b6c-2569978f0610}</Project>
<Name>ReactiveUI.Xaml</Name>
</ProjectReference>
<ProjectReference Include="..\..\ReactiveUI\ReactiveUI.csproj">
<Project>{292a477b-bb94-43c1-984e-e177ef9fedb7}</Project>
<Name>ReactiveUI</Name>
</ProjectReference>
<ProjectReference Include="..\ReactiveUI.Sample\ReactiveUI.Sample.csproj">
<Project>{9311DEA0-E55B-422E-8781-A69AB05316AC}</Project>
<Project>{9311dea0-e55b-422e-8781-a69ab05316ac}</Project>
<Name>ReactiveUI.Sample</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- 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.
Expand All @@ -87,4 +101,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Expand Up @@ -74,11 +74,11 @@ public void TimerShouldFinishAfterThirtyMinutes()
fixture.Start.Execute(null);
// Fast forward to 25 minutes in, the timer should *not* be done
sched.RunToMilliseconds(24 * 60 * 1000);
sched.AdvanceByMs(24 * 60 * 1000);
Assert.IsFalse(isTimerStateDone);
// Let's go to 31 minutes
sched.RunToMilliseconds(35 * 60 * 1000);
sched.AdvanceByMs(35 * 60 * 1000);
// Make sure our model duration took 30 minutes(ish)
var pomodoroLength = (fixture.Model.EndedAt.Value - fixture.Model.StartedAt.Value);
Expand All @@ -103,7 +103,7 @@ public void MakeSureWeAreInBreakMode()
fixture.Start.Execute(null);
// After 26 minutes, we should be in our 5-minute break
sched.RunToMilliseconds(26 * 60 * 1000);
sched.AdvanceByMs(26 * 60 * 1000);
fixture.TimeRemaining.TotalMinutes.AssertWithinEpsilonOf(4.0);
Assert.AreEqual(BlockTimerViewState.StartedInBreak, lastState);
Assert.IsFalse(isTimerStateDone);
Expand All @@ -126,27 +126,27 @@ public void TheTimerDoesntAdvanceWhenItIsPaused()
fixture.Start.Execute(null);
// Five minutes in, hit the pause button
sched.RunToMilliseconds(5 * 60 * 1000);
sched.AdvanceByMs(5 * 60 * 1000);
var timeRemaining = fixture.TimeRemaining;
fixture.Pause.Execute(null);
// Fast forward ten more minutes - since we're paused, we
// TimeRemaining shouldn'tve moved
sched.RunToMilliseconds(10 * 60 * 1000);
sched.AdvanceByMs(10 * 60 * 1000);
Assert.AreEqual((int)timeRemaining.TotalMinutes, (int)fixture.TimeRemaining.TotalMinutes);
fixture.Start.Execute(null);
// Make sure the TimeRemaining has only advanced 1 minute since
// we resumed (i.e. we shouldn't count paused time as working)
sched.RunToMilliseconds(11 * 60 * 1000);
sched.AdvanceByMs(11 * 60 * 1000);
// We should have one pause, and it should be 5 minutes long
Assert.AreEqual(1, fixture.Model.PauseList.Count);
var deltaTime = (fixture.Model.PauseList[0].EndedAt - fixture.Model.PauseList[0].StartedAt).TotalMinutes;
this.Log().InfoFormat("Pause Time: {0} mins", deltaTime);
this.Log().Info("Pause Time: {0} mins", deltaTime);
deltaTime.AssertWithinEpsilonOf(5.0);
Expand All @@ -169,24 +169,24 @@ public void ProgressBarValueIsAccurate()
fixture.Start.Execute(null);
// At the beginning we should be zero
sched.RunToMilliseconds(10);
sched.AdvanceByMs(10);
lastPercentage.AssertWithinEpsilonOf(0.0);
// Run to exactly half of the work time 25 mins / 2
sched.RunToMilliseconds((12 * 60 + 30) * 1000);
sched.AdvanceByMs((12 * 60 + 30) * 1000);
lastPercentage.AssertWithinEpsilonOf(0.5);
// Run to a little before the end, should be near 1.0
sched.RunToMilliseconds(25 * 60 * 1000 - 10);
sched.AdvanceByMs(25 * 60 * 1000 - 10);
lastPercentage.AssertWithinEpsilonOf(1.0);
// Step to the beginning of the break, we should've moved back
// to zero
sched.RunToMilliseconds(25 * 60 * 1000 + 1010);
sched.AdvanceByMs(25 * 60 * 1000 + 1010);
lastPercentage.AssertWithinEpsilonOf(0.0);
// Finally run to the end of the break
sched.RunToMilliseconds(30 * 60 * 1000 - 10);
sched.AdvanceByMs(30 * 60 * 1000 - 10);
lastPercentage.AssertWithinEpsilonOf(1.0);
});
}
Expand All @@ -203,27 +203,27 @@ public void ProgressBarShouldntMoveDuringAPause()
fixture.Start.Execute(null);
// At the beginning we should be zero
sched.RunToMilliseconds(10);
sched.AdvanceByMs(10);
lastPercentage.AssertWithinEpsilonOf(0.0);
// Run to exactly half of the work time 25 mins / 2
sched.RunToMilliseconds((12 * 60 + 30) * 1000);
sched.AdvanceByMs((12 * 60 + 30) * 1000);
lastPercentage.AssertWithinEpsilonOf(0.5);
// Simulate hitting the Pause button
fixture.Pause.Execute(null);
// Run to 20 minutes; the progress bar shouldn't have moved
// since we were paused
sched.RunToMilliseconds(20 * 60 * 1000);
sched.AdvanceByMs(20 * 60 * 1000);
lastPercentage.AssertWithinEpsilonOf(0.5);
fixture.Start.Execute(null);
// Move to 25 minutes; the progress bar should've moved 5
// minutes worth (remember, since we were paused from 12min
// to 20min
sched.RunToMilliseconds(25 * 60 * 1000);
sched.AdvanceByMs(25 * 60 * 1000);
lastPercentage.AssertWithinEpsilonOf(0.5 + 0.2);
});
}
Expand All @@ -239,15 +239,15 @@ public void CancelButtonShouldntEndUpSettingModel()
fixture.Start.Execute(null);
sched.RunToMilliseconds(10);
sched.AdvanceByMs(10);
Assert.AreEqual(BlockTimerViewState.Started, lastState);
// Run to 10 minutes in and hit Cancel
sched.RunToMilliseconds(10 * 60 * 1000);
sched.AdvanceByMs(10 * 60 * 1000);
fixture.Cancel.Execute(null);
// Run way past the end
sched.RunToMilliseconds(60 * 60 * 1000);
sched.AdvanceByMs(60 * 60 * 1000);
Assert.AreEqual(BlockTimerViewState.ShouldCancel, lastState);
Assert.IsFalse(fixture.Model.IsObjectValid());
});
Expand Down
11 changes: 11 additions & 0 deletions ReactiveUI.Sample/ReactiveUI.Sample.Tests/app.config
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Reactive" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.11111.0" newVersion="1.1.11111.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
4 changes: 4 additions & 0 deletions ReactiveUI.Sample/ReactiveUI.Sample.Tests/packages.config
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="2.0.0.2000" />
</packages>
73 changes: 61 additions & 12 deletions ReactiveUI.Sample/ReactiveUI.Sample.sln
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 11
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Sample", "ReactiveUI.Sample\ReactiveUI.Sample.csproj", "{9311DEA0-E55B-422E-8781-A69AB05316AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Sample.Tests", "ReactiveUI.Sample.Tests\ReactiveUI.Sample.Tests.csproj", "{59C58E7E-779A-46EF-A710-413723566CC0}"
Expand All @@ -12,6 +12,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Blend", "..\ReactiveUI.Blend\ReactiveUI.Blend.csproj", "{3870EA63-AFDF-4D49-B4D6-8299506E67B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI", "..\ReactiveUI\ReactiveUI.csproj", "{292A477B-BB94-43C1-984E-E177EF9FEDB7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Testing", "..\ReactiveUI.Testing\ReactiveUI.Testing.csproj", "{E1F2AD19-276E-4D05-A41A-89AA133CECFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Xaml", "..\ReactiveUI.Xaml\ReactiveUI.Xaml.csproj", "{761AC9BA-4A9C-440C-9B6C-2569978F0610}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = ReactiveUI.Sample.vsmdi
Expand All @@ -25,16 +33,26 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Any CPU.ActiveCfg = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Mixed Platforms.Build.0 = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|x86.ActiveCfg = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|x86.Build.0 = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|Any CPU.ActiveCfg = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|Mixed Platforms.ActiveCfg = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|Mixed Platforms.Build.0 = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|x86.ActiveCfg = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|x86.Build.0 = Release|x86
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Debug|x86.ActiveCfg = Debug|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Release|Any CPU.Build.0 = Release|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{292A477B-BB94-43C1-984E-E177EF9FEDB7}.Release|x86.ActiveCfg = Release|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Debug|x86.ActiveCfg = Debug|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Release|Any CPU.Build.0 = Release|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3870EA63-AFDF-4D49-B4D6-8299506E67B4}.Release|x86.ActiveCfg = Release|Any CPU
{59C58E7E-779A-46EF-A710-413723566CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59C58E7E-779A-46EF-A710-413723566CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59C58E7E-779A-46EF-A710-413723566CC0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -45,6 +63,37 @@ Global
{59C58E7E-779A-46EF-A710-413723566CC0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{59C58E7E-779A-46EF-A710-413723566CC0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{59C58E7E-779A-46EF-A710-413723566CC0}.Release|x86.ActiveCfg = Release|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Debug|x86.ActiveCfg = Debug|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Release|Any CPU.Build.0 = Release|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{761AC9BA-4A9C-440C-9B6C-2569978F0610}.Release|x86.ActiveCfg = Release|Any CPU
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|x86.ActiveCfg = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Debug|x86.Build.0 = Debug|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|Any CPU.ActiveCfg = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|Mixed Platforms.ActiveCfg = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|Mixed Platforms.Build.0 = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|x86.ActiveCfg = Release|x86
{9311DEA0-E55B-422E-8781-A69AB05316AC}.Release|x86.Build.0 = Release|x86
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Debug|x86.ActiveCfg = Debug|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Release|Any CPU.Build.0 = Release|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E1F2AD19-276E-4D05-A41A-89AA133CECFC}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions ReactiveUI.Sample/ReactiveUI.Sample/App.xaml
Expand Up @@ -9,6 +9,8 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="MetroTheme/CoreStyles.xaml" />
<ResourceDictionary Source="MetroTheme/Styles.xaml" />
<ResourceDictionary Source="MetroTheme/Fonts.xaml"/>
<ResourceDictionary Source="MetroTheme/Brushes.xaml"/>
</ResourceDictionary.MergedDictionaries>

<SampleData:SampleAppViewModel x:Key="SampleAppViewModel" d:IsDataSource="True"/>
Expand Down
1 change: 0 additions & 1 deletion ReactiveUI.Sample/ReactiveUI.Sample/MetroTheme/Fonts.xaml
@@ -1,7 +1,6 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:my="clr-namespace:System;assembly=mscorlib" >

<ResourceDictionary.MergedDictionaries>
Expand Down
Expand Up @@ -11,7 +11,7 @@ public static TimeSpan DurationOfPauses(this BlockItem This)
{
var ret = This.PauseList.Aggregate(TimeSpan.Zero,
(acc, x) => acc + (x.EndedAt - x.StartedAt));
This.Log().InfoFormat("Pause duration: {0}", ret);
This.Log().Info("Pause duration: {0}", ret);
return ret;
}
}
Expand Down

0 comments on commit 58b6dc2

Please sign in to comment.