mirror of
https://github.com/Cysharp/R3.git
synced 2026-10-22 09:21:41 +08:00
27 lines
624 B
C#
27 lines
624 B
C#
using Microsoft.Extensions.Time.Testing;
|
|
|
|
namespace R3.Tests.FactoryTests;
|
|
|
|
public class EmptyTest
|
|
{
|
|
[Fact]
|
|
public void Empty()
|
|
{
|
|
using var list = Observable.Empty<int>().ToLiveList();
|
|
list.AssertIsCompleted();
|
|
}
|
|
|
|
[Fact]
|
|
public void EmptyWithTime()
|
|
{
|
|
var fakeTime = new FakeTimeProvider();
|
|
using var list = Observable.Empty<int>(TimeSpan.FromSeconds(5), fakeTime).ToLiveList();
|
|
|
|
fakeTime.Advance(TimeSpan.FromSeconds(4));
|
|
list.AssertIsNotCompleted();
|
|
|
|
fakeTime.Advance(TimeSpan.FromSeconds(1));
|
|
list.AssertIsCompleted();
|
|
}
|
|
}
|