Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real committed Apr 25, 2020
1 parent 2a53811 commit 88150ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 0 additions & 11 deletions tests/NetDaemon.Daemon.Tests/Demon/NetDaemonHostTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,6 @@ public void RunNullReferenceToHassClientShouldThrowException()
{ var DefaultDaemonHost = new NetDaemonHost(null, null); });
}

[Fact]
public async Task RunWhenCanceledShouldCompleteWithCanceledException()
{
// ARRANGE

// ACT and ASSERT
await RunDefauldDaemonUntilCanceled(20);

Assert.False(DefaultDaemonHost.Connected);
}

[Fact]
public async Task SendEventShouldCallCorrectMethod()
{
Expand Down
3 changes: 3 additions & 0 deletions tests/NetDaemon.Daemon.Tests/HassClientMock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public HassClientMock()
Setup(x => x.ReadEventAsync())
.ReturnsAsync(() => { return FakeEvents.TryDequeue(out var ev) ? ev : null; });

Setup(x => x.ReadEventAsync(It.IsAny<CancellationToken>()))
.ReturnsAsync(() => { return FakeEvents.TryDequeue(out var ev) ? ev : null; });

Setup(x => x.SetState(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<object?>())).Returns<string, string, object>(
(entityId, state, attributes) =>
{
Expand Down

0 comments on commit 88150ac

Please sign in to comment.