Skip to content

Commit

Permalink
#26: Removed private accessors from UpdateManagerTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Jun 14, 2017
1 parent 4470150 commit 0b723e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/Terminals/Updates/UpdateChecksFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal bool ShouldCheckForUpdate
}
}

private DateTime ReadLastUpdate()
internal DateTime ReadLastUpdate()
{
String text = File.ReadAllText(this.releaseFile).Trim();
DateTime lastUpdate = DateTime.MinValue;
Expand Down
2 changes: 1 addition & 1 deletion Source/Terminals/Updates/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private static ReleaseInfo PerformCheck(bool automaticallyUpdate)
return downLoaded;
}

private static ReleaseInfo CheckForCodeplexRelease(DateTime buildDate)
internal static ReleaseInfo CheckForCodeplexRelease(DateTime buildDate)
{
try
{
Expand Down
8 changes: 3 additions & 5 deletions Source/Tests/UpdateManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ public void TodayCheckedDate_CheckForCodeplexRelease_DoesnotUpdateCheckDate()

private ReleaseInfo RunUpdateCheck()
{
var updateManager = new PrivateType(typeof (UpdateManager));
object releaseInfo = updateManager.InvokeStatic("CheckForCodeplexRelease", new object[] {this.buildDate });
return releaseInfo as ReleaseInfo;
return UpdateManager.CheckForCodeplexRelease(this.buildDate);
}

private void AssertLastUpdateCheck()
Expand All @@ -81,8 +79,8 @@ private void AssertLastUpdateCheck()

private DateTime ParseLastUpdateDate()
{
var checkFileAccessor = new PrivateObject(new UpdateChecksFile());
return (DateTime)checkFileAccessor.Invoke("ReadLastUpdate");
var updateChecksFile = new UpdateChecksFile();
return updateChecksFile.ReadLastUpdate();
}
}
}

0 comments on commit 0b723e9

Please sign in to comment.