public async Task SlimClientGetsNotificationMessages(ChannelType type) { // Arrange var gateway = CreatePrimaryGateway(type); var clientChannel = await CreatePrimaryClientChannelAsync(type); var entry = clientChannel.CreateRef <EntryRef>(); // Act var greeter = await entry.GetGreeter(); var greetObserver = new TestGreetObserver(); var observer = clientChannel.CreateObserver <IGreetObserver>(greetObserver); await greeter.Subscribe(observer); await greeter.Greet("World"); await greeter.Greet("Actor"); await greeter.Unsubscribe(observer); clientChannel.RemoveObserver(observer); await greeter.Greet("Akka"); // Assert Assert.Equal(new[] { "Greet(World)", "Greet(Actor)" }, greetObserver.Logs); }
public async Task SlimClientGetsNotificationMessages(ChannelType type) { // Arrange var gateway = CreatePrimaryGateway(type); var clientChannel = await CreatePrimaryClientChannelAsync(type); var entry = clientChannel.CreateRef<EntryRef>(); // Act var greeter = await entry.GetGreeter(); var greetObserver = new TestGreetObserver(); var observer = clientChannel.CreateObserver<IGreetObserver>(greetObserver); await greeter.Subscribe(observer); await greeter.Greet("World"); await greeter.Greet("Actor"); await greeter.Unsubscribe(observer); clientChannel.RemoveObserver(observer); await greeter.Greet("Akka"); // Assert Assert.Equal(new[] { "Greet(World)", "Greet(Actor)" }, greetObserver.Logs); }