Esempio n. 1
0
        public void RemoveListener_CanBeCalledFromUpdate()
        {
            // Arrange
            var updateSource = new AsyncUpdateSource();
            var observer     = Substitute.For <IAsyncUpdatable>();

            observer.When(x => x.Update(Arg.Any <float>())).Do(x => updateSource.RemoveListener(observer));
            updateSource.AddListener(observer);

            // Act
            updateSource.OnNext(0);
            updateSource.OnNext(0);

            // Assert
            observer.Received(1).Update(Arg.Any <float>());
        }
Esempio n. 2
0
 public void Dispose()
 {
     _parent.RemoveListener(_observer);
 }