Skip to content

Commit

Permalink
LiveList.CompletedValue -> .Result
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Jan 3, 2024
1 parent 4a6e1c1 commit 3ca76bb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/R3/LiveList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed class LiveList<T> : IReadOnlyList<T>, IDisposable

public bool IsCompleted => isCompleted;

public Result CompletedValue
public Result Result
{
get
{
Expand Down
8 changes: 4 additions & 4 deletions tests/R3.Tests/FactoryTests/ThrowTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public void Throw()
var e = new Exception();
using var list = Observable.Throw<int>(e).ToLiveList();
list.AssertEqual([]);
list.CompletedValue.IsFailure.Should().BeTrue();
list.CompletedValue.Exception.Should().Be(e);
list.Result.IsFailure.Should().BeTrue();
list.Result.Exception.Should().Be(e);
}
{
var fakeTime = new FakeTimeProvider();
Expand All @@ -25,8 +25,8 @@ public void Throw()

fakeTime.Advance(TimeSpan.FromSeconds(1));
list.AssertEqual([]);
list.CompletedValue.IsFailure.Should().BeTrue();
list.CompletedValue.Exception.Should().Be(e);
list.Result.IsFailure.Should().BeTrue();
list.Result.Exception.Should().Be(e);
}
}
}
2 changes: 1 addition & 1 deletion tests/R3.Tests/FactoryTests/ToObservableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void ObservableToObservable()
var l2 = new FaileObservable().ToObservable().ToLiveList();
l2.AssertEqual([1, 2, 3]);
l2.AssertIsCompleted();
l2.CompletedValue.IsFailure.Should().BeTrue();
l2.Result.IsFailure.Should().BeTrue();
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion tests/R3.Tests/OperatorTests/MaterializeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Dematerialize()
publisher.OnCompleted(new Exception("comp"));

list.AssertEqual([10, 20, 30]);
list.CompletedValue.IsFailure.Should().BeTrue();
list.Result.IsFailure.Should().BeTrue();
list.AssertIsCompleted();
}
}
2 changes: 1 addition & 1 deletion tests/R3.Tests/OperatorTests/OnErrorResumeAsFailureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void OnErrorResumeAsFailure()

list.AssertEqual([10]);
list.AssertIsCompleted();
list.CompletedValue.Exception!.Message.Should().Be("foo");
list.Result.Exception!.Message.Should().Be("foo");

}
}
4 changes: 2 additions & 2 deletions tests/R3.Tests/OperatorTests/TimeoutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void Timeout()
list.AssertEqual([1, 1000, 10000]);
timeProvider.Advance(TimeSpan.FromSeconds(1));
list.AssertIsCompleted();
list.CompletedValue.Exception!.Should().BeOfType<TimeoutException>();
list.Result.Exception!.Should().BeOfType<TimeoutException>();
}

[Fact]
Expand All @@ -51,6 +51,6 @@ public void TimeoutFrame()
list.AssertEqual([1, 1000, 10000]);
frameProvider.Advance(1);
list.AssertIsCompleted();
list.CompletedValue.Exception!.Should().BeOfType<TimeoutException>();
list.Result.Exception!.Should().BeOfType<TimeoutException>();
}
}
6 changes: 3 additions & 3 deletions tests/R3.Tests/SubjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void SubscribeAfterCompleted()
using var l = s.ToLiveList();

l.AssertIsCompleted();
l.CompletedValue.IsSuccess.Should().BeTrue();
l.Result.IsSuccess.Should().BeTrue();
}
{
// after Failure
Expand All @@ -91,8 +91,8 @@ public void SubscribeAfterCompleted()
using var l = s.ToLiveList();

l.AssertIsCompleted();
l.CompletedValue.IsFailure.Should().BeTrue();
l.CompletedValue.Exception!.Message.Should().Be("foo");
l.Result.IsFailure.Should().BeTrue();
l.Result.Exception!.Message.Should().Be("foo");
}
}
}

0 comments on commit 3ca76bb

Please sign in to comment.