Skip to content
Snippets Groups Projects
Commit fb592ace authored by Stanley Goldman's avatar Stanley Goldman
Browse files

Last checks

parent bfd6ee94
No related branches found
No related tags found
No related merge requests found
using System;
using GitHub.Unity;
namespace IntegrationTests
{
class TestUIDispatcher : BaseUIDispatcher
{
private readonly Func<bool> callback;
public TestUIDispatcher(Func<bool> callback = null) : base()
{
this.callback = callback;
}
protected override void Run(Action<bool> onClose)
{
bool ret = true;
if (callback != null)
{
ret = callback();
}
onClose(ret);
base.Run(onClose);
}
}
}
\ No newline at end of file
......@@ -76,6 +76,7 @@
<Compile Include="BaseIntegrationTest.cs" />
<Compile Include="Helpers\Args.cs" />
<Compile Include="Watches\FileSystemWatcherTests.cs" />
<Compile Include="Helpers\TestUIDispatcher.cs" />
<None Include="Watches\WindowsLinuxFileSystemWatchTests.cs" />
<None Include="Watches\AdaptiveFileSystemWatchTests.cs" />
<None Include="Watches\FileSystemWatcherIntegrationTests.cs" />
......
using GitHub.Unity;
using NSubstitute;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace IntegrationTests
{
class TestUIDispatcher : BaseUIDispatcher
{
private readonly Func<bool> callback;
public TestUIDispatcher(Func<bool> callback = null) : base()
{
this.callback = callback;
}
protected override void Run(Action<bool> onClose)
{
bool ret = true;
if (callback != null)
{
ret = callback();
}
onClose(ret);
base.Run(onClose);
}
}
[TestFixture]
class FileSystemWatcherTests : BaseIntegrationTest
{
......@@ -71,8 +43,6 @@ namespace IntegrationTests
[Test]
public void WatchesAFile()
{
var expected = 9;
var createdCount = 0;
var changedCount = 0;
var renamedCount = 0;
......@@ -113,6 +83,9 @@ namespace IntegrationTests
//http://stackoverflow.com/questions/1764809/filesystemwatcher-changed-event-is-raised-twice
Assert.AreEqual(2, changedCount);
Assert.AreEqual(0, createdCount);
Assert.AreEqual(0, renamedCount);
Assert.AreEqual(0, deletedCount);
watcher.Dispose();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment