Skip to content

Commit

Permalink
#26: Used fake data instead real call to CodePlex in Updatemanagertest
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Jun 15, 2017
1 parent 86b1dfc commit 79fd33f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Source/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@
<Project>{1f720fd0-21a5-4bed-90f6-02cdabb8854d}</Project>
<Name>Terminals.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Terminals.External\Terminals.External.csproj">
<Project>{FCD4BECA-9923-4BB0-BF57-8E8BCD0F784C}</Project>
<Name>Terminals.External</Name>
</ProjectReference>
<ProjectReference Include="..\Terminals.Plugins.Ica\Terminals.Plugins.Ica.csproj">
<Project>{bb4a4cc7-c449-4f81-8395-7806cc1bdfa8}</Project>
<Name>Terminals.Plugins.Ica</Name>
Expand Down
20 changes: 19 additions & 1 deletion Source/Tests/UpdateManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Terminals.Configuration;
using Terminals.Updates;
using Tests.FilePersisted;
using Unified.Rss;

namespace Tests
{
Expand Down Expand Up @@ -68,10 +69,27 @@ public void TodayCheckedDate_CheckForCodeplexRelease_DoesnotUpdateCheckDate()

private ReleaseInfo RunUpdateCheck()
{
var updateManager = new UpdateManager();
var updateManager = new UpdateManager(this.CreateRss);
return updateManager.CheckForCodeplexRelease(this.buildDate);
}

private RssFeed CreateRss()
{
DateTime currentRelease = new DateTime(2010, 1, 3, 1, 0, 0, DateTimeKind.Utc);

var feed = new RssFeed();
var chanel = new RssChannel();
var release = new RssItem()
{
PubDate = currentRelease,
Title = string.Format("Title ({0})", currentRelease)
};
chanel.Items.Add(release);
feed.Channels.Add(chanel);

return feed;
}

private void AssertLastUpdateCheck()
{
DateTime lastNoticed = this.ParseLastUpdateDate();
Expand Down

0 comments on commit 79fd33f

Please sign in to comment.