예제 #1
0
        public void SubscribeTest()
        {
            Observable <TestEntity>        sut          = new ObservableImpl();
            Mock <IObserver <TestEntity> > observerMock = new();
            IDisposable sub = sut.Subscribe(observerMock.Object);

            Assert.NotNull(sub);
        }
예제 #2
0
        private static void UsingObservableImpl()
        {
            var a = new ObservableImpl<string>();

            a.Where(item => item is ObservableImpl<string>.ItemAdded)
             .Subscribe(item => Console.WriteLine("Added: " + item));

            a.Where(item => item is ObservableImpl<string>.ItemRemoved)
             .Subscribe(item => Console.WriteLine("Removed: " + item));

            a.Add("a");
            a.Add("b");
            a.Add("c");
            a.Add("d");
            a.Add("e");
            a.Add("f");
        }